Class: HubSpotSDK::Resources::Marketing::Campaigns::Batch
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Marketing::Campaigns::Batch
- Defined in:
- lib/hubspot_sdk/resources/marketing/campaigns/batch.rb
Instance Method Summary collapse
-
#create(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::BatchResponsePublicCampaign
Some parameter documentations has been truncated, see Models::Marketing::Campaigns::BatchCreateParams for more details.
-
#delete(inputs:, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Marketing::Campaigns::BatchDeleteParams for more details.
-
#get(inputs:, end_date: nil, properties: nil, start_date: nil, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::BatchResponsePublicCampaignWithAssets
Some parameter documentations has been truncated, see Models::Marketing::Campaigns::BatchGetParams for more details.
-
#initialize(client:) ⇒ Batch
constructor
private
A new instance of Batch.
-
#update(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::BatchResponsePublicCampaign
Some parameter documentations has been truncated, see Models::Marketing::Campaigns::BatchUpdateParams for more details.
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.
133 134 135 |
# File 'lib/hubspot_sdk/resources/marketing/campaigns/batch.rb', line 133 def initialize(client:) @client = client end |
Instance Method Details
#create(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::BatchResponsePublicCampaign
Some parameter documentations has been truncated, see Models::Marketing::Campaigns::BatchCreateParams for more details.
This endpoint creates a batch of campaigns. The maximum number of items in a batch request is 50. The campaigns in the response are not guaranteed to be in the same order as they were provided in the request.
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/hubspot_sdk/resources/marketing/campaigns/batch.rb', line 24 def create(params) parsed, = HubSpotSDK::Marketing::Campaigns::BatchCreateParams.dump_request(params) @client.request( method: :post, path: "marketing/campaigns/2026-03/batch/create", body: parsed, model: HubSpotSDK::Marketing::BatchResponsePublicCampaign, options: ) end |
#delete(inputs:, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Marketing::Campaigns::BatchDeleteParams for more details.
This endpoint deletes a batch of campaigns. The maximum number of items in a batch request is 50. The response will always be 204 No Content, regardless of whether the campaigns exist or not, whether they were successfully deleted or not, or if only some of the campaigns in the batch were deleted.
80 81 82 83 84 85 86 87 88 89 |
# File 'lib/hubspot_sdk/resources/marketing/campaigns/batch.rb', line 80 def delete(params) parsed, = HubSpotSDK::Marketing::Campaigns::BatchDeleteParams.dump_request(params) @client.request( method: :post, path: "marketing/campaigns/2026-03/batch/archive", body: parsed, model: NilClass, options: ) end |
#get(inputs:, end_date: nil, properties: nil, start_date: nil, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::BatchResponsePublicCampaignWithAssets
Some parameter documentations has been truncated, see Models::Marketing::Campaigns::BatchGetParams for more details.
This endpoint reads a batch of campaigns based on the provided input data and returns the campaigns along with their associated assets. The maximum number of items in a batch request is 50. The campaigns in the response are not guaranteed to be in the same order as they were provided in the request. If duplicate campaign IDs are provided in the request, duplicates will be ignored. The response will include only unique IDs and will be returned without duplicates.
116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/hubspot_sdk/resources/marketing/campaigns/batch.rb', line 116 def get(params) query_params = [:end_date, :properties, :start_date] parsed, = HubSpotSDK::Marketing::Campaigns::BatchGetParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, path: "marketing/campaigns/2026-03/batch/read", query: query.transform_keys(end_date: "endDate", start_date: "startDate"), body: parsed.except(*query_params), model: HubSpotSDK::Marketing::BatchResponsePublicCampaignWithAssets, options: ) end |
#update(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::BatchResponsePublicCampaign
Some parameter documentations has been truncated, see Models::Marketing::Campaigns::BatchUpdateParams for more details.
This endpoint updates a batch of campaigns based on the provided input data. The maximum number of items in a batch request is 50. If an empty string (“”) is passed for any property in the Batch Update, it will reset that property’s value.
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/hubspot_sdk/resources/marketing/campaigns/batch.rb', line 52 def update(params) parsed, = HubSpotSDK::Marketing::Campaigns::BatchUpdateParams.dump_request(params) @client.request( method: :post, path: "marketing/campaigns/2026-03/batch/update", body: parsed, model: HubSpotSDK::Marketing::BatchResponsePublicCampaign, options: ) end |