Class: OCI::Dns::Models::RecordDetails

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ RecordDetails

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :domain (String)

    The value to assign to the #domain property

  • :record_hash (String)

    The value to assign to the #record_hash property

  • :is_protected (BOOLEAN)

    The value to assign to the #is_protected property

  • :rdata (String)

    The value to assign to the #rdata property

  • :rrset_version (String)

    The value to assign to the #rrset_version property

  • :rtype (String)

    The value to assign to the #rtype property

  • :ttl (Integer)

    The value to assign to the #ttl property



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

#domainString

[Required] The fully qualified domain name where the record can be located.

Returns:

  • (String)


11
12
13
# File 'lib/oci/dns/models/record_details.rb', line 11

def domain
  @domain
end

#is_protectedBOOLEAN

A Boolean flag indicating whether or not parts of the record are unable to be explicitly managed.

Returns:

  • (BOOLEAN)


22
23
24
# File 'lib/oci/dns/models/record_details.rb', line 22

def is_protected
  @is_protected
end

#rdataString

[Required] The record’s data, as whitespace-delimited tokens in type-specific presentation format.

Returns:

  • (String)


28
29
30
# File 'lib/oci/dns/models/record_details.rb', line 28

def rdata
  @rdata
end

#record_hashString

A unique identifier for the record within its zone.

Returns:

  • (String)


16
17
18
# File 'lib/oci/dns/models/record_details.rb', line 16

def record_hash
  @record_hash
end

#rrset_versionString

The latest version of the record’s zone in which its RRSet differs from the preceding version.

Returns:

  • (String)


34
35
36
# File 'lib/oci/dns/models/record_details.rb', line 34

def rrset_version
  @rrset_version
end

#rtypeString

[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).

Returns:

  • (String)


40
41
42
# File 'lib/oci/dns/models/record_details.rb', line 40

def rtype
  @rtype
end

#ttlInteger

[Required] The Time To Live for the record, in seconds.

Returns:

  • (Integer)


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.

Parameters:

  • other_object (Object)

    to be compared



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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



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

Parameters:

  • other_object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


126
127
128
# File 'lib/oci/dns/models/record_details.rb', line 126

def eql?(other_object)
  self == other_object
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



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_hashHash

Returns the object in the form of hash

Returns:

  • (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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



158
159
160
# File 'lib/oci/dns/models/record_details.rb', line 158

def to_s
  to_hash.to_s
end