Class: HubSpotSDK::Resources::Crm::Objects::Subscriptions::Batch
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Crm::Objects::Subscriptions::Batch
- Defined in:
- lib/hubspot_sdk/resources/crm/objects/subscriptions/batch.rb
Instance Method Summary collapse
-
#create(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Create multiple subscription objects in a single batch operation, allowing for efficient data entry and management.
-
#delete(inputs:, request_options: {}) ⇒ nil
Archive a batch of subscription objects by providing their IDs in the request body.
-
#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::Subscriptions::BatchGetParams for more details.
-
#initialize(client:) ⇒ Batch
constructor
private
A new instance of Batch.
-
#update(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Update multiple subscription objects in a single batch operation, allowing for efficient modifications of CRM subscription records.
-
#upsert(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicUpsertObject
This endpoint allows you to perform a batch upsert operation on subscription objects, which will either update existing records or create new ones if they do not already exist.
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.
140 141 142 |
# File 'lib/hubspot_sdk/resources/crm/objects/subscriptions/batch.rb', line 140 def initialize(client:) @client = client end |
Instance Method Details
#create(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Create multiple subscription objects in a single batch operation, allowing for efficient data entry and management.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/hubspot_sdk/resources/crm/objects/subscriptions/batch.rb', line 20 def create(params) parsed, = HubSpotSDK::Crm::Objects::Subscriptions::BatchCreateParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/subscriptions/batch/create", body: parsed, model: HubSpotSDK::Crm::BatchResponseSimplePublicObject, options: ) end |
#delete(inputs:, request_options: {}) ⇒ nil
Archive a batch of subscription objects by providing their IDs in the request body.
64 65 66 67 68 69 70 71 72 73 |
# File 'lib/hubspot_sdk/resources/crm/objects/subscriptions/batch.rb', line 64 def delete(params) parsed, = HubSpotSDK::Crm::Objects::Subscriptions::BatchDeleteParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/subscriptions/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::Subscriptions::BatchGetParams for more details.
Retrieve a batch of CRM subscription objects by their IDs, including specified properties and their histories.
99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/hubspot_sdk/resources/crm/objects/subscriptions/batch.rb', line 99 def get(params) query_params = [:archived] parsed, = HubSpotSDK::Crm::Objects::Subscriptions::BatchGetParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, path: "crm/objects/2026-03/subscriptions/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 subscription objects in a single batch operation, allowing for efficient modifications of CRM subscription records.
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/hubspot_sdk/resources/crm/objects/subscriptions/batch.rb', line 42 def update(params) parsed, = HubSpotSDK::Crm::Objects::Subscriptions::BatchUpdateParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/subscriptions/batch/update", body: parsed, model: HubSpotSDK::Crm::BatchResponseSimplePublicObject, options: ) end |
#upsert(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicUpsertObject
This endpoint allows you to perform a batch upsert operation on subscription objects, which will either update existing records or create new ones if they do not already exist. The operation returns the status, timestamps, and a list of successfully processed objects.
126 127 128 129 130 131 132 133 134 135 |
# File 'lib/hubspot_sdk/resources/crm/objects/subscriptions/batch.rb', line 126 def upsert(params) parsed, = HubSpotSDK::Crm::Objects::Subscriptions::BatchUpsertParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/subscriptions/batch/upsert", body: parsed, model: HubSpotSDK::Crm::BatchResponseSimplePublicUpsertObject, options: ) end |