Class: Nexmo::Conversations::Users

Inherits:
Namespace
  • Object
show all
Defined in:
lib/nexmo/conversations/users.rb

Instance Method Summary collapse

Instance Method Details

#create(params) ⇒ Response

Create a user.

Parameters:

  • params (Hash)

Options Hash (params):

  • :name (String)

    Unique name for a user.

  • :display_name (String)

    A string to be displayed as user name. It does not need to be unique.

  • :image_url (String)

    A link to an image for conversations’ and users’ avatars.

Returns:

See Also:



28
29
30
# File 'lib/nexmo/conversations/users.rb', line 28

def create(params)
  request('/beta/users', params: params, type: Post)
end

#delete(id) ⇒ Response

Delete a user.

Parameters:

  • id (String)

Returns:

See Also:



89
90
91
# File 'lib/nexmo/conversations/users.rb', line 89

def delete(id)
  request('/beta/users/' + id, type: Delete)
end

#get(id) ⇒ Response

Retrieve a user.

Parameters:

  • id (String)

Returns:

See Also:



50
51
52
# File 'lib/nexmo/conversations/users.rb', line 50

def get(id)
  request('/beta/users/' + id)
end

#listResponse

List users.



38
39
40
# File 'lib/nexmo/conversations/users.rb', line 38

def list
  request('/beta/users')
end

#update(id, params) ⇒ Response

Update a user.

Parameters:

  • id (String)
  • params (Hash)

Options Hash (params):

  • :name (String)

    Unique name for a user.

  • :display_name (String)

    A string to be displayed as user name. It does not need to be unique.

  • :image_url (String)

    A link to an image for conversations’ and users’ avatars.

  • :channels (Hash)

    A user who joins a conversation as a member can have one channel per membership type. Channels can be ‘app`, `phone`, `sip`, `websocket`, or `vbc`.

Returns:

See Also:



77
78
79
# File 'lib/nexmo/conversations/users.rb', line 77

def update(id, params)
  request('/beta/users/' + id, params: params, type: Put)
end