Class: LinodeOpenapiClient::PutDomainRecordRequest
- Inherits:
-
Object
- Object
- LinodeOpenapiClient::PutDomainRecordRequest
- Defined in:
- lib/linode_openapi_client/models/put_domain_record_request.rb
Overview
A Domain Record Update request object.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#name ⇒ Object
__Filterable__ The name of this Record.
-
#port ⇒ Object
The port this Record points to.
-
#priority ⇒ Object
The priority of the target host for this Record.
-
#protocol ⇒ Object
The protocol this Record’s service communicates with.
-
#service ⇒ Object
The name of the service.
-
#tag ⇒ Object
__Filterable__ The tag portion of a CAA record.
-
#target ⇒ Object
__Filterable__ The target for this Record.
-
#ttl_sec ⇒ Object
"Time to Live" - the amount of time in seconds that this Domain’s records may be cached by resolvers or other domain servers.
-
#weight ⇒ Object
The relative weight of this Record used in the case of identical priority.
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 = {}) ⇒ PutDomainRecordRequest
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 = {}) ⇒ PutDomainRecordRequest
Initializes the object
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 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/linode_openapi_client/models/put_domain_record_request.rb', line 114 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `LinodeOpenapiClient::PutDomainRecordRequest` 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 `LinodeOpenapiClient::PutDomainRecordRequest`. 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?(:'ttl_sec') self.ttl_sec = attributes[:'ttl_sec'] end if attributes.key?(:'priority') self.priority = attributes[:'priority'] end if attributes.key?(:'service') self.service = attributes[:'service'] end if attributes.key?(:'port') self.port = attributes[:'port'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'weight') self.weight = attributes[:'weight'] end if attributes.key?(:'tag') self.tag = attributes[:'tag'] end if attributes.key?(:'protocol') self.protocol = attributes[:'protocol'] end if attributes.key?(:'target') self.target = attributes[:'target'] end end |
Instance Attribute Details
#name ⇒ Object
__Filterable__ The name of this Record. For requests, this property’s actual usage and whether it is required depends on the type of record this represents: ‘A` and `AAAA`: The hostname or FQDN of the Record. `NS`: The subdomain, if any, to use with the Domain of the Record. Wildcard NS records (`*`) are not supported. `MX`: The mail subdomain. For example, `sub` for the address `[email protected]` under the `example.com` Domain. - The left-most subdomain component may be an asterisk (`*`) to designate a wildcard subdomain. - Other subdomain components must only contain letters, digits, and hyphens, start with a letter, end with a letter or digit, and contain less than 64 characters. - Must be an empty string (`""`) for a Null MX Record. `CNAME`: The hostname. Must be unique. Required. `TXT`: The hostname. `SRV`: Unused. Use the `service` property to set the service name for this record. `CAA`: The subdomain. Omit or enter an empty string (`""`) to apply to the entire Domain. `PTR`: See our guide on how to [Configure Your Linode for Reverse DNS (rDNS)](www.linode.com/docs/guides/configure-rdns/).
32 33 34 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 32 def name @name end |
#port ⇒ Object
The port this Record points to. Only valid and required for SRV record requests.
29 30 31 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 29 def port @port end |
#priority ⇒ Object
The priority of the target host for this Record. Lower values are preferred. Only valid for MX and SRV record requests. Required for SRV record requests. Defaults to ‘0` for MX record requests. Must be `0` for Null MX records.
23 24 25 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 23 def priority @priority end |
#protocol ⇒ Object
The protocol this Record’s service communicates with. An underscore (‘_`) is prepended automatically to the submitted value for this property. Only valid for SRV record requests.
41 42 43 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 41 def protocol @protocol end |
#service ⇒ Object
The name of the service. An underscore (‘_`) is prepended and a period (`.`) is appended automatically to the submitted value for this property. Only valid and required for SRV record requests.
26 27 28 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 26 def service @service end |
#tag ⇒ Object
__Filterable__ The tag portion of a CAA record. Only valid and required for CAA record requests.
38 39 40 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 38 def tag @tag end |
#target ⇒ Object
__Filterable__ The target for this Record. For requests, this property’s actual usage and whether it is required depends on the type of record this represents: ‘A` and `AAAA`: The IP address. Use `[remote_addr]` to submit the IPv4 address of the request. Required. `NS`: The name server. Must be a valid domain. Required. `MX`: The mail server. Must be a valid domain unless creating a Null MX Record. Required. - Must have less than 254 total characters. - The left-most domain component may be an asterisk (`*`) to designate a wildcard domain. - Other domain components must only contain letters, digits, and hyphens, start with a letter, end with a letter or digit, and contain less than 64 characters. - To create a [Null MX Record](datatracker.ietf.org/doc/html/rfc7505), first [remove](techdocs.akamai.com/linode-api/reference/delete-domain-record) any additional MX records, then create an MX record with empty strings (`""`) for the `target` and `name`. If a Domain has a Null MX record, new MX records cannot be created. `CNAME`: The alias. Must be a valid domain. Required. `TXT`: The value. Required. `SRV`: The target domain or subdomain. If a subdomain is entered, it is automatically used with the Domain. To configure for a different domain, enter a valid FQDN. For example, the value `www` with a Domain for `example.com` results in a target set to `www.example.com`, whereas the value `sample.com` results in a target set to `sample.com`. Required. `CAA`: The value. For `issue` or `issuewild` tags, the domain of your certificate issuer. For the `iodef` tag, a contact or submission URL (domain, http, https, or mailto). Requirements depend on the tag for this record: - `issue`: The domain of your certificate issuer. Must include a valid domain. May include additional parameters separated with semicolons (`;`), for example: `www.example.com; foo=bar` - `issuewild`: The domain of your wildcard certificate issuer. Must be a valid domain and must not start with an asterisk (`*`). - `iodef`: Must be either (1) a valid domain, (2) a valid domain prepended with `http://` or `https://`, or (3) a valid email address prepended with `mailto:`. `PTR`: Required. See our guide on how to [Configure Your Linode for Reverse DNS (rDNS)](www.linode.com/docs/guides/configure-rdns/). With the exception of A, AAAA, and CAA records, this field accepts a trailing period.
44 45 46 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 44 def target @target end |
#ttl_sec ⇒ Object
"Time to Live" - the amount of time in seconds that this Domain’s records may be cached by resolvers or other domain servers. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value.
20 21 22 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 20 def ttl_sec @ttl_sec end |
#weight ⇒ Object
The relative weight of this Record used in the case of identical priority. Higher values are preferred. Only valid and required for SRV record requests.
35 36 37 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 35 def weight @weight end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 377 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 = LinodeOpenapiClient.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
84 85 86 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 84 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 69 def self.attribute_map { :'ttl_sec' => :'ttl_sec', :'priority' => :'priority', :'service' => :'service', :'port' => :'port', :'name' => :'name', :'weight' => :'weight', :'tag' => :'tag', :'protocol' => :'protocol', :'target' => :'target' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 353 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
104 105 106 107 108 109 110 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 104 def self.openapi_nullable Set.new([ :'service', :'tag', :'protocol', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 89 def self.openapi_types { :'ttl_sec' => :'Integer', :'priority' => :'Integer', :'service' => :'String', :'port' => :'Integer', :'name' => :'String', :'weight' => :'Integer', :'tag' => :'String', :'protocol' => :'String', :'target' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
324 325 326 327 328 329 330 331 332 333 334 335 336 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 324 def ==(o) return true if self.equal?(o) self.class == o.class && ttl_sec == o.ttl_sec && priority == o.priority && service == o.service && port == o.port && name == o.name && weight == o.weight && tag == o.tag && protocol == o.protocol && target == o.target end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
448 449 450 451 452 453 454 455 456 457 458 459 460 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 448 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
340 341 342 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 340 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
346 347 348 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 346 def hash [ttl_sec, priority, service, port, name, weight, tag, protocol, target].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 166 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if !@priority.nil? && @priority > 255 invalid_properties.push('invalid value for "priority", must be smaller than or equal to 255.') end if !@priority.nil? && @priority < 0 invalid_properties.push('invalid value for "priority", must be greater than or equal to 0.') end if !@port.nil? && @port > 65535 invalid_properties.push('invalid value for "port", must be smaller than or equal to 65535.') end if !@port.nil? && @port < 0 invalid_properties.push('invalid value for "port", must be greater than or equal to 0.') end if !@name.nil? && @name.to_s.length > 100 invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.') end if !@name.nil? && @name.to_s.length < 1 invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') end if !@weight.nil? && @weight > 65535 invalid_properties.push('invalid value for "weight", must be smaller than or equal to 65535.') end if !@weight.nil? && @weight < 0 invalid_properties.push('invalid value for "weight", must be greater than or equal to 0.') end if !@target.nil? && @target.to_s.length > 65535 invalid_properties.push('invalid value for "target", the character length must be smaller than or equal to 65535.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
424 425 426 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 424 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
430 431 432 433 434 435 436 437 438 439 440 441 442 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 430 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
418 419 420 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 418 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
# File 'lib/linode_openapi_client/models/put_domain_record_request.rb', line 210 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@priority.nil? && @priority > 255 return false if !@priority.nil? && @priority < 0 return false if !@port.nil? && @port > 65535 return false if !@port.nil? && @port < 0 return false if !@name.nil? && @name.to_s.length > 100 return false if !@name.nil? && @name.to_s.length < 1 return false if !@weight.nil? && @weight > 65535 return false if !@weight.nil? && @weight < 0 tag_validator = EnumAttributeValidator.new('String', ["issue", "issuewild", "iodef"]) return false unless tag_validator.valid?(@tag) return false if !@target.nil? && @target.to_s.length > 65535 true end |