Class: HubSpotSDK::Resources::Cms::URLMappings
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Cms::URLMappings
- Defined in:
- lib/hubspot_sdk/resources/cms/url_mappings.rb
Instance Method Summary collapse
-
#create(id:, cdn_purge_embargo_time:, content_group_id:, cos_object_type:, created:, created_by_id:, deleted_at:, destination:, internally_created:, is_active:, is_match_full_url:, is_match_query_string:, is_only_after_not_found:, is_pattern:, is_protocol_agnostic:, is_regex:, is_trailing_slash_optional:, label:, name:, note:, portal_id:, precedence:, redirect_style:, route_prefix:, updated:, updated_by_id:, request_options: {}) ⇒ StringIO
Some parameter documentations has been truncated, see Models::Cms::URLMappingCreateParams for more details.
-
#delete(id, request_options: {}) ⇒ nil
Delete a specific URL mapping in your HubSpot account using its unique identifier.
-
#get(id, request_options: {}) ⇒ StringIO
Retrieve a specific URL mapping by its unique identifier.
-
#initialize(client:) ⇒ URLMappings
constructor
private
A new instance of URLMappings.
-
#list(request_options: {}) ⇒ StringIO
Retrieve a list of URL mappings from the HubSpot account.
Constructor Details
#initialize(client:) ⇒ URLMappings
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 URLMappings.
154 155 156 |
# File 'lib/hubspot_sdk/resources/cms/url_mappings.rb', line 154 def initialize(client:) @client = client end |
Instance Method Details
#create(id:, cdn_purge_embargo_time:, content_group_id:, cos_object_type:, created:, created_by_id:, deleted_at:, destination:, internally_created:, is_active:, is_match_full_url:, is_match_query_string:, is_only_after_not_found:, is_pattern:, is_protocol_agnostic:, is_regex:, is_trailing_slash_optional:, label:, name:, note:, portal_id:, precedence:, redirect_style:, route_prefix:, updated:, updated_by_id:, request_options: {}) ⇒ StringIO
Some parameter documentations has been truncated, see Models::Cms::URLMappingCreateParams for more details.
Create a new URL mapping in your HubSpot account. This endpoint allows you to define URL redirections and mappings, which can be useful for managing site navigation and SEO. The request body must include all required properties of the UrlMapping schema.
74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/hubspot_sdk/resources/cms/url_mappings.rb', line 74 def create(params) parsed, = HubSpotSDK::Cms::URLMappingCreateParams.dump_request(params) @client.request( method: :post, path: "url-mappings/2026-03/url-mappings", headers: {"content-type" => "*/*", "accept" => "*/*"}, body: parsed, model: StringIO, options: ) end |
#delete(id, request_options: {}) ⇒ nil
Delete a specific URL mapping in your HubSpot account using its unique identifier. This operation will remove the URL mapping permanently, and it requires appropriate write and delete permissions.
120 121 122 123 124 125 126 127 |
# File 'lib/hubspot_sdk/resources/cms/url_mappings.rb', line 120 def delete(id, params = {}) @client.request( method: :delete, path: ["url-mappings/2026-03/url-mappings/%1$s", id], model: NilClass, options: params[:request_options] ) end |
#get(id, request_options: {}) ⇒ StringIO
Retrieve a specific URL mapping by its unique identifier. This endpoint is useful for obtaining details about a particular URL mapping configuration within your HubSpot account. It requires the ID of the URL mapping as a path parameter.
141 142 143 144 145 146 147 148 149 |
# File 'lib/hubspot_sdk/resources/cms/url_mappings.rb', line 141 def get(id, params = {}) @client.request( method: :get, path: ["url-mappings/2026-03/url-mappings/%1$s", id], headers: {"accept" => "*/*"}, model: StringIO, options: params[:request_options] ) end |
#list(request_options: {}) ⇒ StringIO
Retrieve a list of URL mappings from the HubSpot account. This endpoint provides access to URL mapping configurations, which can be used to manage and redirect URLs within the HubSpot CMS. It is useful for understanding how URLs are structured and redirected in your content management setup.
98 99 100 101 102 103 104 105 106 |
# File 'lib/hubspot_sdk/resources/cms/url_mappings.rb', line 98 def list(params = {}) @client.request( method: :get, path: "url-mappings/2026-03/url-mappings", headers: {"accept" => "*/*"}, model: StringIO, options: params[:request_options] ) end |