Class: Tomba::LeadsAttributes

Inherits:
Service
  • Object
show all
Defined in:
lib/tomba/services/leads-attributes.rb

Overview

Leads Attributes service for managing lead attributes.

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

Instance Method Summary collapse

Methods inherited from Service

#initialize

Constructor Details

This class inherits a constructor from Tomba::Service

Instance Method Details

#create_lead_attributeHash

Create a new lead attribute.

Creates a new lead attribute for organizing lead data.

Returns:

  • (Hash)

    API response containing the new attribute

Raises:

See Also:



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

def create_lead_attribute
  path = '/leads/attributes'

  params = {}

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

#delete_lead_attribute(id:) ⇒ Hash

Delete a lead attribute.

Removes a specific lead attribute by its ID.

Parameters:

  • id (String)

    the attribute 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-attributes.rb', line 35

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

  path = "/leads/attributes/#{id}"

  params = {}

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

#get_lead_attributesHash

List all lead attributes.

Returns all lead attributes associated with the account.

Returns:

  • (Hash)

    API response containing the attributes

Raises:

See Also:



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

def get_lead_attributes
  path = '/leads/attributes'

  params = {}

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

#update_lead_attribute(id:) ⇒ Hash

Update a lead attribute.

Updates a specific lead attribute by its ID.

Parameters:

  • id (String)

    the attribute 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-attributes.rb', line 72

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

  path = "/leads/attributes/#{id}"

  params = {}

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