Class: HubSpotSDK::Resources::Cms::Pages::SitePages::Draft
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Cms::Pages::SitePages::Draft
- Defined in:
- lib/hubspot_sdk/resources/cms/pages/site_pages/draft.rb
Instance Method Summary collapse
-
#get_draft(object_id_, request_options: {}) ⇒ HubSpotSDK::Models::Cms::PagesPage
Retrieve the full draft version of a website page, specified by its ID.
-
#initialize(client:) ⇒ Draft
constructor
private
A new instance of Draft.
-
#publish_draft(object_id_, request_options: {}) ⇒ nil
Take any changes from the draft version of the website page and apply them to the live version.
-
#reset_site_page_draft(object_id_, request_options: {}) ⇒ nil
Discards any edits and resets the draft to match the live version.
-
#update_draft(object_id_, id:, ab_status:, ab_test_id:, archived_at:, archived_in_dashboard:, attached_stylesheets:, author_name:, campaign:, category_id:, content_group_id:, content_type_category:, created:, created_by_id:, currently_published:, current_state:, domain:, dynamic_page_data_source_id:, dynamic_page_data_source_type:, dynamic_page_hub_db_table_id:, enable_domain_stylesheets:, enable_layout_stylesheets:, featured_image:, featured_image_alt_text:, folder_id:, footer_html:, head_html:, html_title:, include_default_custom_css:, language:, layout_sections:, link_rel_canonical_url:, mab_experiment_id:, meta_description:, name:, page_expiry_date:, page_expiry_enabled:, page_expiry_redirect_id:, page_expiry_redirect_url:, page_redirected:, password:, public_access_rules:, public_access_rules_enabled:, publish_date:, publish_immediately:, slug:, state:, subcategory:, template_path:, theme_settings_values:, translated_from_id:, translations:, updated:, updated_by_id:, url:, use_featured_image:, widget_containers:, widgets:, request_options: {}) ⇒ HubSpotSDK::Models::Cms::PagesPage
Some parameter documentations has been truncated, see Models::Cms::Pages::SitePages::DraftUpdateDraftParams for more details.
Constructor Details
#initialize(client:) ⇒ Draft
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 Draft.
212 213 214 |
# File 'lib/hubspot_sdk/resources/cms/pages/site_pages/draft.rb', line 212 def initialize(client:) @client = client end |
Instance Method Details
#get_draft(object_id_, request_options: {}) ⇒ HubSpotSDK::Models::Cms::PagesPage
Retrieve the full draft version of a website page, specified by its ID.
19 20 21 22 23 24 25 26 |
# File 'lib/hubspot_sdk/resources/cms/pages/site_pages/draft.rb', line 19 def get_draft(object_id_, params = {}) @client.request( method: :get, path: ["cms/pages/2026-03/site-pages/%1$s/draft", object_id_], model: HubSpotSDK::Cms::PagesPage, options: params[:request_options] ) end |
#publish_draft(object_id_, request_options: {}) ⇒ nil
Take any changes from the draft version of the website page and apply them to the live version.
39 40 41 42 43 44 45 46 |
# File 'lib/hubspot_sdk/resources/cms/pages/site_pages/draft.rb', line 39 def publish_draft(object_id_, params = {}) @client.request( method: :post, path: ["cms/pages/2026-03/site-pages/%1$s/draft/push-live", object_id_], model: NilClass, options: params[:request_options] ) end |
#reset_site_page_draft(object_id_, request_options: {}) ⇒ nil
Discards any edits and resets the draft to match the live version.
58 59 60 61 62 63 64 65 |
# File 'lib/hubspot_sdk/resources/cms/pages/site_pages/draft.rb', line 58 def reset_site_page_draft(object_id_, params = {}) @client.request( method: :post, path: ["cms/pages/2026-03/site-pages/%1$s/draft/reset", object_id_], model: NilClass, options: params[:request_options] ) end |
#update_draft(object_id_, id:, ab_status:, ab_test_id:, archived_at:, archived_in_dashboard:, attached_stylesheets:, author_name:, campaign:, category_id:, content_group_id:, content_type_category:, created:, created_by_id:, currently_published:, current_state:, domain:, dynamic_page_data_source_id:, dynamic_page_data_source_type:, dynamic_page_hub_db_table_id:, enable_domain_stylesheets:, enable_layout_stylesheets:, featured_image:, featured_image_alt_text:, folder_id:, footer_html:, head_html:, html_title:, include_default_custom_css:, language:, layout_sections:, link_rel_canonical_url:, mab_experiment_id:, meta_description:, name:, page_expiry_date:, page_expiry_enabled:, page_expiry_redirect_id:, page_expiry_redirect_url:, page_redirected:, password:, public_access_rules:, public_access_rules_enabled:, publish_date:, publish_immediately:, slug:, state:, subcategory:, template_path:, theme_settings_values:, translated_from_id:, translations:, updated:, updated_by_id:, url:, use_featured_image:, widget_containers:, widgets:, request_options: {}) ⇒ HubSpotSDK::Models::Cms::PagesPage
Some parameter documentations has been truncated, see Models::Cms::Pages::SitePages::DraftUpdateDraftParams for more details.
Partially update the draft version of a website page, specified by page ID. You only need to specify the values for the details that you’re modifying.
197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/hubspot_sdk/resources/cms/pages/site_pages/draft.rb', line 197 def update_draft(object_id_, params) parsed, = HubSpotSDK::Cms::Pages::SitePages::DraftUpdateDraftParams.dump_request(params) @client.request( method: :patch, path: ["cms/pages/2026-03/site-pages/%1$s/draft", object_id_], headers: {"content-type" => "*/*"}, body: parsed, model: HubSpotSDK::Cms::PagesPage, options: ) end |