Class: Norbelys::DomainTracking
- Inherits:
-
Object
- Object
- Norbelys::DomainTracking
- Defined in:
- lib/norbelys/models/domain_tracking.rb
Overview
Custom tracking hostname state for a tracking domain.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#assigned_sending_domain_ids ⇒ Object
Sending domains whose links route through this tracking hostname.
-
#cloudflare_hostname_id ⇒ Object
Returns the value of attribute cloudflare_hostname_id.
-
#desired_state ⇒ Object
Operator target state:
activeordisabled. -
#dns_status ⇒ Object
Whether the CNAME resolves correctly:
pending,valid, orinvalid. -
#domain_connect_supported ⇒ Object
Whether the DNS provider supports one-click Domain Connect setup.
-
#domain_connect_url ⇒ Object
Returns the value of attribute domain_connect_url.
-
#http_status ⇒ Object
Whether the tracking host serves over HTTP correctly:
pending,valid, orinvalid. -
#is_organization_default ⇒ Object
Whether this is the organization's default tracking domain.
-
#label ⇒ Object
Returns the value of attribute label.
-
#last_checked_at ⇒ Object
Returns the value of attribute last_checked_at.
-
#provider ⇒ Object
Detected DNS provider:
cloudflare,vercel,other, orunknown. -
#provider_display_name ⇒ Object
Returns the value of attribute provider_display_name.
-
#provider_url ⇒ Object
Returns the value of attribute provider_url.
-
#record ⇒ Object
Returns the value of attribute record.
-
#setup_mode ⇒ Object
How the record is being set up:
domain_connectormanual. -
#status ⇒ Object
Lifecycle status:
pending_dns,pending_tls,checking,active,degraded, orarchived. -
#tls_status ⇒ Object
Whether the edge TLS certificate is issued:
pending,valid, orinvalid.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.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.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ DomainTracking
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 = {}) ⇒ DomainTracking
Initializes the object
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 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 |
# File 'lib/norbelys/models/domain_tracking.rb', line 150 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Norbelys::DomainTracking` 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 `Norbelys::DomainTracking`. 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?(:'assigned_sending_domain_ids') if (value = attributes[:'assigned_sending_domain_ids']).is_a?(Array) self.assigned_sending_domain_ids = value end else self.assigned_sending_domain_ids = nil end if attributes.key?(:'cloudflare_hostname_id') self.cloudflare_hostname_id = attributes[:'cloudflare_hostname_id'] else self.cloudflare_hostname_id = nil end if attributes.key?(:'desired_state') self.desired_state = attributes[:'desired_state'] else self.desired_state = nil end if attributes.key?(:'dns_status') self.dns_status = attributes[:'dns_status'] else self.dns_status = nil end if attributes.key?(:'domain_connect_supported') self.domain_connect_supported = attributes[:'domain_connect_supported'] else self.domain_connect_supported = nil end if attributes.key?(:'domain_connect_url') self.domain_connect_url = attributes[:'domain_connect_url'] else self.domain_connect_url = nil end if attributes.key?(:'http_status') self.http_status = attributes[:'http_status'] else self.http_status = nil end if attributes.key?(:'is_organization_default') self.is_organization_default = attributes[:'is_organization_default'] else self.is_organization_default = nil end if attributes.key?(:'label') self.label = attributes[:'label'] else self.label = nil end if attributes.key?(:'last_checked_at') self.last_checked_at = attributes[:'last_checked_at'] end if attributes.key?(:'provider') self.provider = attributes[:'provider'] else self.provider = nil end if attributes.key?(:'provider_display_name') self.provider_display_name = attributes[:'provider_display_name'] else self.provider_display_name = nil end if attributes.key?(:'provider_url') self.provider_url = attributes[:'provider_url'] else self.provider_url = nil end if attributes.key?(:'record') self.record = attributes[:'record'] else self.record = nil end if attributes.key?(:'setup_mode') self.setup_mode = attributes[:'setup_mode'] else self.setup_mode = nil end if attributes.key?(:'status') self.status = attributes[:'status'] else self.status = nil end if attributes.key?(:'tls_status') self.tls_status = attributes[:'tls_status'] else self.tls_status = nil end end |
Instance Attribute Details
#assigned_sending_domain_ids ⇒ Object
Sending domains whose links route through this tracking hostname.
20 21 22 |
# File 'lib/norbelys/models/domain_tracking.rb', line 20 def assigned_sending_domain_ids @assigned_sending_domain_ids end |
#cloudflare_hostname_id ⇒ Object
Returns the value of attribute cloudflare_hostname_id.
22 23 24 |
# File 'lib/norbelys/models/domain_tracking.rb', line 22 def cloudflare_hostname_id @cloudflare_hostname_id end |
#desired_state ⇒ Object
Operator target state: active or disabled.
25 26 27 |
# File 'lib/norbelys/models/domain_tracking.rb', line 25 def desired_state @desired_state end |
#dns_status ⇒ Object
Whether the CNAME resolves correctly: pending, valid, or invalid.
28 29 30 |
# File 'lib/norbelys/models/domain_tracking.rb', line 28 def dns_status @dns_status end |
#domain_connect_supported ⇒ Object
Whether the DNS provider supports one-click Domain Connect setup.
31 32 33 |
# File 'lib/norbelys/models/domain_tracking.rb', line 31 def domain_connect_supported @domain_connect_supported end |
#domain_connect_url ⇒ Object
Returns the value of attribute domain_connect_url.
33 34 35 |
# File 'lib/norbelys/models/domain_tracking.rb', line 33 def domain_connect_url @domain_connect_url end |
#http_status ⇒ Object
Whether the tracking host serves over HTTP correctly: pending, valid, or invalid.
36 37 38 |
# File 'lib/norbelys/models/domain_tracking.rb', line 36 def http_status @http_status end |
#is_organization_default ⇒ Object
Whether this is the organization's default tracking domain.
39 40 41 |
# File 'lib/norbelys/models/domain_tracking.rb', line 39 def is_organization_default @is_organization_default end |
#label ⇒ Object
Returns the value of attribute label.
41 42 43 |
# File 'lib/norbelys/models/domain_tracking.rb', line 41 def label @label end |
#last_checked_at ⇒ Object
Returns the value of attribute last_checked_at.
43 44 45 |
# File 'lib/norbelys/models/domain_tracking.rb', line 43 def last_checked_at @last_checked_at end |
#provider ⇒ Object
Detected DNS provider: cloudflare, vercel, other, or unknown.
46 47 48 |
# File 'lib/norbelys/models/domain_tracking.rb', line 46 def provider @provider end |
#provider_display_name ⇒ Object
Returns the value of attribute provider_display_name.
48 49 50 |
# File 'lib/norbelys/models/domain_tracking.rb', line 48 def provider_display_name @provider_display_name end |
#provider_url ⇒ Object
Returns the value of attribute provider_url.
50 51 52 |
# File 'lib/norbelys/models/domain_tracking.rb', line 50 def provider_url @provider_url end |
#record ⇒ Object
Returns the value of attribute record.
52 53 54 |
# File 'lib/norbelys/models/domain_tracking.rb', line 52 def record @record end |
#setup_mode ⇒ Object
How the record is being set up: domain_connect or manual.
55 56 57 |
# File 'lib/norbelys/models/domain_tracking.rb', line 55 def setup_mode @setup_mode end |
#status ⇒ Object
Lifecycle status: pending_dns, pending_tls, checking, active, degraded, or archived.
58 59 60 |
# File 'lib/norbelys/models/domain_tracking.rb', line 58 def status @status end |
#tls_status ⇒ Object
Whether the edge TLS certificate is issued: pending, valid, or invalid.
61 62 63 |
# File 'lib/norbelys/models/domain_tracking.rb', line 61 def tls_status @tls_status end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 |
# File 'lib/norbelys/models/domain_tracking.rb', line 483 def self._deserialize(type, value) case type.to_sym when :Time Time.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 # models (e.g. Pet) or oneOf klass = Norbelys.const_get(type) klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
109 110 111 |
# File 'lib/norbelys/models/domain_tracking.rb', line 109 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/norbelys/models/domain_tracking.rb', line 86 def self.attribute_map { :'assigned_sending_domain_ids' => :'assignedSendingDomainIds', :'cloudflare_hostname_id' => :'cloudflareHostnameId', :'desired_state' => :'desiredState', :'dns_status' => :'dnsStatus', :'domain_connect_supported' => :'domainConnectSupported', :'domain_connect_url' => :'domainConnectUrl', :'http_status' => :'httpStatus', :'is_organization_default' => :'isOrganizationDefault', :'label' => :'label', :'last_checked_at' => :'lastCheckedAt', :'provider' => :'provider', :'provider_display_name' => :'providerDisplayName', :'provider_url' => :'providerUrl', :'record' => :'record', :'setup_mode' => :'setupMode', :'status' => :'status', :'tls_status' => :'tlsStatus' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
# File 'lib/norbelys/models/domain_tracking.rb', line 459 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif 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[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
137 138 139 140 141 142 143 144 145 146 |
# File 'lib/norbelys/models/domain_tracking.rb', line 137 def self.openapi_nullable Set.new([ :'cloudflare_hostname_id', :'domain_connect_url', :'label', :'last_checked_at', :'provider_display_name', :'provider_url', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/norbelys/models/domain_tracking.rb', line 114 def self.openapi_types { :'assigned_sending_domain_ids' => :'Array<String>', :'cloudflare_hostname_id' => :'String', :'desired_state' => :'String', :'dns_status' => :'String', :'domain_connect_supported' => :'Boolean', :'domain_connect_url' => :'String', :'http_status' => :'String', :'is_organization_default' => :'Boolean', :'label' => :'String', :'last_checked_at' => :'Object', :'provider' => :'String', :'provider_display_name' => :'String', :'provider_url' => :'String', :'record' => :'TrackingDnsRecord', :'setup_mode' => :'String', :'status' => :'String', :'tls_status' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 |
# File 'lib/norbelys/models/domain_tracking.rb', line 422 def ==(o) return true if self.equal?(o) self.class == o.class && assigned_sending_domain_ids == o.assigned_sending_domain_ids && cloudflare_hostname_id == o.cloudflare_hostname_id && desired_state == o.desired_state && dns_status == o.dns_status && domain_connect_supported == o.domain_connect_supported && domain_connect_url == o.domain_connect_url && http_status == o.http_status && is_organization_default == o.is_organization_default && label == o.label && last_checked_at == o.last_checked_at && provider == o.provider && provider_display_name == o.provider_display_name && provider_url == o.provider_url && record == o.record && setup_mode == o.setup_mode && status == o.status && tls_status == o.tls_status end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
554 555 556 557 558 559 560 561 562 563 564 565 566 |
# File 'lib/norbelys/models/domain_tracking.rb', line 554 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 |
#eql?(o) ⇒ Boolean
446 447 448 |
# File 'lib/norbelys/models/domain_tracking.rb', line 446 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
452 453 454 |
# File 'lib/norbelys/models/domain_tracking.rb', line 452 def hash [assigned_sending_domain_ids, cloudflare_hostname_id, desired_state, dns_status, domain_connect_supported, domain_connect_url, http_status, is_organization_default, label, last_checked_at, provider, provider_display_name, provider_url, record, setup_mode, status, tls_status].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 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 |
# File 'lib/norbelys/models/domain_tracking.rb', line 268 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @assigned_sending_domain_ids.nil? invalid_properties.push('invalid value for "assigned_sending_domain_ids", assigned_sending_domain_ids cannot be nil.') end if @desired_state.nil? invalid_properties.push('invalid value for "desired_state", desired_state cannot be nil.') end if @dns_status.nil? invalid_properties.push('invalid value for "dns_status", dns_status cannot be nil.') end if @domain_connect_supported.nil? invalid_properties.push('invalid value for "domain_connect_supported", domain_connect_supported cannot be nil.') end if @http_status.nil? invalid_properties.push('invalid value for "http_status", http_status cannot be nil.') end if @is_organization_default.nil? invalid_properties.push('invalid value for "is_organization_default", is_organization_default cannot be nil.') end if @provider.nil? invalid_properties.push('invalid value for "provider", provider cannot be nil.') end if @record.nil? invalid_properties.push('invalid value for "record", record cannot be nil.') end if @setup_mode.nil? invalid_properties.push('invalid value for "setup_mode", setup_mode cannot be nil.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end if @tls_status.nil? invalid_properties.push('invalid value for "tls_status", tls_status cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
530 531 532 |
# File 'lib/norbelys/models/domain_tracking.rb', line 530 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
536 537 538 539 540 541 542 543 544 545 546 547 548 |
# File 'lib/norbelys/models/domain_tracking.rb', line 536 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
524 525 526 |
# File 'lib/norbelys/models/domain_tracking.rb', line 524 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
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 |
# File 'lib/norbelys/models/domain_tracking.rb', line 320 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @assigned_sending_domain_ids.nil? return false if @desired_state.nil? desired_state_validator = EnumAttributeValidator.new('String', ["active", "disabled"]) return false unless desired_state_validator.valid?(@desired_state) return false if @dns_status.nil? dns_status_validator = EnumAttributeValidator.new('String', ["pending", "valid", "invalid"]) return false unless dns_status_validator.valid?(@dns_status) return false if @domain_connect_supported.nil? return false if @http_status.nil? http_status_validator = EnumAttributeValidator.new('String', ["pending", "valid", "invalid"]) return false unless http_status_validator.valid?(@http_status) return false if @is_organization_default.nil? return false if @provider.nil? provider_validator = EnumAttributeValidator.new('String', ["cloudflare", "vercel", "other", "unknown"]) return false unless provider_validator.valid?(@provider) return false if @record.nil? return false if @setup_mode.nil? setup_mode_validator = EnumAttributeValidator.new('String', ["domain_connect", "manual"]) return false unless setup_mode_validator.valid?(@setup_mode) return false if @status.nil? status_validator = EnumAttributeValidator.new('String', ["pending_dns", "pending_tls", "checking", "active", "degraded", "archived"]) return false unless status_validator.valid?(@status) return false if @tls_status.nil? tls_status_validator = EnumAttributeValidator.new('String', ["pending", "valid", "invalid"]) return false unless tls_status_validator.valid?(@tls_status) true end |