Class: HubSpotSDK::Resources::Crm::AssociationsSchema::Labels

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot_sdk/resources/crm/associations_schema/labels.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Labels

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Labels.

Parameters:



186
187
188
# File 'lib/hubspot_sdk/resources/crm/associations_schema/labels.rb', line 186

def initialize(client:)
  @client = client
end

Instance Method Details

#batch_create(to_object_type, from_object_type:, inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponsePublicAssociationDefinitionUserConfiguration

Batch configure association limits between two object types.

Parameters:

Returns:

See Also:



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/hubspot_sdk/resources/crm/associations_schema/labels.rb', line 23

def batch_create(to_object_type, params)
  parsed, options = HubSpotSDK::Crm::AssociationsSchema::LabelBatchCreateParams.dump_request(params)
  from_object_type =
    parsed.delete(:from_object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: [
      "crm/associations/2026-03/definitions/configurations/%1$s/%2$s/batch/create",
      from_object_type,
      to_object_type
    ],
    body: parsed,
    model: HubSpotSDK::Crm::BatchResponsePublicAssociationDefinitionUserConfiguration,
    options: options
  )
end

#create_label(to_object_type, from_object_type:, label:, name:, inverse_label: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::CollectionResponseAssociationSpecWithLabelNoPaging

Some parameter documentations has been truncated, see Models::Crm::AssociationsSchema::LabelCreateLabelParams for more details.

Create a new label that describes the relationship between two specified CRM object types. This can help in categorizing and managing associations more effectively.

Parameters:

  • to_object_type (String)

    Path param

  • from_object_type (String)

    Path param

  • label (String)

    Body param: A descriptor that provides context about the relationship between tw

  • name (String)

    Body param: The unique identifier for the association definition.

  • inverse_label (String)

    Body param: An optional descriptor that clarifies the reverse relationship in th

  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/hubspot_sdk/resources/crm/associations_schema/labels.rb', line 67

def create_label(to_object_type, params)
  parsed, options = HubSpotSDK::Crm::AssociationsSchema::LabelCreateLabelParams.dump_request(params)
  from_object_type =
    parsed.delete(:from_object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: ["crm/associations/2026-03/%1$s/%2$s/labels", from_object_type, to_object_type],
    body: parsed,
    model: HubSpotSDK::Crm::CollectionResponseAssociationSpecWithLabelNoPaging,
    options: options
  )
end

#delete_label(association_type_id, from_object_type:, to_object_type:, request_options: {}) ⇒ nil

Remove a specific label from the association between two CRM object types.

Parameters:

  • association_type_id (Integer)
  • from_object_type (String)
  • to_object_type (String)
  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/hubspot_sdk/resources/crm/associations_schema/labels.rb', line 94

def delete_label(association_type_id, params)
  parsed, options = HubSpotSDK::Crm::AssociationsSchema::LabelDeleteLabelParams.dump_request(params)
  from_object_type =
    parsed.delete(:from_object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  to_object_type =
    parsed.delete(:to_object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :delete,
    path: [
      "crm/associations/2026-03/%1$s/%2$s/labels/%3$s",
      from_object_type,
      to_object_type,
      association_type_id
    ],
    model: NilClass,
    options: options
  )
end

#list_labels(to_object_type, from_object_type:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::CollectionResponseAssociationSpecWithLabelNoPaging

Retrieve all labels that describe the relationships between two specified CRM object types. These labels provide context about the nature of the associations.

Parameters:

Returns:

See Also:



129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/hubspot_sdk/resources/crm/associations_schema/labels.rb', line 129

def list_labels(to_object_type, params)
  parsed, options = HubSpotSDK::Crm::AssociationsSchema::LabelListLabelsParams.dump_request(params)
  from_object_type =
    parsed.delete(:from_object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["crm/associations/2026-03/%1$s/%2$s/labels", from_object_type, to_object_type],
    model: HubSpotSDK::Crm::CollectionResponseAssociationSpecWithLabelNoPaging,
    options: options
  )
end

#update_label(to_object_type, from_object_type:, association_type_id:, label:, inverse_label: nil, request_options: {}) ⇒ nil

Some parameter documentations has been truncated, see Models::Crm::AssociationsSchema::LabelUpdateLabelParams for more details.

Update an existing label that describes the relationship between two specified CRM object types. This allows for modifications to existing association labels to better reflect the nature of the relationship.

Parameters:

  • to_object_type (String)

    Path param

  • from_object_type (String)

    Path param

  • association_type_id (Integer)

    Body param: The unique identifier for the association type.

  • label (String)

    Body param: A descriptor that provides context about the relationship between as

  • inverse_label (String)

    Body param: An optional descriptor for the inverse relationship between associat

  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/hubspot_sdk/resources/crm/associations_schema/labels.rb', line 168

def update_label(to_object_type, params)
  parsed, options = HubSpotSDK::Crm::AssociationsSchema::LabelUpdateLabelParams.dump_request(params)
  from_object_type =
    parsed.delete(:from_object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :put,
    path: ["crm/associations/2026-03/%1$s/%2$s/labels", from_object_type, to_object_type],
    body: parsed,
    model: NilClass,
    options: options
  )
end