Class: HubSpotSDK::Resources::Crm::Properties::Batch

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot_sdk/resources/crm/properties/batch.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Batch

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 Batch.

Parameters:



91
92
93
# File 'lib/hubspot_sdk/resources/crm/properties/batch.rb', line 91

def initialize(client:)
  @client = client
end

Instance Method Details

#create(object_type, inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseProperty

Create a batch of properties using the same rules as when creating an individual property.

Parameters:

Returns:

See Also:



20
21
22
23
24
25
26
27
28
29
# File 'lib/hubspot_sdk/resources/crm/properties/batch.rb', line 20

def create(object_type, params)
  parsed, options = HubSpotSDK::Crm::Properties::BatchCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["crm/properties/2026-03/%1$s/batch/create", object_type],
    body: parsed,
    model: HubSpotSDK::Crm::BatchResponseProperty,
    options: options
  )
end

#delete(object_type, inputs:, request_options: {}) ⇒ nil

Archive a provided list of properties. This method will return a 204 No Content response on success regardless of the initial state of the property (e.g. active, already archived, non-existent).

Parameters:

Returns:

  • (nil)

See Also:



44
45
46
47
48
49
50
51
52
53
# File 'lib/hubspot_sdk/resources/crm/properties/batch.rb', line 44

def delete(object_type, params)
  parsed, options = HubSpotSDK::Crm::Properties::BatchDeleteParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["crm/properties/2026-03/%1$s/batch/archive", object_type],
    body: parsed,
    model: NilClass,
    options: options
  )
end

#get(object_type, archived:, data_sensitivity:, inputs:, locale: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseProperty

Read a provided list of properties.

Parameters:

Returns:

See Also:



74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/hubspot_sdk/resources/crm/properties/batch.rb', line 74

def get(object_type, params)
  query_params = [:locale]
  parsed, options = HubSpotSDK::Crm::Properties::BatchGetParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params))
  @client.request(
    method: :post,
    path: ["crm/properties/2026-03/%1$s/batch/read", object_type],
    query: query,
    body: parsed.except(*query_params),
    model: HubSpotSDK::Crm::BatchResponseProperty,
    options: options
  )
end