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.
-
#create_url_mapping(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: {}) ⇒ StringIO
Some parameter documentations has been truncated, see Models::Cms::URLRedirectCreateURLMappingParams for more details.
-
#delete(url_redirect_id, request_options: {}) ⇒ nil
Delete one existing redirect, so it is no longer mapped.
- #delete_url_mapping(id, request_options: {}) ⇒ nil
-
#get(url_redirect_id, request_options: {}) ⇒ HubSpotSDK::Models::Cms::URLMapping
Returns the details for a single existing URL redirect by ID.
- #get_url_mapping(id, request_options: {}) ⇒ StringIO
-
#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.
- #list_url_mappings(request_options: {}) ⇒ StringIO
-
#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.
300 301 302 |
# File 'lib/hubspot_sdk/resources/cms/url_redirects.rb', line 300 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 |
#create_url_mapping(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: {}) ⇒ StringIO
Some parameter documentations has been truncated, see Models::Cms::URLRedirectCreateURLMappingParams for more details.
214 215 216 217 218 219 220 221 222 223 224 |
# File 'lib/hubspot_sdk/resources/cms/url_redirects.rb', line 214 def create_url_mapping(params) parsed, = HubSpotSDK::Cms::URLRedirectCreateURLMappingParams.dump_request(params) @client.request( method: :post, path: "cms/url-redirects/2026-03/url-mappings", headers: {"content-type" => "*/*", "accept" => "*/*"}, body: parsed, model: StringIO, 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 |
#delete_url_mapping(id, request_options: {}) ⇒ nil
234 235 236 237 238 239 240 241 |
# File 'lib/hubspot_sdk/resources/cms/url_redirects.rb', line 234 def delete_url_mapping(id, params = {}) @client.request( method: :delete, path: ["cms/url-redirects/2026-03/url-mappings/%1$s", 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.
253 254 255 256 257 258 259 260 |
# File 'lib/hubspot_sdk/resources/cms/url_redirects.rb', line 253 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 |
#get_url_mapping(id, request_options: {}) ⇒ StringIO
270 271 272 273 274 275 276 277 278 |
# File 'lib/hubspot_sdk/resources/cms/url_redirects.rb', line 270 def get_url_mapping(id, params = {}) @client.request( method: :get, path: ["cms/url-redirects/2026-03/url-mappings/%1$s", id], headers: {"accept" => "*/*"}, model: StringIO, 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 |
#list_url_mappings(request_options: {}) ⇒ StringIO
287 288 289 290 291 292 293 294 295 |
# File 'lib/hubspot_sdk/resources/cms/url_redirects.rb', line 287 def list_url_mappings(params = {}) @client.request( method: :get, path: "cms/url-redirects/2026-03/url-mappings", headers: {"accept" => "*/*"}, model: StringIO, options: params[:request_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 |