Class: Tomba::LeadsLists

Inherits:
Service show all
Defined in:
lib/tomba/services/leads-lists.rb

Overview

Leads Lists service for managing lead lists.

Provides methods to list, create, update, and delete lead lists.

Instance Method Summary collapse

Methods inherited from Service

#initialize

Constructor Details

This class inherits a constructor from Tomba::Service

Instance Method Details

#create_listHash

Create a new leads list.

Creates a new leads list for organizing leads.

Returns:

  • (Hash)

    API response containing the new list

Raises:

See Also:



54
55
56
57
58
59
60
61
62
# File 'lib/tomba/services/leads-lists.rb', line 54

def create_list
  path = '/leads_lists'

  params = {}

  @client.call('post', path, {
                 'content-type' => 'application/json'
               }, params)
end

#delete_list_id(id:) ⇒ Hash

Delete a leads list.

Removes a specific leads list by its ID.

Parameters:

  • id (String)

    the list ID to delete

Returns:

  • (Hash)

    API response

Raises:

See Also:



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/tomba/services/leads-lists.rb', line 35

def delete_list_id(id:)
  raise Tomba::Exception, 'Missing required parameter: "id"' if id.nil?

  path = "/leads_lists/#{id}"

  params = {}

  @client.call('delete', path, {
                 'content-type' => 'application/json'
               }, params)
end

#get_listsHash

List all leads lists.

Returns all leads lists associated with the account.

Returns:

  • (Hash)

    API response containing the lists

Raises:

See Also:



17
18
19
20
21
22
23
24
25
# File 'lib/tomba/services/leads-lists.rb', line 17

def get_lists
  path = '/leads_lists'

  params = {}

  @client.call('get', path, {
                 'content-type' => 'application/json'
               }, params)
end

#update_list_id(id:) ⇒ Hash

Update a leads list.

Updates a specific leads list by its ID.

Parameters:

  • id (String)

    the list ID to update

Returns:

  • (Hash)

    API response

Raises:

See Also:



72
73
74
75
76
77
78
79
80
81
82
# File 'lib/tomba/services/leads-lists.rb', line 72

def update_list_id(id:)
  raise Tomba::Exception, 'Missing required parameter: "id"' if id.nil?

  path = "/leads_lists/#{id}"

  params = {}

  @client.call('put', path, {
                 'content-type' => 'application/json'
               }, params)
end