Class: HubSpotSDK::Resources::Crm::Objects::Products::Batch
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Crm::Objects::Products::Batch
- Defined in:
- lib/hubspot_sdk/resources/crm/objects/products/batch.rb
Instance Method Summary collapse
-
#create(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Create multiple products in a single request by specifying their properties, and receive a response containing the details of the created products.
-
#delete(inputs:, request_options: {}) ⇒ nil
Archive multiple products at once by providing their IDs.
-
#get(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::Products::BatchGetParams for more details.
-
#initialize(client:) ⇒ Batch
constructor
private
A new instance of Batch.
-
#update(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Update multiple products in a single request using their internal IDs or unique property values.
-
#upsert(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.
142 143 144 |
# File 'lib/hubspot_sdk/resources/crm/objects/products/batch.rb', line 142 def initialize(client:) @client = client end |
Instance Method Details
#create(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Create multiple products in a single request by specifying their properties, and receive a response containing the details of the created products.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/hubspot_sdk/resources/crm/objects/products/batch.rb', line 20 def create(params) parsed, = HubSpotSDK::Crm::Objects::Products::BatchCreateParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/products/batch/create", body: parsed, model: HubSpotSDK::Crm::BatchResponseSimplePublicObject, options: ) end |
#delete(inputs:, request_options: {}) ⇒ nil
Archive multiple products at once by providing their IDs. This operation moves the specified products to the recycling bin, effectively removing them from active use without permanently deleting them.
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/hubspot_sdk/resources/crm/objects/products/batch.rb', line 68 def delete(params) parsed, = HubSpotSDK::Crm::Objects::Products::BatchDeleteParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/products/batch/archive", body: parsed, model: NilClass, options: ) end |
#get(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::Products::BatchGetParams for more details.
Retrieve records by record ID or include the ‘idProperty` parameter to retrieve records by a custom unique value property.
102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/hubspot_sdk/resources/crm/objects/products/batch.rb', line 102 def get(params) query_params = [:archived] parsed, = HubSpotSDK::Crm::Objects::Products::BatchGetParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, path: "crm/objects/2026-03/products/batch/read", query: query, body: parsed.except(*query_params), model: HubSpotSDK::Crm::BatchResponseSimplePublicObject, options: ) end |
#update(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Update multiple products in a single request using their internal IDs or unique property values. This batch operation allows for efficient modifications of product records by specifying the properties to be updated. Ensure that the provided property values are correct, as read-only and non-existent properties will result in an error.
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/hubspot_sdk/resources/crm/objects/products/batch.rb', line 45 def update(params) parsed, = HubSpotSDK::Crm::Objects::Products::BatchUpdateParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/products/batch/update", body: parsed, model: HubSpotSDK::Crm::BatchResponseSimplePublicObject, options: ) end |
#upsert(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.
128 129 130 131 132 133 134 135 136 137 |
# File 'lib/hubspot_sdk/resources/crm/objects/products/batch.rb', line 128 def upsert(params) parsed, = HubSpotSDK::Crm::Objects::Products::BatchUpsertParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/products/batch/upsert", body: parsed, model: HubSpotSDK::Crm::BatchResponseSimplePublicUpsertObject, options: ) end |