Class: Vonage::ProactiveConnect::List

Inherits:
Namespace
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/vonage/proactive_connect/list.rb

Instance Method Summary collapse

Instance Method Details

#clear_items(id:) ⇒ Object

Clear list by deleting all items

Examples:

response = proactive_connect.list.clear_items(id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865')

Parameters:

  • :id (required, String)

    Unique identifier for the list

See Also:



144
145
146
147
148
149
# File 'lib/vonage/proactive_connect/list.rb', line 144

def clear_items(id:)
  request(
    "/v0.1/bulk/lists/#{id}/clear",
    type: Post
  )
end

#create(name:, **params) ⇒ Object

Create list

Examples:

response = proactive_connect.list.create(name: 'List Number 1')

Parameters:

  • :name (required, String)

    A name for the list

  • :description (optional, String)

    A description of the list

  • :tags (optional, Array)

    An Array of up to 10 Strings assigining tags to the list. Each String must be between 1 and 15 characters

  • :attributes (optional, Array)

    Array of Hash objects. Each Hash represents an attribute for the list.

  • :datasource (optional, Hash)

    Datasource for the list

  • attributes (Hash)

    a customizable set of options

  • datasource (Hash)

    a customizable set of options

See Also:



49
50
51
52
53
54
55
# File 'lib/vonage/proactive_connect/list.rb', line 49

def create(name:, **params)
  request(
    "/v0.1/bulk/lists",
    params: params.merge({ name: name }),
    type: Post
  )
end

#delete(id:) ⇒ Object

Delete a list by id

Examples:

response = proactive_connect.list.delete(id: '74ea1ecf-06c9-4072-a285-61677bd353e8')

Parameters:

  • :id (required, String)

    Unique identifier for the list

See Also:



127
128
129
130
131
132
# File 'lib/vonage/proactive_connect/list.rb', line 127

def delete(id:)
  request(
    "/v0.1/bulk/lists/#{id}",
    type: Delete
  )
end

#fetch_and_replace_items(id:) ⇒ Object

Fetch and replace all items from datasource

Examples:

response = proactive_connect.list.fetch_and_replace_items(id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865')

Parameters:

  • :id (required, String)

    Unique identifier for the list

See Also:



161
162
163
164
165
166
# File 'lib/vonage/proactive_connect/list.rb', line 161

def fetch_and_replace_items(id:)
  request(
    "/v0.1/bulk/lists/#{id}/fetch",
    type: Post
  )
end

#find(id:) ⇒ Object

Get list by id

Examples:

response = proactive_connect.list.find(id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865')

Parameters:

  • :id (required, String)

    Unique identifier for the list

See Also:



67
68
69
# File 'lib/vonage/proactive_connect/list.rb', line 67

def find(id:)
  request("/v0.1/bulk/lists/#{id}")
end

#update(id:, name:, **params) ⇒ Object

Update list

Examples:

response = proactive_connect.list.update(name: 'List Number 1')

Parameters:

  • :id (required, String)

    The id of the list to update

  • :name (required, String)

    The name of the list

  • :description (optional, String)

    A description of the list

  • :tags (optional, Array)

    An Array of up to 10 Strings assigining tags to the list. Each String must be between 1 and 15 characters

  • :attributes (optional, Array)

    Array of Hash objects. Each Hash represents an attribute for the list.

  • :datasource (optional, Hash)

    Datasource for the list

  • attributes (Hash)

    a customizable set of options

  • datasource (Hash)

    a customizable set of options

See Also:



109
110
111
112
113
114
115
# File 'lib/vonage/proactive_connect/list.rb', line 109

def update(id:, name:, **params)
  request(
    "/v0.1/bulk/lists/#{id}",
    params: params.merge({ name: name }),
    type: Put
  )
end