Class: HubSpotSDK::Resources::Crm::Objects::Contracts::Batch
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Crm::Objects::Contracts::Batch
- Defined in:
- lib/hubspot_sdk/resources/crm/objects/contracts/batch.rb
Instance Method Summary collapse
-
#create(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Create multiple contracts in a single request by providing the necessary properties and associations for each contract.
-
#delete(inputs:, request_options: {}) ⇒ nil
Archive a batch of contracts by 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::Contracts::BatchGetParams for more details.
-
#initialize(client:) ⇒ Batch
constructor
private
A new instance of Batch.
-
#update(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Update multiple contracts by 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.
140 141 142 |
# File 'lib/hubspot_sdk/resources/crm/objects/contracts/batch.rb', line 140 def initialize(client:) @client = client end |
Instance Method Details
#create(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::BatchResponseSimplePublicObject
Create multiple contracts in a single request by providing the necessary properties and associations for each contract. This endpoint returns a batch response containing the details of each created contract.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/hubspot_sdk/resources/crm/objects/contracts/batch.rb', line 21 def create(params) parsed, = HubSpotSDK::Crm::Objects::Contracts::BatchCreateParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/contracts/batch/create", body: parsed, model: HubSpotSDK::Crm::BatchResponseSimplePublicObject, options: ) end |
#delete(inputs:, request_options: {}) ⇒ nil
Archive a batch of contracts by their IDs. This operation moves the specified contracts to the archive, making them inactive but still retrievable if needed.
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/hubspot_sdk/resources/crm/objects/contracts/batch.rb', line 66 def delete(params) parsed, = HubSpotSDK::Crm::Objects::Contracts::BatchDeleteParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/contracts/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::Contracts::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/contracts/batch.rb', line 100 def get(params) query_params = [:archived] parsed, = HubSpotSDK::Crm::Objects::Contracts::BatchGetParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, path: "crm/objects/2026-03/contracts/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 contracts by their internal IDs or unique property values. This endpoint allows you to modify the properties of several contracts in a single request, streamlining the update process for batch operations.
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/hubspot_sdk/resources/crm/objects/contracts/batch.rb', line 44 def update(params) parsed, = HubSpotSDK::Crm::Objects::Contracts::BatchUpdateParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/contracts/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.
126 127 128 129 130 131 132 133 134 135 |
# File 'lib/hubspot_sdk/resources/crm/objects/contracts/batch.rb', line 126 def upsert(params) parsed, = HubSpotSDK::Crm::Objects::Contracts::BatchUpsertParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/contracts/batch/upsert", body: parsed, model: HubSpotSDK::Crm::BatchResponseSimplePublicUpsertObject, options: ) end |