Class: HubSpotSDK::Resources::Crm::Objects::Communications::Batch
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Crm::Objects::Communications::Batch
- Defined in:
- lib/hubspot_sdk/resources/crm/objects/communications/batch.rb
Instance Method Summary collapse
-
#create(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Create a batch of messages.
-
#delete(inputs:, request_options: {}) ⇒ nil
Delete a batch of messages by ID.
-
#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::Communications::BatchGetParams for more details.
-
#initialize(client:) ⇒ Batch
constructor
private
A new instance of Batch.
-
#update(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Update a batch of messages by ID (‘communicationId`) or unique property value (`idProperty`).
-
#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.
145 146 147 |
# File 'lib/hubspot_sdk/resources/crm/objects/communications/batch.rb', line 145 def initialize(client:) @client = client end |
Instance Method Details
#create(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Create a batch of messages. The ‘inputs` array can contain a `properties` object to define property values for each message, along with an `associations` array to define [associations](developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/hubspot_sdk/resources/crm/objects/communications/batch.rb', line 23 def create(params) parsed, = HubSpotSDK::Crm::Objects::Communications::BatchCreateParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/communications/batch/create", body: parsed, model: HubSpotSDK::Crm::BatchResponseSimplePublicObject, options: ) end |
#delete(inputs:, request_options: {}) ⇒ nil
Delete a batch of messages by ID. A deleted message can be restored within 90 days of being deleted. Learn more about [restoring activity records](knowledge.hubspot.com/records/restore-deleted-activity-in-a-record).
70 71 72 73 74 75 76 77 78 79 |
# File 'lib/hubspot_sdk/resources/crm/objects/communications/batch.rb', line 70 def delete(params) parsed, = HubSpotSDK::Crm::Objects::Communications::BatchDeleteParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/communications/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::Communications::BatchGetParams for more details.
Retrieve a batch of messages by ID (‘communicationId`) or unique property value (`idProperty`).
105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/hubspot_sdk/resources/crm/objects/communications/batch.rb', line 105 def get(params) query_params = [:archived] parsed, = HubSpotSDK::Crm::Objects::Communications::BatchGetParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, path: "crm/objects/2026-03/communications/batch/read", query: query, body: parsed.except(*query_params), model: HubSpotSDK::Crm::BatchResponseSimplePublicObject, options: ) end |
#update(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Update a batch of messages by ID (‘communicationId`) or unique property value (`idProperty`). Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string.
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/hubspot_sdk/resources/crm/objects/communications/batch.rb', line 47 def update(params) parsed, = HubSpotSDK::Crm::Objects::Communications::BatchUpdateParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/communications/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.
131 132 133 134 135 136 137 138 139 140 |
# File 'lib/hubspot_sdk/resources/crm/objects/communications/batch.rb', line 131 def upsert(params) parsed, = HubSpotSDK::Crm::Objects::Communications::BatchUpsertParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/communications/batch/upsert", body: parsed, model: HubSpotSDK::Crm::BatchResponseSimplePublicUpsertObject, options: ) end |