Class: Vonage::Conversations::Users

Inherits:
Namespace
  • Object
show all
Defined in:
lib/vonage/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/vonage/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:



93
94
95
# File 'lib/vonage/conversations/users.rb', line 93

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

#get(id) ⇒ Response

Retrieve a user.

Parameters:

  • id (String)

Returns:

See Also:



54
55
56
# File 'lib/vonage/conversations/users.rb', line 54

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

#list(params = nil, auto_advance = true) ⇒ Response

List users.

Parameters:

  • params (Hash) (defaults to: nil)

    a customizable set of options

Options Hash (params):

  • :auto_advance (Boolean)

    Set this to false to not auto-advance through all the pages in the record and collect all the data. The default is true.

Returns:

See Also:



42
43
44
# File 'lib/vonage/conversations/users.rb', line 42

def list(params = nil, auto_advance = true)
  request('/beta/users', params: params)
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:



81
82
83
# File 'lib/vonage/conversations/users.rb', line 81

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