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:


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

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

#delete(id) ⇒ Response

Delete a user.

Parameters:

  • id (String)

Returns:

See Also:


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

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

#get(id) ⇒ Response

Retrieve a user.

Parameters:

  • id (String)

Returns:

See Also:


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

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

#listResponse

List users.


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

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:


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

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