Class: Hubspot::Cms::UrlRedirects::UrlMapping
- Inherits:
-
Object
- Object
- Hubspot::Cms::UrlRedirects::UrlMapping
- Defined in:
- lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#cdn_purge_embargo_time ⇒ Object
Returns the value of attribute cdn_purge_embargo_time.
-
#content_group_id ⇒ Object
Returns the value of attribute content_group_id.
-
#cos_object_type ⇒ Object
Returns the value of attribute cos_object_type.
-
#created ⇒ Object
Returns the value of attribute created.
-
#created_by_id ⇒ Object
Returns the value of attribute created_by_id.
-
#deleted_at ⇒ Object
Returns the value of attribute deleted_at.
-
#destination ⇒ Object
The destination URL, where the target URL should be redirected if it matches the ‘routePrefix`.
-
#id ⇒ Object
The unique ID of this URL redirect.
-
#internally_created ⇒ Object
Returns the value of attribute internally_created.
-
#is_match_full_url ⇒ Object
Whether the ‘routePrefix` should match on the entire URL, including the domain.
-
#is_match_query_string ⇒ Object
Whether the ‘routePrefix` should match on the entire URL path, including the query string.
-
#is_only_after_not_found ⇒ Object
Whether the URL redirect mapping should apply only if a live page on the URL isn’t found.
-
#is_pattern ⇒ Object
Whether the ‘routePrefix` should match based on pattern.
-
#is_protocol_agnostic ⇒ Object
Whether the ‘routePrefix` should match both HTTP and HTTPS protocols.
-
#is_regex ⇒ Object
Returns the value of attribute is_regex.
-
#is_trailing_slash_optional ⇒ Object
Whether a trailing slash will be ignored.
-
#label ⇒ Object
Returns the value of attribute label.
-
#name ⇒ Object
Returns the value of attribute name.
-
#note ⇒ Object
Returns the value of attribute note.
-
#portal_id ⇒ Object
Returns the value of attribute portal_id.
-
#precedence ⇒ Object
Used to prioritize URL redirection.
-
#redirect_style ⇒ Object
The type of redirect to create.
-
#route_prefix ⇒ Object
The target incoming URL, path, or pattern to match for redirection.
-
#updated ⇒ Object
Returns the value of attribute updated.
-
#updated_by_id ⇒ Object
Returns the value of attribute updated_by_id.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ UrlMapping
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ UrlMapping
Initializes the object
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 172 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Cms::UrlRedirects::UrlMapping` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Cms::UrlRedirects::UrlMapping`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'portal_id') self.portal_id = attributes[:'portal_id'] end if attributes.key?(:'created') self.created = attributes[:'created'] end if attributes.key?(:'updated') self.updated = attributes[:'updated'] end if attributes.key?(:'created_by_id') self.created_by_id = attributes[:'created_by_id'] end if attributes.key?(:'updated_by_id') self.updated_by_id = attributes[:'updated_by_id'] end if attributes.key?(:'route_prefix') self.route_prefix = attributes[:'route_prefix'] end if attributes.key?(:'destination') self.destination = attributes[:'destination'] end if attributes.key?(:'redirect_style') self.redirect_style = attributes[:'redirect_style'] end if attributes.key?(:'content_group_id') self.content_group_id = attributes[:'content_group_id'] end if attributes.key?(:'is_only_after_not_found') self.is_only_after_not_found = attributes[:'is_only_after_not_found'] end if attributes.key?(:'is_regex') self.is_regex = attributes[:'is_regex'] end if attributes.key?(:'is_match_full_url') self.is_match_full_url = attributes[:'is_match_full_url'] end if attributes.key?(:'is_match_query_string') self.is_match_query_string = attributes[:'is_match_query_string'] end if attributes.key?(:'is_pattern') self.is_pattern = attributes[:'is_pattern'] end if attributes.key?(:'is_trailing_slash_optional') self.is_trailing_slash_optional = attributes[:'is_trailing_slash_optional'] end if attributes.key?(:'is_protocol_agnostic') self.is_protocol_agnostic = attributes[:'is_protocol_agnostic'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'precedence') self.precedence = attributes[:'precedence'] end if attributes.key?(:'deleted_at') self.deleted_at = attributes[:'deleted_at'] end if attributes.key?(:'note') self.note = attributes[:'note'] end if attributes.key?(:'label') self.label = attributes[:'label'] end if attributes.key?(:'internally_created') self.internally_created = attributes[:'internally_created'] end if attributes.key?(:'cos_object_type') self.cos_object_type = attributes[:'cos_object_type'] end if attributes.key?(:'cdn_purge_embargo_time') self. = attributes[:'cdn_purge_embargo_time'] end end |
Instance Attribute Details
#cdn_purge_embargo_time ⇒ Object
Returns the value of attribute cdn_purge_embargo_time.
78 79 80 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 78 def @cdn_purge_embargo_time end |
#content_group_id ⇒ Object
Returns the value of attribute content_group_id.
41 42 43 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 41 def content_group_id @content_group_id end |
#cos_object_type ⇒ Object
Returns the value of attribute cos_object_type.
76 77 78 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 76 def cos_object_type @cos_object_type end |
#created ⇒ Object
Returns the value of attribute created.
24 25 26 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 24 def created @created end |
#created_by_id ⇒ Object
Returns the value of attribute created_by_id.
28 29 30 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 28 def created_by_id @created_by_id end |
#deleted_at ⇒ Object
Returns the value of attribute deleted_at.
68 69 70 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 68 def deleted_at @deleted_at end |
#destination ⇒ Object
The destination URL, where the target URL should be redirected if it matches the ‘routePrefix`.
36 37 38 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 36 def destination @destination end |
#id ⇒ Object
The unique ID of this URL redirect.
20 21 22 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 20 def id @id end |
#internally_created ⇒ Object
Returns the value of attribute internally_created.
74 75 76 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 74 def internally_created @internally_created end |
#is_match_full_url ⇒ Object
Whether the ‘routePrefix` should match on the entire URL, including the domain.
49 50 51 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 49 def is_match_full_url @is_match_full_url end |
#is_match_query_string ⇒ Object
Whether the ‘routePrefix` should match on the entire URL path, including the query string.
52 53 54 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 52 def is_match_query_string @is_match_query_string end |
#is_only_after_not_found ⇒ Object
Whether the URL redirect mapping should apply only if a live page on the URL isn’t found. If False, the URL redirect mapping will take precedence over any existing page.
44 45 46 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 44 def is_only_after_not_found @is_only_after_not_found end |
#is_pattern ⇒ Object
Whether the ‘routePrefix` should match based on pattern.
55 56 57 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 55 def is_pattern @is_pattern end |
#is_protocol_agnostic ⇒ Object
Whether the ‘routePrefix` should match both HTTP and HTTPS protocols.
61 62 63 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 61 def is_protocol_agnostic @is_protocol_agnostic end |
#is_regex ⇒ Object
Returns the value of attribute is_regex.
46 47 48 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 46 def is_regex @is_regex end |
#is_trailing_slash_optional ⇒ Object
Whether a trailing slash will be ignored.
58 59 60 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 58 def is_trailing_slash_optional @is_trailing_slash_optional end |
#label ⇒ Object
Returns the value of attribute label.
72 73 74 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 72 def label @label end |
#name ⇒ Object
Returns the value of attribute name.
63 64 65 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 63 def name @name end |
#note ⇒ Object
Returns the value of attribute note.
70 71 72 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 70 def note @note end |
#portal_id ⇒ Object
Returns the value of attribute portal_id.
22 23 24 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 22 def portal_id @portal_id end |
#precedence ⇒ Object
Used to prioritize URL redirection. If a given URL matches more than one redirect, the one with the lower precedence will be used.
66 67 68 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 66 def precedence @precedence end |
#redirect_style ⇒ Object
The type of redirect to create. Options include: 301 (permanent), 302 (temporary), or 305 (proxy). Find more details [here](knowledge.hubspot.com/cos-general/how-to-redirect-a-hubspot-page).
39 40 41 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 39 def redirect_style @redirect_style end |
#route_prefix ⇒ Object
The target incoming URL, path, or pattern to match for redirection.
33 34 35 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 33 def route_prefix @route_prefix end |
#updated ⇒ Object
Returns the value of attribute updated.
26 27 28 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 26 def updated @updated end |
#updated_by_id ⇒ Object
Returns the value of attribute updated_by_id.
30 31 32 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 30 def updated_by_id @updated_by_id end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 103 def self.attribute_map { :'id' => :'id', :'portal_id' => :'portalId', :'created' => :'created', :'updated' => :'updated', :'created_by_id' => :'createdById', :'updated_by_id' => :'updatedById', :'route_prefix' => :'routePrefix', :'destination' => :'destination', :'redirect_style' => :'redirectStyle', :'content_group_id' => :'contentGroupId', :'is_only_after_not_found' => :'isOnlyAfterNotFound', :'is_regex' => :'isRegex', :'is_match_full_url' => :'isMatchFullUrl', :'is_match_query_string' => :'isMatchQueryString', :'is_pattern' => :'isPattern', :'is_trailing_slash_optional' => :'isTrailingSlashOptional', :'is_protocol_agnostic' => :'isProtocolAgnostic', :'name' => :'name', :'precedence' => :'precedence', :'deleted_at' => :'deletedAt', :'note' => :'note', :'label' => :'label', :'internally_created' => :'internallyCreated', :'cos_object_type' => :'cosObjectType', :'cdn_purge_embargo_time' => :'cdnPurgeEmbargoTime' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
483 484 485 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 483 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
165 166 167 168 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 165 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 134 def self.openapi_types { :'id' => :'Integer', :'portal_id' => :'Integer', :'created' => :'Integer', :'updated' => :'Integer', :'created_by_id' => :'Integer', :'updated_by_id' => :'Integer', :'route_prefix' => :'String', :'destination' => :'String', :'redirect_style' => :'Integer', :'content_group_id' => :'Integer', :'is_only_after_not_found' => :'Boolean', :'is_regex' => :'Boolean', :'is_match_full_url' => :'Boolean', :'is_match_query_string' => :'Boolean', :'is_pattern' => :'Boolean', :'is_trailing_slash_optional' => :'Boolean', :'is_protocol_agnostic' => :'Boolean', :'name' => :'String', :'precedence' => :'Integer', :'deleted_at' => :'Integer', :'note' => :'String', :'label' => :'String', :'internally_created' => :'Boolean', :'cos_object_type' => :'String', :'cdn_purge_embargo_time' => :'Integer' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 438 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && portal_id == o.portal_id && created == o.created && updated == o.updated && created_by_id == o.created_by_id && updated_by_id == o.updated_by_id && route_prefix == o.route_prefix && destination == o.destination && redirect_style == o.redirect_style && content_group_id == o.content_group_id && is_only_after_not_found == o.is_only_after_not_found && is_regex == o.is_regex && is_match_full_url == o.is_match_full_url && is_match_query_string == o.is_match_query_string && is_pattern == o.is_pattern && is_trailing_slash_optional == o.is_trailing_slash_optional && is_protocol_agnostic == o.is_protocol_agnostic && name == o.name && precedence == o.precedence && deleted_at == o.deleted_at && note == o.note && label == o.label && internally_created == o.internally_created && cos_object_type == o.cos_object_type && == o. end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 511 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model Hubspot::Cms::UrlRedirects.const_get(type).build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
580 581 582 583 584 585 586 587 588 589 590 591 592 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 580 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 490 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
470 471 472 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 470 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
476 477 478 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 476 def hash [id, portal_id, created, updated, created_by_id, updated_by_id, route_prefix, destination, redirect_style, content_group_id, is_only_after_not_found, is_regex, is_match_full_url, is_match_query_string, is_pattern, is_trailing_slash_optional, is_protocol_agnostic, name, precedence, deleted_at, note, label, internally_created, cos_object_type, ].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 288 def list_invalid_properties invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @portal_id.nil? invalid_properties.push('invalid value for "portal_id", portal_id cannot be nil.') end if @created.nil? invalid_properties.push('invalid value for "created", created cannot be nil.') end if @updated.nil? invalid_properties.push('invalid value for "updated", updated cannot be nil.') end if @created_by_id.nil? invalid_properties.push('invalid value for "created_by_id", created_by_id cannot be nil.') end if @updated_by_id.nil? invalid_properties.push('invalid value for "updated_by_id", updated_by_id cannot be nil.') end if @route_prefix.nil? invalid_properties.push('invalid value for "route_prefix", route_prefix cannot be nil.') end if @destination.nil? invalid_properties.push('invalid value for "destination", destination cannot be nil.') end if @redirect_style.nil? invalid_properties.push('invalid value for "redirect_style", redirect_style cannot be nil.') end if @content_group_id.nil? invalid_properties.push('invalid value for "content_group_id", content_group_id cannot be nil.') end if @is_only_after_not_found.nil? invalid_properties.push('invalid value for "is_only_after_not_found", is_only_after_not_found cannot be nil.') end if @is_regex.nil? invalid_properties.push('invalid value for "is_regex", is_regex cannot be nil.') end if @is_match_full_url.nil? invalid_properties.push('invalid value for "is_match_full_url", is_match_full_url cannot be nil.') end if @is_match_query_string.nil? invalid_properties.push('invalid value for "is_match_query_string", is_match_query_string cannot be nil.') end if @is_pattern.nil? invalid_properties.push('invalid value for "is_pattern", is_pattern cannot be nil.') end if @is_trailing_slash_optional.nil? invalid_properties.push('invalid value for "is_trailing_slash_optional", is_trailing_slash_optional cannot be nil.') end if @is_protocol_agnostic.nil? invalid_properties.push('invalid value for "is_protocol_agnostic", is_protocol_agnostic cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @precedence.nil? invalid_properties.push('invalid value for "precedence", precedence cannot be nil.') end if @deleted_at.nil? invalid_properties.push('invalid value for "deleted_at", deleted_at cannot be nil.') end if @note.nil? invalid_properties.push('invalid value for "note", note cannot be nil.') end if @label.nil? invalid_properties.push('invalid value for "label", label cannot be nil.') end if @internally_created.nil? invalid_properties.push('invalid value for "internally_created", internally_created cannot be nil.') end if @cos_object_type.nil? invalid_properties.push('invalid value for "cos_object_type", cos_object_type cannot be nil.') end if @cdn_purge_embargo_time.nil? invalid_properties.push('invalid value for "cdn_purge_embargo_time", cdn_purge_embargo_time cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
556 557 558 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 556 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
562 563 564 565 566 567 568 569 570 571 572 573 574 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 562 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
550 551 552 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 550 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 |
# File 'lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb', line 395 def valid? return false if @id.nil? return false if @portal_id.nil? return false if @created.nil? return false if @updated.nil? return false if @created_by_id.nil? return false if @updated_by_id.nil? return false if @route_prefix.nil? return false if @destination.nil? return false if @redirect_style.nil? return false if @content_group_id.nil? return false if @is_only_after_not_found.nil? return false if @is_regex.nil? return false if @is_match_full_url.nil? return false if @is_match_query_string.nil? return false if @is_pattern.nil? return false if @is_trailing_slash_optional.nil? return false if @is_protocol_agnostic.nil? return false if @name.nil? return false if @precedence.nil? return false if @deleted_at.nil? return false if @note.nil? return false if @label.nil? return false if @internally_created.nil? return false if @cos_object_type.nil? cos_object_type_validator = EnumAttributeValidator.new('String', ["CONTENT", "EXTENSION_RESOURCE", "LAYOUT", "CUSTOM_WIDGET", "WIDGET", "FORM", "PLACEMENT", "IMAGE", "DOMAIN_SETTINGS", "SITE_SETTINGS", "EMAIL_ADDRESS", "WORKFLOW", "HUBDB_TABLE", "REDIRECT_URL", "DESIGN_FOLDER", "SITE_MAP", "DOMAIN", "BLOG", "FILE", "FOLDER", "SITE_MENU", "THEME", "CONTENT_GROUP", "FOLLOW_ME", "KNOWLEDGE_BASE", "LIST_MEMBERSHIP", "CONTACT_MEMBERSHIP", "PASSWORD_PROTECTED", "UNRESTRICTED_ACCESS", "MARKETPLACE_LISTING", "LAYOUT_SECTION", "THEME_SETTINGS", "VIDEO_PLAYER", "URL_MAPPING", "KNOWLEDGE_CATEGORY", "KNOWLEDGE_HOMEPAGE_CATEGORY", "RAW_ASSET", "GLOBAL_CONTENT", "HUBDB_TABLE_ROW", "BLOG_AUTHOR", "SERVERLESS_FUNCTION", "KNOWLEDGE_CATEGORY_TRANSLATION"]) return false unless cos_object_type_validator.valid?(@cos_object_type) return false if @cdn_purge_embargo_time.nil? true end |