Class: HubSpotSDK::Resources::Cms::Blogs::Posts::Batch
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Cms::Blogs::Posts::Batch
- Defined in:
- lib/hubspot_sdk/resources/cms/blogs/posts/batch.rb
Instance Method Summary collapse
-
#create(inputs:, request_options: {}) ⇒ StringIO
Create a batch of blog posts, specifying their content in the request body.
-
#delete(inputs:, request_options: {}) ⇒ nil
Delete a blog post by ID.
-
#get(inputs:, archived: nil, request_options: {}) ⇒ StringIO
Retrieve a batch of blog posts by ID.
-
#initialize(client:) ⇒ Batch
constructor
private
A new instance of Batch.
-
#update(inputs:, archived: nil, request_options: {}) ⇒ StringIO
Update a batch of blog posts.
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.
116 117 118 |
# File 'lib/hubspot_sdk/resources/cms/blogs/posts/batch.rb', line 116 def initialize(client:) @client = client end |
Instance Method Details
#create(inputs:, request_options: {}) ⇒ StringIO
Create a batch of blog posts, specifying their content in the request body.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/hubspot_sdk/resources/cms/blogs/posts/batch.rb', line 20 def create(params) parsed, = HubSpotSDK::Cms::Blogs::Posts::BatchCreateParams.dump_request(params) @client.request( method: :post, path: "cms/blogs/2026-03/posts/batch/create", headers: {"content-type" => "*/*", "accept" => "*/*"}, body: parsed, model: StringIO, options: ) end |
#delete(inputs:, request_options: {}) ⇒ nil
Delete a blog post by ID. Note: This is not the same as the in-app ‘archive` function. To perform a dashboard `archive` send an normal update with the `archivedInDashboard` field set to `true`.
73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/hubspot_sdk/resources/cms/blogs/posts/batch.rb', line 73 def delete(params) parsed, = HubSpotSDK::Cms::Blogs::Posts::BatchDeleteParams.dump_request(params) @client.request( method: :post, path: "cms/blogs/2026-03/posts/batch/archive", headers: {"content-type" => "*/*"}, body: parsed, model: NilClass, options: ) end |
#get(inputs:, archived: nil, request_options: {}) ⇒ StringIO
Retrieve a batch of blog posts by ID. identified in the request body.
98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/hubspot_sdk/resources/cms/blogs/posts/batch.rb', line 98 def get(params) query_params = [:archived] parsed, = HubSpotSDK::Cms::Blogs::Posts::BatchGetParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, path: "cms/blogs/2026-03/posts/batch/read", query: query, headers: {"content-type" => "*/*", "accept" => "*/*"}, body: parsed.except(*query_params), model: StringIO, options: ) end |
#update(inputs:, archived: nil, request_options: {}) ⇒ StringIO
Update a batch of blog posts.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/hubspot_sdk/resources/cms/blogs/posts/batch.rb', line 45 def update(params) query_params = [:archived] parsed, = HubSpotSDK::Cms::Blogs::Posts::BatchUpdateParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, path: "cms/blogs/2026-03/posts/batch/update", query: query, headers: {"content-type" => "*/*", "accept" => "*/*"}, body: parsed.except(*query_params), model: StringIO, options: ) end |