Class: HubSpotSDK::Resources::Crm::Objects::Custom::Batch
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Crm::Objects::Custom::Batch
- Defined in:
- lib/hubspot_sdk/resources/crm/objects/custom/batch.rb
Instance Method Summary collapse
-
#create(object_type, inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Create a batch of objects.
-
#delete(object_type, inputs:, request_options: {}) ⇒ nil
Archive a batch of objects by ID.
-
#get(object_type, inputs:, properties:, properties_with_history:, archived: nil, id_property: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Some parameter documentations has been truncated, see Models::Crm::Objects::Custom::BatchGetParams for more details.
-
#initialize(client:) ⇒ Batch
constructor
private
A new instance of Batch.
-
#update(object_type, inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Update a batch of objects by internal ID, or unique property values.
-
#upsert(object_type, inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicUpsertObject
Create or update records identified by a unique property value as specified by the ‘idProperty` query param.
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.
141 142 143 |
# File 'lib/hubspot_sdk/resources/crm/objects/custom/batch.rb', line 141 def initialize(client:) @client = client end |
Instance Method Details
#create(object_type, inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Create a batch of objects
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/hubspot_sdk/resources/crm/objects/custom/batch.rb', line 20 def create(object_type, params) parsed, = HubSpotSDK::Crm::Objects::Custom::BatchCreateParams.dump_request(params) @client.request( method: :post, path: ["crm/objects/2026-03/%1$s/batch/create", object_type], body: parsed, model: HubSpotSDK::Crm::BatchResponseSimplePublicObject, options: ) end |
#delete(object_type, inputs:, request_options: {}) ⇒ nil
Archive a batch of objects by ID
64 65 66 67 68 69 70 71 72 73 |
# File 'lib/hubspot_sdk/resources/crm/objects/custom/batch.rb', line 64 def delete(object_type, params) parsed, = HubSpotSDK::Crm::Objects::Custom::BatchDeleteParams.dump_request(params) @client.request( method: :post, path: ["crm/objects/2026-03/%1$s/batch/archive", object_type], body: parsed, model: NilClass, options: ) end |
#get(object_type, inputs:, properties:, properties_with_history:, archived: nil, id_property: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Some parameter documentations has been truncated, see Models::Crm::Objects::Custom::BatchGetParams for more details.
Retrieve records by record ID or include the ‘idProperty` parameter to retrieve records by a custom unique value property.
100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/hubspot_sdk/resources/crm/objects/custom/batch.rb', line 100 def get(object_type, params) query_params = [:archived] parsed, = HubSpotSDK::Crm::Objects::Custom::BatchGetParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, path: ["crm/objects/2026-03/%1$s/batch/read", object_type], query: query, body: parsed.except(*query_params), model: HubSpotSDK::Crm::BatchResponseSimplePublicObject, options: ) end |
#update(object_type, inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Update a batch of objects by internal ID, or unique property values
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/hubspot_sdk/resources/crm/objects/custom/batch.rb', line 42 def update(object_type, params) parsed, = HubSpotSDK::Crm::Objects::Custom::BatchUpdateParams.dump_request(params) @client.request( method: :post, path: ["crm/objects/2026-03/%1$s/batch/update", object_type], body: parsed, model: HubSpotSDK::Crm::BatchResponseSimplePublicObject, options: ) end |
#upsert(object_type, inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicUpsertObject
Create or update records identified by a unique property value as specified by the ‘idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object.
127 128 129 130 131 132 133 134 135 136 |
# File 'lib/hubspot_sdk/resources/crm/objects/custom/batch.rb', line 127 def upsert(object_type, params) parsed, = HubSpotSDK::Crm::Objects::Custom::BatchUpsertParams.dump_request(params) @client.request( method: :post, path: ["crm/objects/2026-03/%1$s/batch/upsert", object_type], body: parsed, model: HubSpotSDK::Crm::BatchResponseSimplePublicUpsertObject, options: ) end |