Class: OCI::Dns::Models::RecordDetails
- Inherits:
-
Object
- Object
- OCI::Dns::Models::RecordDetails
- Defined in:
- lib/oci/dns/models/record_details.rb
Overview
A DNS resource record. For more information about records, see [RFC 1034](tools.ietf.org/html/rfc1034#section-3.6).
Instance Attribute Summary collapse
-
#domain ⇒ String
[Required] The fully qualified domain name where the record can be located.
-
#is_protected ⇒ BOOLEAN
A Boolean flag indicating whether or not parts of the record are unable to be explicitly managed.
-
#rdata ⇒ String
[Required] The record’s data, as whitespace-delimited tokens in type-specific presentation format.
-
#record_hash ⇒ String
A unique identifier for the record within its zone.
-
#rrset_version ⇒ String
The latest version of the record’s zone in which its RRSet differs from the preceding version.
-
#rtype ⇒ String
[Required] The canonical name for the record’s type, such as A or CNAME.
-
#ttl ⇒ Integer
[Required] The Time To Live for the record, in seconds.
Instance Method Summary collapse
-
#==(other_object) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other_object) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ RecordDetails
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ RecordDetails
Initializes the object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/oci/dns/models/record_details.rb', line 56 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} if attributes[:'domain'] self.domain = attributes[:'domain'] end if attributes[:'recordHash'] self.record_hash = attributes[:'recordHash'] end raise 'You cannot provide both :recordHash and :record_hash' if attributes.key?(:'recordHash') && attributes.key?(:'record_hash') if attributes[:'record_hash'] self.record_hash = attributes[:'record_hash'] end unless attributes[:'isProtected'].nil? self.is_protected = attributes[:'isProtected'] end raise 'You cannot provide both :isProtected and :is_protected' if attributes.key?(:'isProtected') && attributes.key?(:'is_protected') unless attributes[:'is_protected'].nil? self.is_protected = attributes[:'is_protected'] end if attributes[:'rdata'] self.rdata = attributes[:'rdata'] end if attributes[:'rrsetVersion'] self.rrset_version = attributes[:'rrsetVersion'] end raise 'You cannot provide both :rrsetVersion and :rrset_version' if attributes.key?(:'rrsetVersion') && attributes.key?(:'rrset_version') if attributes[:'rrset_version'] self.rrset_version = attributes[:'rrset_version'] end if attributes[:'rtype'] self.rtype = attributes[:'rtype'] end if attributes[:'ttl'] self.ttl = attributes[:'ttl'] end end |
Instance Attribute Details
#domain ⇒ String
[Required] The fully qualified domain name where the record can be located.
11 12 13 |
# File 'lib/oci/dns/models/record_details.rb', line 11 def domain @domain end |
#is_protected ⇒ BOOLEAN
A Boolean flag indicating whether or not parts of the record are unable to be explicitly managed.
22 23 24 |
# File 'lib/oci/dns/models/record_details.rb', line 22 def is_protected @is_protected end |
#rdata ⇒ String
[Required] The record’s data, as whitespace-delimited tokens in type-specific presentation format.
28 29 30 |
# File 'lib/oci/dns/models/record_details.rb', line 28 def rdata @rdata end |
#record_hash ⇒ String
A unique identifier for the record within its zone.
16 17 18 |
# File 'lib/oci/dns/models/record_details.rb', line 16 def record_hash @record_hash end |
#rrset_version ⇒ String
The latest version of the record’s zone in which its RRSet differs from the preceding version.
34 35 36 |
# File 'lib/oci/dns/models/record_details.rb', line 34 def rrset_version @rrset_version end |
#rtype ⇒ String
[Required] The canonical name for the record’s type, such as A or CNAME. For more information, see [Resource Record (RR) TYPEs](www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4).
40 41 42 |
# File 'lib/oci/dns/models/record_details.rb', line 40 def rtype @rtype end |
#ttl ⇒ Integer
[Required] The Time To Live for the record, in seconds.
44 45 46 |
# File 'lib/oci/dns/models/record_details.rb', line 44 def ttl @ttl end |
Instance Method Details
#==(other_object) ⇒ Object
Checks equality by comparing each attribute.
112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/oci/dns/models/record_details.rb', line 112 def ==(other_object) return true if self.equal?(other_object) self.class == other_object.class && domain == other_object.domain && record_hash == other_object.record_hash && is_protected == other_object.is_protected && rdata == other_object.rdata && rrset_version == other_object.rrset_version && rtype == other_object.rtype && ttl == other_object.ttl end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/oci/dns/models/record_details.rb', line 139 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(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?(other_object) ⇒ Boolean
126 127 128 |
# File 'lib/oci/dns/models/record_details.rb', line 126 def eql?(other_object) self == other_object end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
132 133 134 |
# File 'lib/oci/dns/models/record_details.rb', line 132 def hash [domain, record_hash, is_protected, rdata, rrset_version, rtype, ttl].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
164 165 166 167 168 169 170 171 172 |
# File 'lib/oci/dns/models/record_details.rb', line 164 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
158 159 160 |
# File 'lib/oci/dns/models/record_details.rb', line 158 def to_s to_hash.to_s end |