Class: Vonage::ProactiveConnect::Item

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

Instance Method Summary collapse

Instance Method Details

#create(list_id:, data:) ⇒ Object

Deprecated.

Create a list item

Examples:

response = proactive_connect.item.create(list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865', data: {name: 'Joe Bloggs', email: '[email protected]'})

Parameters:

  • :list_id (required, String)

    Unique identifier for the list

  • :data (required, Hash)

    A hash of data containing the item’s data attributes and values

Raises:

  • (ArgumentError)

See Also:



29
30
31
32
33
34
35
36
37
# File 'lib/vonage/proactive_connect/item.rb', line 29

def create(list_id:, data:)
  logger.info('This method is deprecated and will be removed in a future release.')
  raise ArgumentError.new(":data must be a Hash") unless data.is_a? Hash
  request(
    "/v0.1/bulk/lists/#{list_id}/items",
    params: { data: data },
    type: Post
  )
end

#delete(list_id:, item_id:) ⇒ Object

Deprecated.

Delete list item

Examples:

response = proactive_connect.item.delete(list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865', item_id: 'd97ebf20-e4de-4e50-921a-7bb4dceb373a')

Parameters:

  • :list_id (required, String)

    Unique identifier for the list

  • :item_id (required, String)

    Unique identifier for the item

See Also:



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

def delete(list_id:, item_id:)
  logger.info('This method is deprecated and will be removed in a future release.')
  request(
    "/v0.1/bulk/lists/#{list_id}/items/#{item_id}",
    type: Delete
  )
end

#find(list_id:, item_id:) ⇒ Object

Deprecated.

Get list item by id

Examples:

response = proactive_connect.item.find(list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865', item_id: 'd97ebf20-e4de-4e50-921a-7bb4dceb373a')

Parameters:

  • :list_id (required, String)

    Unique identifier for the list

  • :item_id (required, String)

    Unique identifier for the item

See Also:



54
55
56
57
# File 'lib/vonage/proactive_connect/item.rb', line 54

def find(list_id:, item_id:)
  logger.info('This method is deprecated and will be removed in a future release.')
  request("/v0.1/bulk/lists/#{list_id}/items/#{item_id}")
end

#update(list_id:, item_id:, data:) ⇒ Object

Deprecated.

Update list item

Examples:

response = proactive_connect.item.create(
  list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865',
  item_id: 'd97ebf20-e4de-4e50-921a-7bb4dceb373a',
  data: {name: 'Jane Bloggs', email: '[email protected]'}
)

Parameters:

  • :list_id (required, String)

    Unique identifier for the list

  • :item_id (required, String)

    Unique identifier for the item

  • :data (required, Hash)

    A hash of data containing the item’s data attributes and values All attributes for the item must be passed, even ones for which the value is not changing.

    If an attribute is omitted, existing data for that attribute will be deleted.
    

Raises:

  • (ArgumentError)

See Also:



83
84
85
86
87
88
89
90
91
# File 'lib/vonage/proactive_connect/item.rb', line 83

def update(list_id:, item_id:, data:)
  logger.info('This method is deprecated and will be removed in a future release.')
  raise ArgumentError.new(":data must be a Hash") unless data.is_a? Hash
  request(
    "/v0.1/bulk/lists/#{list_id}/items/#{item_id}",
    params: { data: data },
    type: Put
  )
end