Class: HubSpotSDK::Resources::Cms::Pages::Batch

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot_sdk/resources/cms/pages/batch.rb

Instance Method Summary collapse

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.

Parameters:



294
295
296
# File 'lib/hubspot_sdk/resources/cms/pages/batch.rb', line 294

def initialize(client:)
  @client = client
end

Instance Method Details

#create_folders(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Cms::BatchResponseContentFolder

Create a batch of folders as detailed in the request body.

Parameters:

Returns:

See Also:



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/hubspot_sdk/resources/cms/pages/batch.rb', line 19

def create_folders(params)
  parsed, options = HubSpotSDK::Cms::Pages::BatchCreateFoldersParams.dump_request(params)
  @client.request(
    method: :post,
    path: "cms/pages/2026-03/landing-pages/folders/batch/create",
    headers: {"content-type" => "*/*"},
    body: parsed,
    model: HubSpotSDK::Cms::BatchResponseContentFolder,
    options: options
  )
end

#create_landing_pages(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Cms::BatchResponsePage

Create a batch of landing pages as detailed in the request body.

Parameters:

Returns:

See Also:



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/hubspot_sdk/resources/cms/pages/batch.rb', line 42

def create_landing_pages(params)
  parsed, options = HubSpotSDK::Cms::Pages::BatchCreateLandingPagesParams.dump_request(params)
  @client.request(
    method: :post,
    path: "cms/pages/2026-03/landing-pages/batch/create",
    headers: {"content-type" => "*/*"},
    body: parsed,
    model: HubSpotSDK::Cms::BatchResponsePage,
    options: options
  )
end

#create_site_pages(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Cms::BatchResponsePage

Create a batch of website pages as specified in the request body.

Parameters:

Returns:

See Also:



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/hubspot_sdk/resources/cms/pages/batch.rb', line 65

def create_site_pages(params)
  parsed, options = HubSpotSDK::Cms::Pages::BatchCreateSitePagesParams.dump_request(params)
  @client.request(
    method: :post,
    path: "cms/pages/2026-03/site-pages/batch/create",
    headers: {"content-type" => "*/*"},
    body: parsed,
    model: HubSpotSDK::Cms::BatchResponsePage,
    options: options
  )
end

#delete_folders(inputs:, request_options: {}) ⇒ nil

Delete a batch of folders as specified in the request body.

Parameters:

Returns:

  • (nil)

See Also:



88
89
90
91
92
93
94
95
96
97
98
# File 'lib/hubspot_sdk/resources/cms/pages/batch.rb', line 88

def delete_folders(params)
  parsed, options = HubSpotSDK::Cms::Pages::BatchDeleteFoldersParams.dump_request(params)
  @client.request(
    method: :post,
    path: "cms/pages/2026-03/landing-pages/folders/batch/archive",
    headers: {"content-type" => "*/*"},
    body: parsed,
    model: NilClass,
    options: options
  )
end

#delete_landing_pages(inputs:, request_options: {}) ⇒ nil

Delete landing pages specified by ID in the request body. Note: this is not the same as the dashboard ‘archive` function. To perform a dashboard `archive` send an normal update with the `archivedInDashboard` field set to `true`.

Parameters:

Returns:

  • (nil)

See Also:



113
114
115
116
117
118
119
120
121
122
123
# File 'lib/hubspot_sdk/resources/cms/pages/batch.rb', line 113

def delete_landing_pages(params)
  parsed, options = HubSpotSDK::Cms::Pages::BatchDeleteLandingPagesParams.dump_request(params)
  @client.request(
    method: :post,
    path: "cms/pages/2026-03/landing-pages/batch/archive",
    headers: {"content-type" => "*/*"},
    body: parsed,
    model: NilClass,
    options: options
  )
end

#delete_site_pages(inputs:, request_options: {}) ⇒ nil

Delete a batch of website pages as specified in the request body. Note: this is not the same as the dashboard ‘archive` function. To perform a dashboard `archive` send an normal update with the `archivedInDashboard` field set to `true`.

Parameters:

Returns:

  • (nil)

See Also:



139
140
141
142
143
144
145
146
147
148
149
# File 'lib/hubspot_sdk/resources/cms/pages/batch.rb', line 139

def delete_site_pages(params)
  parsed, options = HubSpotSDK::Cms::Pages::BatchDeleteSitePagesParams.dump_request(params)
  @client.request(
    method: :post,
    path: "cms/pages/2026-03/site-pages/batch/archive",
    headers: {"content-type" => "*/*"},
    body: parsed,
    model: NilClass,
    options: options
  )
end

#get_landing_pages(inputs:, archived: nil, request_options: {}) ⇒ HubSpotSDK::Models::Cms::BatchResponsePage

Retrieve a batch of landing pages as specified in the request body.

Parameters:

  • inputs (Array<String>)

    Body param: Strings to input.

  • archived (Boolean)

    Query param: Whether to return only results that have been archived.

  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/hubspot_sdk/resources/cms/pages/batch.rb', line 164

def get_landing_pages(params)
  query_params = [:archived]
  parsed, options = HubSpotSDK::Cms::Pages::BatchGetLandingPagesParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params))
  @client.request(
    method: :post,
    path: "cms/pages/2026-03/landing-pages/batch/read",
    query: query,
    headers: {"content-type" => "*/*"},
    body: parsed.except(*query_params),
    model: HubSpotSDK::Cms::BatchResponsePage,
    options: options
  )
end

#get_site_pages(inputs:, archived: nil, request_options: {}) ⇒ HubSpotSDK::Models::Cms::BatchResponsePage

Retrieve a batch of website pages as specified in the request body.

Parameters:

  • inputs (Array<String>)

    Body param: Strings to input.

  • archived (Boolean)

    Query param: Whether to return only results that have been archived.

  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/hubspot_sdk/resources/cms/pages/batch.rb', line 192

def get_site_pages(params)
  query_params = [:archived]
  parsed, options = HubSpotSDK::Cms::Pages::BatchGetSitePagesParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params))
  @client.request(
    method: :post,
    path: "cms/pages/2026-03/site-pages/batch/read",
    query: query,
    headers: {"content-type" => "*/*"},
    body: parsed.except(*query_params),
    model: HubSpotSDK::Cms::BatchResponsePage,
    options: options
  )
end

#update_folders(inputs:, archived: nil, request_options: {}) ⇒ HubSpotSDK::Models::Cms::BatchResponseContentFolder

Update a batch of landing page folders as specified in the request body.

Parameters:

  • inputs (Array<Object>)

    Body param: JSON nodes to input.

  • archived (Boolean)

    Query param: Whether to return only results that have been archived.

  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



220
221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/hubspot_sdk/resources/cms/pages/batch.rb', line 220

def update_folders(params)
  query_params = [:archived]
  parsed, options = HubSpotSDK::Cms::Pages::BatchUpdateFoldersParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params))
  @client.request(
    method: :post,
    path: "cms/pages/2026-03/landing-pages/folders/batch/update",
    query: query,
    headers: {"content-type" => "*/*"},
    body: parsed.except(*query_params),
    model: HubSpotSDK::Cms::BatchResponseContentFolder,
    options: options
  )
end

#update_landing_pages(inputs:, archived: nil, request_options: {}) ⇒ HubSpotSDK::Models::Cms::BatchResponsePage

Update a batch of landing pages as specified in the request body.

Parameters:

  • inputs (Array<Object>)

    Body param: JSON nodes to input.

  • archived (Boolean)

    Query param: Whether to return only results that have been archived.

  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



248
249
250
251
252
253
254
255
256
257
258
259
260
261
# File 'lib/hubspot_sdk/resources/cms/pages/batch.rb', line 248

def update_landing_pages(params)
  query_params = [:archived]
  parsed, options = HubSpotSDK::Cms::Pages::BatchUpdateLandingPagesParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params))
  @client.request(
    method: :post,
    path: "cms/pages/2026-03/landing-pages/batch/update",
    query: query,
    headers: {"content-type" => "*/*"},
    body: parsed.except(*query_params),
    model: HubSpotSDK::Cms::BatchResponsePage,
    options: options
  )
end

#update_site_pages(inputs:, archived: nil, request_options: {}) ⇒ HubSpotSDK::Models::Cms::BatchResponsePage

Update a batch of website pages as specified in the request body.

Parameters:

  • inputs (Array<Object>)

    Body param: JSON nodes to input.

  • archived (Boolean)

    Query param: Whether to return only results that have been archived.

  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/hubspot_sdk/resources/cms/pages/batch.rb', line 276

def update_site_pages(params)
  query_params = [:archived]
  parsed, options = HubSpotSDK::Cms::Pages::BatchUpdateSitePagesParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params))
  @client.request(
    method: :post,
    path: "cms/pages/2026-03/site-pages/batch/update",
    query: query,
    headers: {"content-type" => "*/*"},
    body: parsed.except(*query_params),
    model: HubSpotSDK::Cms::BatchResponsePage,
    options: options
  )
end