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

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot_sdk/resources/cms/pages/site_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:



117
118
119
# File 'lib/hubspot_sdk/resources/cms/pages/site_pages/batch.rb', line 117

def initialize(client:)
  @client = client
end

Instance Method Details

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

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

Parameters:

Returns:

See Also:



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

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

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

Delete a batch of website pages as specified in the request body. Note that 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
# File 'lib/hubspot_sdk/resources/cms/pages/site_pages/batch.rb', line 46

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

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

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

Parameters:

  • inputs (Array<String>)

    Body param: Strings to input.

  • archived (Boolean)

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

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

Returns:

See Also:



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

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

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

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

Parameters:

  • inputs (Array<Object>)

    Body param: JSON nodes to input.

  • archived (Boolean)

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

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

Returns:

See Also:



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

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