Class: Hubspot::Cms::Pages::LandingPagesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LandingPagesApi

Returns a new instance of LandingPagesApi.



21
22
23
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 21

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



19
20
21
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 19

def api_client
  @api_client
end

Instance Method Details

#archive(object_id, opts = {}) ⇒ nil

Delete a Landing Page Delete the Landing Page object identified by the id in the path.

Parameters:

  • object_id (String)

    The Landing Page id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Whether to return only results that have been archived.

Returns:

  • (nil)


30
31
32
33
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 30

def archive(object_id, opts = {})
  archive_with_http_info(object_id, opts)
  nil
end

#archive_batch(batch_input_string, opts = {}) ⇒ nil

Delete a batch of Landing Pages Delete the Landing Page objects identified 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:

  • batch_input_string (BatchInputString)

    The JSON array of Landing Page ids.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


95
96
97
98
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 95

def archive_batch(batch_input_string, opts = {})
  archive_batch_with_http_info(batch_input_string, opts)
  nil
end

#archive_batch_with_http_info(batch_input_string, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a batch of Landing Pages Delete the Landing Page objects identified in the request body. Note: This is not the same as the dashboard &#x60;archive&#x60; function. To perform a dashboard &#x60;archive&#x60; send an normal update with the &#x60;archivedInDashboard&#x60; field set to true.

Parameters:

  • batch_input_string (BatchInputString)

    The JSON array of Landing Page ids.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 105

def archive_batch_with_http_info(batch_input_string, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.archive_batch ...'
  end
  # verify the required parameter 'batch_input_string' is set
  if @api_client.config.client_side_validation && batch_input_string.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_string' when calling LandingPagesApi.archive_batch"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/batch/archive'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_string)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.archive_batch",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#archive_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#archive_folder(object_id, opts = {}) ⇒ nil

Delete a Folder Delete the Folder object identified by the id in the path.

Parameters:

  • object_id (String)

    The Folder id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Whether to return only results that have been archived.

Returns:

  • (nil)


164
165
166
167
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 164

def archive_folder(object_id, opts = {})
  archive_folder_with_http_info(object_id, opts)
  nil
end

#archive_folder_with_http_info(object_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a Folder Delete the Folder object identified by the id in the path.

Parameters:

  • object_id (String)

    The Folder id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Whether to return only results that have been archived.

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 175

def archive_folder_with_http_info(object_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.archive_folder ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling LandingPagesApi.archive_folder"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/folders/{objectId}'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.archive_folder",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#archive_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#archive_folders(batch_input_string, opts = {}) ⇒ nil

Delete a batch of Folders Delete the Folder objects identified in the request body.

Parameters:

  • batch_input_string (BatchInputString)

    The JSON array of Folder ids.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


229
230
231
232
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 229

def archive_folders(batch_input_string, opts = {})
  archive_folders_with_http_info(batch_input_string, opts)
  nil
end

#archive_folders_with_http_info(batch_input_string, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a batch of Folders Delete the Folder objects identified in the request body.

Parameters:

  • batch_input_string (BatchInputString)

    The JSON array of Folder ids.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 239

def archive_folders_with_http_info(batch_input_string, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.archive_folders ...'
  end
  # verify the required parameter 'batch_input_string' is set
  if @api_client.config.client_side_validation && batch_input_string.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_string' when calling LandingPagesApi.archive_folders"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/folders/batch/archive'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_string)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.archive_folders",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#archive_folders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#archive_with_http_info(object_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a Landing Page Delete the Landing Page object identified by the id in the path.

Parameters:

  • object_id (String)

    The Landing Page id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Whether to return only results that have been archived.

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 41

def archive_with_http_info(object_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.archive ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling LandingPagesApi.archive"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/{objectId}'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.archive",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#attach_to_lang_group(attach_to_lang_primary_request_v_next, opts = {}) ⇒ nil

Attach a landing page to a multi-language group Attach a landing page to a multi-language group.

Parameters:

  • attach_to_lang_primary_request_v_next (AttachToLangPrimaryRequestVNext)

    The JSON representation of the AttachToLangPrimaryRequest object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


297
298
299
300
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 297

def attach_to_lang_group(attach_to_lang_primary_request_v_next, opts = {})
  attach_to_lang_group_with_http_info(attach_to_lang_primary_request_v_next, opts)
  nil
end

#attach_to_lang_group_with_http_info(attach_to_lang_primary_request_v_next, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Attach a landing page to a multi-language group Attach a landing page to a multi-language group.

Parameters:

  • attach_to_lang_primary_request_v_next (AttachToLangPrimaryRequestVNext)

    The JSON representation of the AttachToLangPrimaryRequest object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 307

def attach_to_lang_group_with_http_info(attach_to_lang_primary_request_v_next, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.attach_to_lang_group ...'
  end
  # verify the required parameter 'attach_to_lang_primary_request_v_next' is set
  if @api_client.config.client_side_validation && attach_to_lang_primary_request_v_next.nil?
    fail ArgumentError, "Missing the required parameter 'attach_to_lang_primary_request_v_next' when calling LandingPagesApi.attach_to_lang_group"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(attach_to_lang_primary_request_v_next)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.attach_to_lang_group",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#attach_to_lang_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#clone(content_clone_request_v_next, opts = {}) ⇒ Page

Clone a Landing Page Clone a Landing Page

Parameters:

  • content_clone_request_v_next (ContentCloneRequestVNext)

    The JSON representation of the ContentCloneRequest object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



365
366
367
368
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 365

def clone(content_clone_request_v_next, opts = {})
  data, _status_code, _headers = clone_with_http_info(content_clone_request_v_next, opts)
  data
end

#clone_with_http_info(content_clone_request_v_next, opts = {}) ⇒ Array<(Page, Integer, Hash)>

Clone a Landing Page Clone a Landing Page

Parameters:

  • content_clone_request_v_next (ContentCloneRequestVNext)

    The JSON representation of the ContentCloneRequest object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Page, Integer, Hash)>)

    Page data, response status code and response headers



375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 375

def clone_with_http_info(content_clone_request_v_next, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.clone ...'
  end
  # verify the required parameter 'content_clone_request_v_next' is set
  if @api_client.config.client_side_validation && content_clone_request_v_next.nil?
    fail ArgumentError, "Missing the required parameter 'content_clone_request_v_next' when calling LandingPagesApi.clone"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/clone'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(content_clone_request_v_next)

  # return_type
  return_type = opts[:debug_return_type] || 'Page'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.clone",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#clone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create(page, opts = {}) ⇒ nil

Create a new Landing Page Create a new Landing Page

Parameters:

  • page (Page)

    The JSON representation of a new Landing Page.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


433
434
435
436
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 433

def create(page, opts = {})
  create_with_http_info(page, opts)
  nil
end

#create_ab_test_variation(ab_test_create_request_v_next, opts = {}) ⇒ Page

Create a new A/B test variation Create a new A/B test variation based on the information provided in the request body.

Parameters:

  • ab_test_create_request_v_next (AbTestCreateRequestVNext)

    The JSON representation of the AbTestCreateRequest object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



501
502
503
504
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 501

def create_ab_test_variation(ab_test_create_request_v_next, opts = {})
  data, _status_code, _headers = create_ab_test_variation_with_http_info(ab_test_create_request_v_next, opts)
  data
end

#create_ab_test_variation_with_http_info(ab_test_create_request_v_next, opts = {}) ⇒ Array<(Page, Integer, Hash)>

Create a new A/B test variation Create a new A/B test variation based on the information provided in the request body.

Parameters:

  • ab_test_create_request_v_next (AbTestCreateRequestVNext)

    The JSON representation of the AbTestCreateRequest object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Page, Integer, Hash)>)

    Page data, response status code and response headers



511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 511

def create_ab_test_variation_with_http_info(ab_test_create_request_v_next, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.create_ab_test_variation ...'
  end
  # verify the required parameter 'ab_test_create_request_v_next' is set
  if @api_client.config.client_side_validation && ab_test_create_request_v_next.nil?
    fail ArgumentError, "Missing the required parameter 'ab_test_create_request_v_next' when calling LandingPagesApi.create_ab_test_variation"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/ab-test/create-variation'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(ab_test_create_request_v_next)

  # return_type
  return_type = opts[:debug_return_type] || 'Page'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.create_ab_test_variation",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#create_ab_test_variation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_batch(batch_input_page, opts = {}) ⇒ BatchResponsePage

Create a batch of Landing Pages Create the Landing Page objects detailed in the request body.

Parameters:

  • batch_input_page (BatchInputPage)

    The JSON array of new Landing Pages to create.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



569
570
571
572
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 569

def create_batch(batch_input_page, opts = {})
  data, _status_code, _headers = create_batch_with_http_info(batch_input_page, opts)
  data
end

#create_batch_with_http_info(batch_input_page, opts = {}) ⇒ Array<(BatchResponsePage, Integer, Hash)>

Create a batch of Landing Pages Create the Landing Page objects detailed in the request body.

Parameters:

  • batch_input_page (BatchInputPage)

    The JSON array of new Landing Pages to create.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(BatchResponsePage, Integer, Hash)>)

    BatchResponsePage data, response status code and response headers



579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 579

def create_batch_with_http_info(batch_input_page, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.create_batch ...'
  end
  # verify the required parameter 'batch_input_page' is set
  if @api_client.config.client_side_validation && batch_input_page.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_page' when calling LandingPagesApi.create_batch"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/batch/create'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_page)

  # return_type
  return_type = opts[:debug_return_type] || 'BatchResponsePage'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.create_batch",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#create_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_folder(content_folder, opts = {}) ⇒ ContentFolder

Create a new Folder Create a new Folder

Parameters:

  • content_folder (ContentFolder)

    The JSON representation of a new Folder.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



637
638
639
640
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 637

def create_folder(content_folder, opts = {})
  data, _status_code, _headers = create_folder_with_http_info(content_folder, opts)
  data
end

#create_folder_with_http_info(content_folder, opts = {}) ⇒ Array<(ContentFolder, Integer, Hash)>

Create a new Folder Create a new Folder

Parameters:

  • content_folder (ContentFolder)

    The JSON representation of a new Folder.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ContentFolder, Integer, Hash)>)

    ContentFolder data, response status code and response headers



647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 647

def create_folder_with_http_info(content_folder, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.create_folder ...'
  end
  # verify the required parameter 'content_folder' is set
  if @api_client.config.client_side_validation && content_folder.nil?
    fail ArgumentError, "Missing the required parameter 'content_folder' when calling LandingPagesApi.create_folder"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/folders'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(content_folder)

  # return_type
  return_type = opts[:debug_return_type] || 'ContentFolder'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.create_folder",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_folders(batch_input_content_folder, opts = {}) ⇒ BatchResponseContentFolder

Create a batch of Folders Create the Folder objects detailed in the request body.

Parameters:

  • batch_input_content_folder (BatchInputContentFolder)

    The JSON array of new Folders to create.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



705
706
707
708
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 705

def create_folders(batch_input_content_folder, opts = {})
  data, _status_code, _headers = create_folders_with_http_info(batch_input_content_folder, opts)
  data
end

#create_folders_with_http_info(batch_input_content_folder, opts = {}) ⇒ Array<(BatchResponseContentFolder, Integer, Hash)>

Create a batch of Folders Create the Folder objects detailed in the request body.

Parameters:

  • batch_input_content_folder (BatchInputContentFolder)

    The JSON array of new Folders to create.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(BatchResponseContentFolder, Integer, Hash)>)

    BatchResponseContentFolder data, response status code and response headers



715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 715

def create_folders_with_http_info(batch_input_content_folder, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.create_folders ...'
  end
  # verify the required parameter 'batch_input_content_folder' is set
  if @api_client.config.client_side_validation && batch_input_content_folder.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_content_folder' when calling LandingPagesApi.create_folders"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/folders/batch/create'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_content_folder)

  # return_type
  return_type = opts[:debug_return_type] || 'BatchResponseContentFolder'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.create_folders",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#create_folders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_lang_variation(content_language_clone_request_v_next, opts = {}) ⇒ Page

Create a new language variation Create a new language variation from an existing landing page

Parameters:

  • content_language_clone_request_v_next (ContentLanguageCloneRequestVNext)

    The JSON representation of the ContentLanguageCloneRequest object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



773
774
775
776
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 773

def create_lang_variation(content_language_clone_request_v_next, opts = {})
  data, _status_code, _headers = create_lang_variation_with_http_info(content_language_clone_request_v_next, opts)
  data
end

#create_lang_variation_with_http_info(content_language_clone_request_v_next, opts = {}) ⇒ Array<(Page, Integer, Hash)>

Create a new language variation Create a new language variation from an existing landing page

Parameters:

  • content_language_clone_request_v_next (ContentLanguageCloneRequestVNext)

    The JSON representation of the ContentLanguageCloneRequest object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Page, Integer, Hash)>)

    Page data, response status code and response headers



783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 783

def create_lang_variation_with_http_info(content_language_clone_request_v_next, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.create_lang_variation ...'
  end
  # verify the required parameter 'content_language_clone_request_v_next' is set
  if @api_client.config.client_side_validation && content_language_clone_request_v_next.nil?
    fail ArgumentError, "Missing the required parameter 'content_language_clone_request_v_next' when calling LandingPagesApi.create_lang_variation"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/multi-language/create-language-variation'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(content_language_clone_request_v_next)

  # return_type
  return_type = opts[:debug_return_type] || 'Page'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.create_lang_variation",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#create_lang_variation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_with_http_info(page, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Create a new Landing Page Create a new Landing Page

Parameters:

  • page (Page)

    The JSON representation of a new Landing Page.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 443

def create_with_http_info(page, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.create ...'
  end
  # verify the required parameter 'page' is set
  if @api_client.config.client_side_validation && page.nil?
    fail ArgumentError, "Missing the required parameter 'page' when calling LandingPagesApi.create"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(page)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.create",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#detach_from_lang_group(detach_from_lang_group_request_v_next, opts = {}) ⇒ nil

Detach a landing page from a multi-language group Detach a landing page from a multi-language group.

Parameters:

  • detach_from_lang_group_request_v_next (DetachFromLangGroupRequestVNext)

    The JSON representation of the DetachFromLangGroupRequest object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


841
842
843
844
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 841

def detach_from_lang_group(detach_from_lang_group_request_v_next, opts = {})
  detach_from_lang_group_with_http_info(detach_from_lang_group_request_v_next, opts)
  nil
end

#detach_from_lang_group_with_http_info(detach_from_lang_group_request_v_next, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Detach a landing page from a multi-language group Detach a landing page from a multi-language group.

Parameters:

  • detach_from_lang_group_request_v_next (DetachFromLangGroupRequestVNext)

    The JSON representation of the DetachFromLangGroupRequest object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 851

def detach_from_lang_group_with_http_info(detach_from_lang_group_request_v_next, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.detach_from_lang_group ...'
  end
  # verify the required parameter 'detach_from_lang_group_request_v_next' is set
  if @api_client.config.client_side_validation && detach_from_lang_group_request_v_next.nil?
    fail ArgumentError, "Missing the required parameter 'detach_from_lang_group_request_v_next' when calling LandingPagesApi.detach_from_lang_group"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(detach_from_lang_group_request_v_next)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.detach_from_lang_group",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#detach_from_lang_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#end_active_ab_test(ab_test_end_request_v_next, opts = {}) ⇒ nil

End an active A/B test End an active A/B test and designate a winner.

Parameters:

  • ab_test_end_request_v_next (AbTestEndRequestVNext)

    The JSON representation of the AbTestEndRequest object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


909
910
911
912
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 909

def end_active_ab_test(ab_test_end_request_v_next, opts = {})
  end_active_ab_test_with_http_info(ab_test_end_request_v_next, opts)
  nil
end

#end_active_ab_test_with_http_info(ab_test_end_request_v_next, opts = {}) ⇒ Array<(nil, Integer, Hash)>

End an active A/B test End an active A/B test and designate a winner.

Parameters:

  • ab_test_end_request_v_next (AbTestEndRequestVNext)

    The JSON representation of the AbTestEndRequest object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 919

def end_active_ab_test_with_http_info(ab_test_end_request_v_next, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.end_active_ab_test ...'
  end
  # verify the required parameter 'ab_test_end_request_v_next' is set
  if @api_client.config.client_side_validation && ab_test_end_request_v_next.nil?
    fail ArgumentError, "Missing the required parameter 'ab_test_end_request_v_next' when calling LandingPagesApi.end_active_ab_test"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/ab-test/end'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(ab_test_end_request_v_next)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.end_active_ab_test",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#end_active_ab_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_by_id(object_id, opts = {}) ⇒ Page

Retrieve a Landing Page Retrieve the Landing Page object identified by the id in the path.

Parameters:

  • object_id (String)

    The Landing Page id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to return deleted Landing Pages. Defaults to &#x60;false&#x60;.

  • :property (String)

Returns:



979
980
981
982
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 979

def get_by_id(object_id, opts = {})
  data, _status_code, _headers = get_by_id_with_http_info(object_id, opts)
  data
end

#get_by_id_with_http_info(object_id, opts = {}) ⇒ Array<(Page, Integer, Hash)>

Retrieve a Landing Page Retrieve the Landing Page object identified by the id in the path.

Parameters:

  • object_id (String)

    The Landing Page id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to return deleted Landing Pages. Defaults to &#x60;false&#x60;.

  • :property (String)

Returns:

  • (Array<(Page, Integer, Hash)>)

    Page data, response status code and response headers



991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 991

def get_by_id_with_http_info(object_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.get_by_id ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling LandingPagesApi.get_by_id"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/{objectId}'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?
  query_params[:'property'] = opts[:'property'] if !opts[:'property'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Page'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.get_by_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#get_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_draft_by_id(object_id, opts = {}) ⇒ Page

Retrieve the full draft version of the Landing Page Retrieve the full draft version of the Landing Page.

Parameters:

  • object_id (String)

    The Landing Page id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1046
1047
1048
1049
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1046

def get_draft_by_id(object_id, opts = {})
  data, _status_code, _headers = get_draft_by_id_with_http_info(object_id, opts)
  data
end

#get_draft_by_id_with_http_info(object_id, opts = {}) ⇒ Array<(Page, Integer, Hash)>

Retrieve the full draft version of the Landing Page Retrieve the full draft version of the Landing Page.

Parameters:

  • object_id (String)

    The Landing Page id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Page, Integer, Hash)>)

    Page data, response status code and response headers



1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1056

def get_draft_by_id_with_http_info(object_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.get_draft_by_id ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling LandingPagesApi.get_draft_by_id"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/{objectId}/draft'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Page'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.get_draft_by_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#get_draft_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_folder_by_id(object_id, opts = {}) ⇒ ContentFolder

Retrieve a Folder Retrieve the Folder object identified by the id in the path.

Parameters:

  • object_id (String)

    The Folder id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to return deleted Folders. Defaults to &#x60;false&#x60;.

  • :property (String)

Returns:



1111
1112
1113
1114
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1111

def get_folder_by_id(object_id, opts = {})
  data, _status_code, _headers = get_folder_by_id_with_http_info(object_id, opts)
  data
end

#get_folder_by_id_with_http_info(object_id, opts = {}) ⇒ Array<(ContentFolder, Integer, Hash)>

Retrieve a Folder Retrieve the Folder object identified by the id in the path.

Parameters:

  • object_id (String)

    The Folder id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to return deleted Folders. Defaults to &#x60;false&#x60;.

  • :property (String)

Returns:

  • (Array<(ContentFolder, Integer, Hash)>)

    ContentFolder data, response status code and response headers



1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1123

def get_folder_by_id_with_http_info(object_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.get_folder_by_id ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling LandingPagesApi.get_folder_by_id"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/folders/{objectId}'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?
  query_params[:'property'] = opts[:'property'] if !opts[:'property'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ContentFolder'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.get_folder_by_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#get_folder_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_folder_previous_version(object_id, revision_id, opts = {}) ⇒ VersionContentFolder

Retrieves a previous version of a Folder Retrieves a previous version of a Folder

Parameters:

  • object_id (String)

    The Folder id.

  • revision_id (String)

    The Folder version id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1179
1180
1181
1182
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1179

def get_folder_previous_version(object_id, revision_id, opts = {})
  data, _status_code, _headers = get_folder_previous_version_with_http_info(object_id, revision_id, opts)
  data
end

#get_folder_previous_version_with_http_info(object_id, revision_id, opts = {}) ⇒ Array<(VersionContentFolder, Integer, Hash)>

Retrieves a previous version of a Folder Retrieves a previous version of a Folder

Parameters:

  • object_id (String)

    The Folder id.

  • revision_id (String)

    The Folder version id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(VersionContentFolder, Integer, Hash)>)

    VersionContentFolder data, response status code and response headers



1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1190

def get_folder_previous_version_with_http_info(object_id, revision_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.get_folder_previous_version ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling LandingPagesApi.get_folder_previous_version"
  end
  # verify the required parameter 'revision_id' is set
  if @api_client.config.client_side_validation && revision_id.nil?
    fail ArgumentError, "Missing the required parameter 'revision_id' when calling LandingPagesApi.get_folder_previous_version"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/folders/{objectId}/revisions/{revisionId}'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s)).sub('{' + 'revisionId' + '}', CGI.escape(revision_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'VersionContentFolder'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.get_folder_previous_version",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#get_folder_previous_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_folder_previous_versions(object_id, opts = {}) ⇒ CollectionResponseWithTotalVersionContentFolder

Retrieves all the previous versions of a Folder Retrieves all the previous versions of a Folder.

Parameters:

  • object_id (String)

    The Folder id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :after (String)

    The cursor token value to get the next set of results. You can get this from the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.

  • :before (String)
  • :limit (Integer)

    The maximum number of results to return. Default is 100.

Returns:



1250
1251
1252
1253
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1250

def get_folder_previous_versions(object_id, opts = {})
  data, _status_code, _headers = get_folder_previous_versions_with_http_info(object_id, opts)
  data
end

#get_folder_previous_versions_with_http_info(object_id, opts = {}) ⇒ Array<(CollectionResponseWithTotalVersionContentFolder, Integer, Hash)>

Retrieves all the previous versions of a Folder Retrieves all the previous versions of a Folder.

Parameters:

  • object_id (String)

    The Folder id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :after (String)

    The cursor token value to get the next set of results. You can get this from the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.

  • :before (String)
  • :limit (Integer)

    The maximum number of results to return. Default is 100.

Returns:



1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1263

def get_folder_previous_versions_with_http_info(object_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.get_folder_previous_versions ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling LandingPagesApi.get_folder_previous_versions"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/folders/{objectId}/revisions'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CollectionResponseWithTotalVersionContentFolder'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.get_folder_previous_versions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#get_folder_previous_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_folders_page(opts = {}) ⇒ CollectionResponseWithTotalContentFolderForwardPaging

Get all Landing Page Folders Get the list of Landing Page Folders. Supports paging and filtering. This method would be useful for an integration that examined these models and used an external service to suggest edits.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :created_at (Time)

    Only return Folders created at exactly the specified time.

  • :created_after (Time)

    Only return Folders created after the specified time.

  • :created_before (Time)

    Only return Folders created before the specified time.

  • :updated_at (Time)

    Only return Folders last updated at exactly the specified time.

  • :updated_after (Time)

    Only return Folders last updated after the specified time.

  • :updated_before (Time)

    Only return Folders last updated before the specified time.

  • :sort (Array<String>)

    Specifies which fields to use for sorting results. Valid fields are &#x60;name&#x60;, &#x60;createdAt&#x60;, &#x60;updatedAt&#x60;, &#x60;createdBy&#x60;, &#x60;updatedBy&#x60;. &#x60;createdAt&#x60; will be used by default.

  • :after (String)

    The cursor token value to get the next set of results. You can get this from the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.

  • :limit (Integer)

    The maximum number of results to return. Default is 100.

  • :archived (Boolean)

    Specifies whether to return deleted Folders. Defaults to &#x60;false&#x60;.

  • :property (String)

Returns:



1329
1330
1331
1332
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1329

def get_folders_page(opts = {})
  data, _status_code, _headers = get_folders_page_with_http_info(opts)
  data
end

#get_folders_page_with_http_info(opts = {}) ⇒ Array<(CollectionResponseWithTotalContentFolderForwardPaging, Integer, Hash)>

Get all Landing Page Folders Get the list of Landing Page Folders. Supports paging and filtering. This method would be useful for an integration that examined these models and used an external service to suggest edits.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :created_at (Time)

    Only return Folders created at exactly the specified time.

  • :created_after (Time)

    Only return Folders created after the specified time.

  • :created_before (Time)

    Only return Folders created before the specified time.

  • :updated_at (Time)

    Only return Folders last updated at exactly the specified time.

  • :updated_after (Time)

    Only return Folders last updated after the specified time.

  • :updated_before (Time)

    Only return Folders last updated before the specified time.

  • :sort (Array<String>)

    Specifies which fields to use for sorting results. Valid fields are &#x60;name&#x60;, &#x60;createdAt&#x60;, &#x60;updatedAt&#x60;, &#x60;createdBy&#x60;, &#x60;updatedBy&#x60;. &#x60;createdAt&#x60; will be used by default.

  • :after (String)

    The cursor token value to get the next set of results. You can get this from the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.

  • :limit (Integer)

    The maximum number of results to return. Default is 100.

  • :archived (Boolean)

    Specifies whether to return deleted Folders. Defaults to &#x60;false&#x60;.

  • :property (String)

Returns:



1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1349

def get_folders_page_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.get_folders_page ...'
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/folders'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'createdAt'] = opts[:'created_at'] if !opts[:'created_at'].nil?
  query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil?
  query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil?
  query_params[:'updatedAt'] = opts[:'updated_at'] if !opts[:'updated_at'].nil?
  query_params[:'updatedAfter'] = opts[:'updated_after'] if !opts[:'updated_after'].nil?
  query_params[:'updatedBefore'] = opts[:'updated_before'] if !opts[:'updated_before'].nil?
  query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?
  query_params[:'property'] = opts[:'property'] if !opts[:'property'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CollectionResponseWithTotalContentFolderForwardPaging'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.get_folders_page",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#get_folders_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_page(opts = {}) ⇒ CollectionResponseWithTotalPageForwardPaging

Get all Landing Pages Get the list of landing pages. Supports paging and filtering. This method would be useful for an integration that examined these models and used an external service to suggest edits.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :created_at (Time)

    Only return Landing Pages created at exactly the specified time.

  • :created_after (Time)

    Only return Landing Pages created after the specified time.

  • :created_before (Time)

    Only return Landing Pages created before the specified time.

  • :updated_at (Time)

    Only return Landing Pages last updated at exactly the specified time.

  • :updated_after (Time)

    Only return Landing Pages last updated after the specified time.

  • :updated_before (Time)

    Only return Landing Pages last updated before the specified time.

  • :sort (Array<String>)

    Specifies which fields to use for sorting results. Valid fields are &#x60;name&#x60;, &#x60;createdAt&#x60;, &#x60;updatedAt&#x60;, &#x60;createdBy&#x60;, &#x60;updatedBy&#x60;. &#x60;createdAt&#x60; will be used by default.

  • :after (String)

    The cursor token value to get the next set of results. You can get this from the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.

  • :limit (Integer)

    The maximum number of results to return. Default is 100.

  • :archived (Boolean)

    Specifies whether to return deleted Landing Pages. Defaults to &#x60;false&#x60;.

  • :property (String)

Returns:



1419
1420
1421
1422
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1419

def get_page(opts = {})
  data, _status_code, _headers = get_page_with_http_info(opts)
  data
end

#get_page_with_http_info(opts = {}) ⇒ Array<(CollectionResponseWithTotalPageForwardPaging, Integer, Hash)>

Get all Landing Pages Get the list of landing pages. Supports paging and filtering. This method would be useful for an integration that examined these models and used an external service to suggest edits.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :created_at (Time)

    Only return Landing Pages created at exactly the specified time.

  • :created_after (Time)

    Only return Landing Pages created after the specified time.

  • :created_before (Time)

    Only return Landing Pages created before the specified time.

  • :updated_at (Time)

    Only return Landing Pages last updated at exactly the specified time.

  • :updated_after (Time)

    Only return Landing Pages last updated after the specified time.

  • :updated_before (Time)

    Only return Landing Pages last updated before the specified time.

  • :sort (Array<String>)

    Specifies which fields to use for sorting results. Valid fields are &#x60;name&#x60;, &#x60;createdAt&#x60;, &#x60;updatedAt&#x60;, &#x60;createdBy&#x60;, &#x60;updatedBy&#x60;. &#x60;createdAt&#x60; will be used by default.

  • :after (String)

    The cursor token value to get the next set of results. You can get this from the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.

  • :limit (Integer)

    The maximum number of results to return. Default is 100.

  • :archived (Boolean)

    Specifies whether to return deleted Landing Pages. Defaults to &#x60;false&#x60;.

  • :property (String)

Returns:



1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1439

def get_page_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.get_page ...'
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'createdAt'] = opts[:'created_at'] if !opts[:'created_at'].nil?
  query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil?
  query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil?
  query_params[:'updatedAt'] = opts[:'updated_at'] if !opts[:'updated_at'].nil?
  query_params[:'updatedAfter'] = opts[:'updated_after'] if !opts[:'updated_after'].nil?
  query_params[:'updatedBefore'] = opts[:'updated_before'] if !opts[:'updated_before'].nil?
  query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?
  query_params[:'property'] = opts[:'property'] if !opts[:'property'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CollectionResponseWithTotalPageForwardPaging'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.get_page",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#get_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_previous_version(object_id, revision_id, opts = {}) ⇒ VersionPage

Retrieves a previous version of a Landing Page Retrieves a previous version of a Landing Page

Parameters:

  • object_id (String)

    The Landing Page id.

  • revision_id (String)

    The Landing Page version id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1500
1501
1502
1503
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1500

def get_previous_version(object_id, revision_id, opts = {})
  data, _status_code, _headers = get_previous_version_with_http_info(object_id, revision_id, opts)
  data
end

#get_previous_version_with_http_info(object_id, revision_id, opts = {}) ⇒ Array<(VersionPage, Integer, Hash)>

Retrieves a previous version of a Landing Page Retrieves a previous version of a Landing Page

Parameters:

  • object_id (String)

    The Landing Page id.

  • revision_id (String)

    The Landing Page version id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(VersionPage, Integer, Hash)>)

    VersionPage data, response status code and response headers



1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1511

def get_previous_version_with_http_info(object_id, revision_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.get_previous_version ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling LandingPagesApi.get_previous_version"
  end
  # verify the required parameter 'revision_id' is set
  if @api_client.config.client_side_validation && revision_id.nil?
    fail ArgumentError, "Missing the required parameter 'revision_id' when calling LandingPagesApi.get_previous_version"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/{objectId}/revisions/{revisionId}'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s)).sub('{' + 'revisionId' + '}', CGI.escape(revision_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'VersionPage'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.get_previous_version",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#get_previous_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_previous_versions(object_id, opts = {}) ⇒ CollectionResponseWithTotalVersionPage

Retrieves all the previous versions of a Landing Page Retrieves all the previous versions of a Landing Page.

Parameters:

  • object_id (String)

    The Landing Page id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :after (String)

    The cursor token value to get the next set of results. You can get this from the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.

  • :before (String)
  • :limit (Integer)

    The maximum number of results to return. Default is 100.

Returns:



1571
1572
1573
1574
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1571

def get_previous_versions(object_id, opts = {})
  data, _status_code, _headers = get_previous_versions_with_http_info(object_id, opts)
  data
end

#get_previous_versions_with_http_info(object_id, opts = {}) ⇒ Array<(CollectionResponseWithTotalVersionPage, Integer, Hash)>

Retrieves all the previous versions of a Landing Page Retrieves all the previous versions of a Landing Page.

Parameters:

  • object_id (String)

    The Landing Page id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :after (String)

    The cursor token value to get the next set of results. You can get this from the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.

  • :before (String)
  • :limit (Integer)

    The maximum number of results to return. Default is 100.

Returns:



1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1584

def get_previous_versions_with_http_info(object_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.get_previous_versions ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling LandingPagesApi.get_previous_versions"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/{objectId}/revisions'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CollectionResponseWithTotalVersionPage'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.get_previous_versions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#get_previous_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#push_live(object_id, opts = {}) ⇒ nil

Push Landing Page draft edits live Take any changes from the draft version of the Landing Page and apply them to the live version.

Parameters:

  • object_id (String)

    The id of the Landing Page for which it&#39;s draft will be pushed live.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


1640
1641
1642
1643
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1640

def push_live(object_id, opts = {})
  push_live_with_http_info(object_id, opts)
  nil
end

#push_live_with_http_info(object_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Push Landing Page draft edits live Take any changes from the draft version of the Landing Page and apply them to the live version.

Parameters:

  • object_id (String)

    The id of the Landing Page for which it&#39;s draft will be pushed live.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1650

def push_live_with_http_info(object_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.push_live ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling LandingPagesApi.push_live"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/{objectId}/draft/push-live'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.push_live",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#push_live\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#read_batch(batch_input_string, opts = {}) ⇒ BatchResponsePage

Retrieve a batch of Landing Pages Retrieve the Landing Page objects identified in the request body.

Parameters:

  • batch_input_string (BatchInputString)

    The JSON array of Landing Page ids.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to return deleted Landing Pages. Defaults to &#x60;false&#x60;.

Returns:



1704
1705
1706
1707
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1704

def read_batch(batch_input_string, opts = {})
  data, _status_code, _headers = read_batch_with_http_info(batch_input_string, opts)
  data
end

#read_batch_with_http_info(batch_input_string, opts = {}) ⇒ Array<(BatchResponsePage, Integer, Hash)>

Retrieve a batch of Landing Pages Retrieve the Landing Page objects identified in the request body.

Parameters:

  • batch_input_string (BatchInputString)

    The JSON array of Landing Page ids.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to return deleted Landing Pages. Defaults to &#x60;false&#x60;.

Returns:

  • (Array<(BatchResponsePage, Integer, Hash)>)

    BatchResponsePage data, response status code and response headers



1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1715

def read_batch_with_http_info(batch_input_string, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.read_batch ...'
  end
  # verify the required parameter 'batch_input_string' is set
  if @api_client.config.client_side_validation && batch_input_string.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_string' when calling LandingPagesApi.read_batch"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/batch/read'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_string)

  # return_type
  return_type = opts[:debug_return_type] || 'BatchResponsePage'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.read_batch",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#read_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#read_folders(batch_input_string, opts = {}) ⇒ BatchResponseContentFolder

Retrieve a batch of Folders Update the Folder objects identified in the request body.

Parameters:

  • batch_input_string (BatchInputString)

    The JSON array of Folder ids.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to return deleted Folders. Defaults to &#x60;false&#x60;.

Returns:



1775
1776
1777
1778
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1775

def read_folders(batch_input_string, opts = {})
  data, _status_code, _headers = read_folders_with_http_info(batch_input_string, opts)
  data
end

#read_folders_with_http_info(batch_input_string, opts = {}) ⇒ Array<(BatchResponseContentFolder, Integer, Hash)>

Retrieve a batch of Folders Update the Folder objects identified in the request body.

Parameters:

  • batch_input_string (BatchInputString)

    The JSON array of Folder ids.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to return deleted Folders. Defaults to &#x60;false&#x60;.

Returns:

  • (Array<(BatchResponseContentFolder, Integer, Hash)>)

    BatchResponseContentFolder data, response status code and response headers



1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1786

def read_folders_with_http_info(batch_input_string, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.read_folders ...'
  end
  # verify the required parameter 'batch_input_string' is set
  if @api_client.config.client_side_validation && batch_input_string.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_string' when calling LandingPagesApi.read_folders"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/folders/batch/read'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_string)

  # return_type
  return_type = opts[:debug_return_type] || 'BatchResponseContentFolder'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.read_folders",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#read_folders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#rerun_previous_ab_test(ab_test_rerun_request_v_next, opts = {}) ⇒ nil

Rerun a previous A/B test Rerun a previous A/B test.

Parameters:

  • ab_test_rerun_request_v_next (AbTestRerunRequestVNext)

    The JSON representation of the AbTestRerunRequest object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


1845
1846
1847
1848
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1845

def rerun_previous_ab_test(ab_test_rerun_request_v_next, opts = {})
  rerun_previous_ab_test_with_http_info(ab_test_rerun_request_v_next, opts)
  nil
end

#rerun_previous_ab_test_with_http_info(ab_test_rerun_request_v_next, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Rerun a previous A/B test Rerun a previous A/B test.

Parameters:

  • ab_test_rerun_request_v_next (AbTestRerunRequestVNext)

    The JSON representation of the AbTestRerunRequest object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1855

def rerun_previous_ab_test_with_http_info(ab_test_rerun_request_v_next, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.rerun_previous_ab_test ...'
  end
  # verify the required parameter 'ab_test_rerun_request_v_next' is set
  if @api_client.config.client_side_validation && ab_test_rerun_request_v_next.nil?
    fail ArgumentError, "Missing the required parameter 'ab_test_rerun_request_v_next' when calling LandingPagesApi.rerun_previous_ab_test"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/ab-test/rerun'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(ab_test_rerun_request_v_next)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.rerun_previous_ab_test",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#rerun_previous_ab_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reset_draft(object_id, opts = {}) ⇒ nil

Reset the Landing Page draft to the live version Discards any edits and resets the draft to the live version.

Parameters:

  • object_id (String)

    The id of the Landing Page for which it&#39;s draft will be reset.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


1913
1914
1915
1916
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1913

def reset_draft(object_id, opts = {})
  reset_draft_with_http_info(object_id, opts)
  nil
end

#reset_draft_with_http_info(object_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Reset the Landing Page draft to the live version Discards any edits and resets the draft to the live version.

Parameters:

  • object_id (String)

    The id of the Landing Page for which it&#39;s draft will be reset.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1923

def reset_draft_with_http_info(object_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.reset_draft ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling LandingPagesApi.reset_draft"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/{objectId}/draft/reset'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.reset_draft",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#reset_draft\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#restore_folder_previous_version(object_id, revision_id, opts = {}) ⇒ ContentFolder

Restore a previous version of a Folder Takes a specified version of a Folder and restores it.

Parameters:

  • object_id (String)

    The Folder id.

  • revision_id (String)

    The Folder version id to restore.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1977
1978
1979
1980
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1977

def restore_folder_previous_version(object_id, revision_id, opts = {})
  data, _status_code, _headers = restore_folder_previous_version_with_http_info(object_id, revision_id, opts)
  data
end

#restore_folder_previous_version_with_http_info(object_id, revision_id, opts = {}) ⇒ Array<(ContentFolder, Integer, Hash)>

Restore a previous version of a Folder Takes a specified version of a Folder and restores it.

Parameters:

  • object_id (String)

    The Folder id.

  • revision_id (String)

    The Folder version id to restore.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ContentFolder, Integer, Hash)>)

    ContentFolder data, response status code and response headers



1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 1988

def restore_folder_previous_version_with_http_info(object_id, revision_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.restore_folder_previous_version ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling LandingPagesApi.restore_folder_previous_version"
  end
  # verify the required parameter 'revision_id' is set
  if @api_client.config.client_side_validation && revision_id.nil?
    fail ArgumentError, "Missing the required parameter 'revision_id' when calling LandingPagesApi.restore_folder_previous_version"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/folders/{objectId}/revisions/{revisionId}/restore'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s)).sub('{' + 'revisionId' + '}', CGI.escape(revision_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ContentFolder'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.restore_folder_previous_version",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#restore_folder_previous_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#restore_previous_version(object_id, revision_id, opts = {}) ⇒ Page

Restore a previous version of a Landing Page Takes a specified version of a Landing Page and restores it.

Parameters:

  • object_id (String)

    The Landing Page id.

  • revision_id (String)

    The Landing Page version id to restore.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2046
2047
2048
2049
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2046

def restore_previous_version(object_id, revision_id, opts = {})
  data, _status_code, _headers = restore_previous_version_with_http_info(object_id, revision_id, opts)
  data
end

#restore_previous_version_to_draft(object_id, revision_id, opts = {}) ⇒ Page

Restore a previous version of a Landing Page, to the draft version of the Landing Page Takes a specified version of a Landing Page, sets it as the new draft version of the Landing Page.

Parameters:

  • object_id (String)

    The Landing Page id.

  • revision_id (Integer)

    The Landing Page version id to restore.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2115
2116
2117
2118
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2115

def restore_previous_version_to_draft(object_id, revision_id, opts = {})
  data, _status_code, _headers = restore_previous_version_to_draft_with_http_info(object_id, revision_id, opts)
  data
end

#restore_previous_version_to_draft_with_http_info(object_id, revision_id, opts = {}) ⇒ Array<(Page, Integer, Hash)>

Restore a previous version of a Landing Page, to the draft version of the Landing Page Takes a specified version of a Landing Page, sets it as the new draft version of the Landing Page.

Parameters:

  • object_id (String)

    The Landing Page id.

  • revision_id (Integer)

    The Landing Page version id to restore.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Page, Integer, Hash)>)

    Page data, response status code and response headers



2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2126

def restore_previous_version_to_draft_with_http_info(object_id, revision_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.restore_previous_version_to_draft ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling LandingPagesApi.restore_previous_version_to_draft"
  end
  # verify the required parameter 'revision_id' is set
  if @api_client.config.client_side_validation && revision_id.nil?
    fail ArgumentError, "Missing the required parameter 'revision_id' when calling LandingPagesApi.restore_previous_version_to_draft"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/{objectId}/revisions/{revisionId}/restore-to-draft'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s)).sub('{' + 'revisionId' + '}', CGI.escape(revision_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Page'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.restore_previous_version_to_draft",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#restore_previous_version_to_draft\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#restore_previous_version_with_http_info(object_id, revision_id, opts = {}) ⇒ Array<(Page, Integer, Hash)>

Restore a previous version of a Landing Page Takes a specified version of a Landing Page and restores it.

Parameters:

  • object_id (String)

    The Landing Page id.

  • revision_id (String)

    The Landing Page version id to restore.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Page, Integer, Hash)>)

    Page data, response status code and response headers



2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2057

def restore_previous_version_with_http_info(object_id, revision_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.restore_previous_version ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling LandingPagesApi.restore_previous_version"
  end
  # verify the required parameter 'revision_id' is set
  if @api_client.config.client_side_validation && revision_id.nil?
    fail ArgumentError, "Missing the required parameter 'revision_id' when calling LandingPagesApi.restore_previous_version"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/{objectId}/revisions/{revisionId}/restore'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s)).sub('{' + 'revisionId' + '}', CGI.escape(revision_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Page'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.restore_previous_version",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#restore_previous_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#schedule(content_schedule_request_v_next, opts = {}) ⇒ nil

Schedule a Landing Page to be Published Schedule a Landing Page to be Published

Parameters:

  • content_schedule_request_v_next (ContentScheduleRequestVNext)

    The JSON representation of the ContentScheduleRequestVNext object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


2183
2184
2185
2186
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2183

def schedule(content_schedule_request_v_next, opts = {})
  schedule_with_http_info(content_schedule_request_v_next, opts)
  nil
end

#schedule_with_http_info(content_schedule_request_v_next, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Schedule a Landing Page to be Published Schedule a Landing Page to be Published

Parameters:

  • content_schedule_request_v_next (ContentScheduleRequestVNext)

    The JSON representation of the ContentScheduleRequestVNext object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2193

def schedule_with_http_info(content_schedule_request_v_next, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.schedule ...'
  end
  # verify the required parameter 'content_schedule_request_v_next' is set
  if @api_client.config.client_side_validation && content_schedule_request_v_next.nil?
    fail ArgumentError, "Missing the required parameter 'content_schedule_request_v_next' when calling LandingPagesApi.schedule"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/schedule'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(content_schedule_request_v_next)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.schedule",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_lang_primary(set_new_language_primary_request_v_next, opts = {}) ⇒ nil

Set a new primary language Set a landing page as the primary language of a multi-language group.

Parameters:

  • set_new_language_primary_request_v_next (SetNewLanguagePrimaryRequestVNext)

    The JSON representation of the SetNewLanguagePrimaryRequest object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


2251
2252
2253
2254
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2251

def set_lang_primary(set_new_language_primary_request_v_next, opts = {})
  set_lang_primary_with_http_info(set_new_language_primary_request_v_next, opts)
  nil
end

#set_lang_primary_with_http_info(set_new_language_primary_request_v_next, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Set a new primary language Set a landing page as the primary language of a multi-language group.

Parameters:

  • set_new_language_primary_request_v_next (SetNewLanguagePrimaryRequestVNext)

    The JSON representation of the SetNewLanguagePrimaryRequest object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2261

def set_lang_primary_with_http_info(set_new_language_primary_request_v_next, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.set_lang_primary ...'
  end
  # verify the required parameter 'set_new_language_primary_request_v_next' is set
  if @api_client.config.client_side_validation && set_new_language_primary_request_v_next.nil?
    fail ArgumentError, "Missing the required parameter 'set_new_language_primary_request_v_next' when calling LandingPagesApi.set_lang_primary"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(set_new_language_primary_request_v_next)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.set_lang_primary",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#set_lang_primary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update(object_id, page, opts = {}) ⇒ Page

Update a Landing Page Sparse updates a single Landing Page object identified by the id in the path. You only need to specify the column values that you are modifying.

Parameters:

  • object_id (String)

    The Landing Page id.

  • page (Page)

    The JSON representation of the updated Landing Page.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to update deleted Landing Pages. Defaults to &#x60;false&#x60;.

Returns:



2321
2322
2323
2324
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2321

def update(object_id, page, opts = {})
  data, _status_code, _headers = update_with_http_info(object_id, page, opts)
  data
end

#update_batch(batch_input_json_node, opts = {}) ⇒ BatchResponsePage

Update a batch of Landing Pages Update the Landing Page objects identified in the request body.

Parameters:

  • batch_input_json_node (BatchInputJsonNode)

    The JSON representation of the updated Landing Pages.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to update deleted Landing Pages. Defaults to &#x60;false&#x60;.

Returns:



2397
2398
2399
2400
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2397

def update_batch(batch_input_json_node, opts = {})
  data, _status_code, _headers = update_batch_with_http_info(batch_input_json_node, opts)
  data
end

#update_batch_with_http_info(batch_input_json_node, opts = {}) ⇒ Array<(BatchResponsePage, Integer, Hash)>

Update a batch of Landing Pages Update the Landing Page objects identified in the request body.

Parameters:

  • batch_input_json_node (BatchInputJsonNode)

    The JSON representation of the updated Landing Pages.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to update deleted Landing Pages. Defaults to &#x60;false&#x60;.

Returns:

  • (Array<(BatchResponsePage, Integer, Hash)>)

    BatchResponsePage data, response status code and response headers



2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2408

def update_batch_with_http_info(batch_input_json_node, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.update_batch ...'
  end
  # verify the required parameter 'batch_input_json_node' is set
  if @api_client.config.client_side_validation && batch_input_json_node.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_json_node' when calling LandingPagesApi.update_batch"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/batch/update'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_json_node)

  # return_type
  return_type = opts[:debug_return_type] || 'BatchResponsePage'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.update_batch",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#update_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_draft(object_id, page, opts = {}) ⇒ Page

Update a Landing Page draft Sparse updates the draft version of a single Landing Page object identified by the id in the path. You only need to specify the column values that you are modifying.

Parameters:

  • object_id (String)

    The Landing Page id.

  • page (Page)

    The JSON representation of the updated Landing Page to be applied to the draft.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2468
2469
2470
2471
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2468

def update_draft(object_id, page, opts = {})
  data, _status_code, _headers = update_draft_with_http_info(object_id, page, opts)
  data
end

#update_draft_with_http_info(object_id, page, opts = {}) ⇒ Array<(Page, Integer, Hash)>

Update a Landing Page draft Sparse updates the draft version of a single Landing Page object identified by the id in the path. You only need to specify the column values that you are modifying.

Parameters:

  • object_id (String)

    The Landing Page id.

  • page (Page)

    The JSON representation of the updated Landing Page to be applied to the draft.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Page, Integer, Hash)>)

    Page data, response status code and response headers



2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2479

def update_draft_with_http_info(object_id, page, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.update_draft ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling LandingPagesApi.update_draft"
  end
  # verify the required parameter 'page' is set
  if @api_client.config.client_side_validation && page.nil?
    fail ArgumentError, "Missing the required parameter 'page' when calling LandingPagesApi.update_draft"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/{objectId}/draft'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(page)

  # return_type
  return_type = opts[:debug_return_type] || 'Page'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.update_draft",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#update_draft\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_folder(object_id, content_folder, opts = {}) ⇒ ContentFolder

Update a Folder Sparse updates a single Folder object identified by the id in the path. You only need to specify the column values that you are modifying.

Parameters:

  • object_id (String)

    The Folder id.

  • content_folder (ContentFolder)

    The JSON representation of the updated Folder.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to update deleted Folders. Defaults to &#x60;false&#x60;.

Returns:



2543
2544
2545
2546
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2543

def update_folder(object_id, content_folder, opts = {})
  data, _status_code, _headers = update_folder_with_http_info(object_id, content_folder, opts)
  data
end

#update_folder_with_http_info(object_id, content_folder, opts = {}) ⇒ Array<(ContentFolder, Integer, Hash)>

Update a Folder Sparse updates a single Folder object identified by the id in the path. You only need to specify the column values that you are modifying.

Parameters:

  • object_id (String)

    The Folder id.

  • content_folder (ContentFolder)

    The JSON representation of the updated Folder.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to update deleted Folders. Defaults to &#x60;false&#x60;.

Returns:

  • (Array<(ContentFolder, Integer, Hash)>)

    ContentFolder data, response status code and response headers



2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2555

def update_folder_with_http_info(object_id, content_folder, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.update_folder ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling LandingPagesApi.update_folder"
  end
  # verify the required parameter 'content_folder' is set
  if @api_client.config.client_side_validation && content_folder.nil?
    fail ArgumentError, "Missing the required parameter 'content_folder' when calling LandingPagesApi.update_folder"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/folders/{objectId}'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(content_folder)

  # return_type
  return_type = opts[:debug_return_type] || 'ContentFolder'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.update_folder",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#update_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_folders(batch_input_json_node, opts = {}) ⇒ BatchResponseContentFolder

Update a batch of Folders Update the Folder objects identified in the request body.

Parameters:

  • batch_input_json_node (BatchInputJsonNode)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Whether to return only results that have been archived.

Returns:



2619
2620
2621
2622
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2619

def update_folders(batch_input_json_node, opts = {})
  data, _status_code, _headers = update_folders_with_http_info(batch_input_json_node, opts)
  data
end

#update_folders_with_http_info(batch_input_json_node, opts = {}) ⇒ Array<(BatchResponseContentFolder, Integer, Hash)>

Update a batch of Folders Update the Folder objects identified in the request body.

Parameters:

  • batch_input_json_node (BatchInputJsonNode)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Whether to return only results that have been archived.

Returns:

  • (Array<(BatchResponseContentFolder, Integer, Hash)>)

    BatchResponseContentFolder data, response status code and response headers



2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2630

def update_folders_with_http_info(batch_input_json_node, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.update_folders ...'
  end
  # verify the required parameter 'batch_input_json_node' is set
  if @api_client.config.client_side_validation && batch_input_json_node.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_json_node' when calling LandingPagesApi.update_folders"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/folders/batch/update'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_json_node)

  # return_type
  return_type = opts[:debug_return_type] || 'BatchResponseContentFolder'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.update_folders",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#update_folders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_langs(update_languages_request_v_next, opts = {}) ⇒ nil

Update languages of multi-language group Explicitly set new languages for each landing page in a multi-language group.

Parameters:

  • update_languages_request_v_next (UpdateLanguagesRequestVNext)

    The JSON representation of the UpdateLanguagesRequest object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


2689
2690
2691
2692
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2689

def update_langs(update_languages_request_v_next, opts = {})
  update_langs_with_http_info(update_languages_request_v_next, opts)
  nil
end

#update_langs_with_http_info(update_languages_request_v_next, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update languages of multi-language group Explicitly set new languages for each landing page in a multi-language group.

Parameters:

  • update_languages_request_v_next (UpdateLanguagesRequestVNext)

    The JSON representation of the UpdateLanguagesRequest object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2699

def update_langs_with_http_info(update_languages_request_v_next, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.update_langs ...'
  end
  # verify the required parameter 'update_languages_request_v_next' is set
  if @api_client.config.client_side_validation && update_languages_request_v_next.nil?
    fail ArgumentError, "Missing the required parameter 'update_languages_request_v_next' when calling LandingPagesApi.update_langs"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/multi-language/update-languages'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_languages_request_v_next)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.update_langs",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#update_langs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_with_http_info(object_id, page, opts = {}) ⇒ Array<(Page, Integer, Hash)>

Update a Landing Page Sparse updates a single Landing Page object identified by the id in the path. You only need to specify the column values that you are modifying.

Parameters:

  • object_id (String)

    The Landing Page id.

  • page (Page)

    The JSON representation of the updated Landing Page.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to update deleted Landing Pages. Defaults to &#x60;false&#x60;.

Returns:

  • (Array<(Page, Integer, Hash)>)

    Page data, response status code and response headers



2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
# File 'lib/hubspot/codegen/cms/pages/api/landing_pages_api.rb', line 2333

def update_with_http_info(object_id, page, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LandingPagesApi.update ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling LandingPagesApi.update"
  end
  # verify the required parameter 'page' is set
  if @api_client.config.client_side_validation && page.nil?
    fail ArgumentError, "Missing the required parameter 'page' when calling LandingPagesApi.update"
  end
  # resource path
  local_var_path = '/cms/v3/pages/landing-pages/{objectId}'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(page)

  # return_type
  return_type = opts[:debug_return_type] || 'Page'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"LandingPagesApi.update",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LandingPagesApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end