Class: HubSpotSDK::Resources::Cms::URLRedirects
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Cms::URLRedirects
- Defined in:
- lib/hubspot_sdk/resources/cms/url_redirects.rb
Instance Method Summary collapse
-
#create(destination:, redirect_style:, route_prefix:, is_match_full_url: nil, is_match_query_string: nil, is_only_after_not_found: nil, is_pattern: nil, is_protocol_agnostic: nil, is_trailing_slash_optional: nil, precedence: nil, request_options: {}) ⇒ HubSpotSDK::Models::Cms::URLMapping
Some parameter documentations has been truncated, see Models::Cms::URLRedirectCreateParams for more details.
-
#delete(url_redirect_id, request_options: {}) ⇒ nil
Delete one existing redirect, so it is no longer mapped.
-
#get(url_redirect_id, request_options: {}) ⇒ HubSpotSDK::Models::Cms::URLMapping
Returns the details for a single existing URL redirect by ID.
-
#initialize(client:) ⇒ URLRedirects
constructor
private
A new instance of URLRedirects.
-
#list(after: nil, archived: nil, created_after: nil, created_at: nil, created_before: nil, limit: nil, sort: nil, updated_after: nil, updated_at: nil, updated_before: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Cms::URLMapping>
Some parameter documentations has been truncated, see Models::Cms::URLRedirectListParams for more details.
-
#update(url_redirect_id, id:, created:, destination:, is_match_full_url:, is_match_query_string:, is_only_after_not_found:, is_pattern:, is_protocol_agnostic:, is_trailing_slash_optional:, precedence:, redirect_style:, route_prefix:, updated:, request_options: {}) ⇒ HubSpotSDK::Models::Cms::URLMapping
Some parameter documentations has been truncated, see Models::Cms::URLRedirectUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ URLRedirects
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 URLRedirects.
200 201 202 |
# File 'lib/hubspot_sdk/resources/cms/url_redirects.rb', line 200 def initialize(client:) @client = client end |
Instance Method Details
#create(destination:, redirect_style:, route_prefix:, is_match_full_url: nil, is_match_query_string: nil, is_only_after_not_found: nil, is_pattern: nil, is_protocol_agnostic: nil, is_trailing_slash_optional: nil, precedence: nil, request_options: {}) ⇒ HubSpotSDK::Models::Cms::URLMapping
Some parameter documentations has been truncated, see Models::Cms::URLRedirectCreateParams for more details.
Create a new URL redirect in your HubSpot account. This endpoint allows you to define a new URL mapping that redirects traffic from a specified route to a destination URL. This is useful for managing URL changes, handling outdated links, or creating short links.
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/hubspot_sdk/resources/cms/url_redirects.rb', line 42 def create(params) parsed, = HubSpotSDK::Cms::URLRedirectCreateParams.dump_request(params) @client.request( method: :post, path: "cms/url-redirects/2026-03", body: parsed, model: HubSpotSDK::Cms::URLMapping, options: ) end |
#delete(url_redirect_id, request_options: {}) ⇒ nil
Delete one existing redirect, so it is no longer mapped.
169 170 171 172 173 174 175 176 |
# File 'lib/hubspot_sdk/resources/cms/url_redirects.rb', line 169 def delete(url_redirect_id, params = {}) @client.request( method: :delete, path: ["cms/url-redirects/2026-03/%1$s", url_redirect_id], model: NilClass, options: params[:request_options] ) end |
#get(url_redirect_id, request_options: {}) ⇒ HubSpotSDK::Models::Cms::URLMapping
Returns the details for a single existing URL redirect by ID.
188 189 190 191 192 193 194 195 |
# File 'lib/hubspot_sdk/resources/cms/url_redirects.rb', line 188 def get(url_redirect_id, params = {}) @client.request( method: :get, path: ["cms/url-redirects/2026-03/%1$s", url_redirect_id], model: HubSpotSDK::Cms::URLMapping, options: params[:request_options] ) end |
#list(after: nil, archived: nil, created_after: nil, created_at: nil, created_before: nil, limit: nil, sort: nil, updated_after: nil, updated_at: nil, updated_before: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Cms::URLMapping>
Some parameter documentations has been truncated, see Models::Cms::URLRedirectListParams for more details.
Retrieve a list of URL redirects configured in your HubSpot account. This endpoint allows you to filter redirects based on their creation or update timestamps, and sort the results. It supports pagination and can include archived redirects if specified.
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/hubspot_sdk/resources/cms/url_redirects.rb', line 139 def list(params = {}) parsed, = HubSpotSDK::Cms::URLRedirectListParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "cms/url-redirects/2026-03", query: query.transform_keys( created_after: "createdAfter", created_at: "createdAt", created_before: "createdBefore", updated_after: "updatedAfter", updated_at: "updatedAt", updated_before: "updatedBefore" ), page: HubSpotSDK::Internal::Page, model: HubSpotSDK::Cms::URLMapping, options: ) end |
#update(url_redirect_id, id:, created:, destination:, is_match_full_url:, is_match_query_string:, is_only_after_not_found:, is_pattern:, is_protocol_agnostic:, is_trailing_slash_optional:, precedence:, redirect_style:, route_prefix:, updated:, request_options: {}) ⇒ HubSpotSDK::Models::Cms::URLMapping
Some parameter documentations has been truncated, see Models::Cms::URLRedirectUpdateParams for more details.
Updates the settings for an existing URL redirect.
93 94 95 96 97 98 99 100 101 102 |
# File 'lib/hubspot_sdk/resources/cms/url_redirects.rb', line 93 def update(url_redirect_id, params) parsed, = HubSpotSDK::Cms::URLRedirectUpdateParams.dump_request(params) @client.request( method: :patch, path: ["cms/url-redirects/2026-03/%1$s", url_redirect_id], body: parsed, model: HubSpotSDK::Cms::URLMapping, options: ) end |