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

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Batch

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Batch.

Parameters:



119
120
121
# File 'lib/hubspot_sdk/resources/cms/pages/landing_pages/batch.rb', line 119

def initialize(client:)
  @client = client
end

Instance Method Details

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

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

Parameters:

Returns:

See Also:



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

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

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

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

Parameters:

Returns:

  • (nil)

See Also:



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/hubspot_sdk/resources/cms/pages/landing_pages/batch.rb', line 46

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

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

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

Parameters:

  • inputs (Array<String>)

    Body param: Strings to input.

  • archived (Boolean)

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

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

Returns:

See Also:



72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/hubspot_sdk/resources/cms/pages/landing_pages/batch.rb', line 72

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

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

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

Parameters:

  • inputs (Array<Object>)

    Body param: JSON nodes to input.

  • archived (Boolean)

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

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

Returns:

See Also:



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/hubspot_sdk/resources/cms/pages/landing_pages/batch.rb', line 100

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