Class: OCI::NetworkLoadBalancer::Models::DnsHealthCheckerDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/network_load_balancer/models/dns_health_checker_details.rb

Overview

DNS healthcheck configurations.

Constant Summary collapse

TRANSPORT_PROTOCOL_ENUM =
[
  TRANSPORT_PROTOCOL_UDP = 'UDP'.freeze,
  TRANSPORT_PROTOCOL_TCP = 'TCP'.freeze,
  TRANSPORT_PROTOCOL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
QUERY_CLASS_ENUM =
[
  QUERY_CLASS_IN = 'IN'.freeze,
  QUERY_CLASS_CH = 'CH'.freeze,
  QUERY_CLASS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
QUERY_TYPE_ENUM =
[
  QUERY_TYPE_A = 'A'.freeze,
  QUERY_TYPE_TXT = 'TXT'.freeze,
  QUERY_TYPE_AAAA = 'AAAA'.freeze,
  QUERY_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DnsHealthCheckerDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :transport_protocol (String)

    The value to assign to the #transport_protocol property

  • :domain_name (String)

    The value to assign to the #domain_name property

  • :query_class (String)

    The value to assign to the #query_class property

  • :query_type (String)

    The value to assign to the #query_type property

  • :rcodes (Array<OCI::NetworkLoadBalancer::Models::DnsHealthCheckRCodes>)

    The value to assign to the #rcodes property



101
102
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
132
# File 'lib/oci/network_load_balancer/models/dns_health_checker_details.rb', line 101

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 }

  self.transport_protocol = attributes[:'transportProtocol'] if attributes[:'transportProtocol']

  raise 'You cannot provide both :transportProtocol and :transport_protocol' if attributes.key?(:'transportProtocol') && attributes.key?(:'transport_protocol')

  self.transport_protocol = attributes[:'transport_protocol'] if attributes[:'transport_protocol']

  self.domain_name = attributes[:'domainName'] if attributes[:'domainName']

  raise 'You cannot provide both :domainName and :domain_name' if attributes.key?(:'domainName') && attributes.key?(:'domain_name')

  self.domain_name = attributes[:'domain_name'] if attributes[:'domain_name']

  self.query_class = attributes[:'queryClass'] if attributes[:'queryClass']

  raise 'You cannot provide both :queryClass and :query_class' if attributes.key?(:'queryClass') && attributes.key?(:'query_class')

  self.query_class = attributes[:'query_class'] if attributes[:'query_class']

  self.query_type = attributes[:'queryType'] if attributes[:'queryType']

  raise 'You cannot provide both :queryType and :query_type' if attributes.key?(:'queryType') && attributes.key?(:'query_type')

  self.query_type = attributes[:'query_type'] if attributes[:'query_type']

  self.rcodes = attributes[:'rcodes'] if attributes[:'rcodes']
end

Instance Attribute Details

#domain_nameString

[Required] The absolute fully-qualified domain name to perform periodic DNS queries. If not provided, an extra dot will be added at the end of a domain name during the query.

Returns:

  • (String)


42
43
44
# File 'lib/oci/network_load_balancer/models/dns_health_checker_details.rb', line 42

def domain_name
  @domain_name
end

#query_classString

The class the dns health check query to use; either IN or CH.

Example: IN

Returns:

  • (String)


49
50
51
# File 'lib/oci/network_load_balancer/models/dns_health_checker_details.rb', line 49

def query_class
  @query_class
end

#query_typeString

The type the dns health check query to use; A, AAAA, TXT.

Example: A

Returns:

  • (String)


56
57
58
# File 'lib/oci/network_load_balancer/models/dns_health_checker_details.rb', line 56

def query_type
  @query_type
end

#rcodesArray<OCI::NetworkLoadBalancer::Models::DnsHealthCheckRCodes>

An array that represents accepetable RCODE values for DNS query response. Example: ["NOERROR", "NXDOMAIN"]

Returns:

  • (Array<OCI::NetworkLoadBalancer::Models::DnsHealthCheckRCodes>)


62
63
64
# File 'lib/oci/network_load_balancer/models/dns_health_checker_details.rb', line 62

def rcodes
  @rcodes
end

#transport_protocolString

DNS transport protocol; either UDP or TCP.

Example: UDP

Returns:

  • (String)


36
37
38
# File 'lib/oci/network_load_balancer/models/dns_health_checker_details.rb', line 36

def transport_protocol
  @transport_protocol
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/oci/network_load_balancer/models/dns_health_checker_details.rb', line 65

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'transport_protocol': :'transportProtocol',
    'domain_name': :'domainName',
    'query_class': :'queryClass',
    'query_type': :'queryType',
    'rcodes': :'rcodes'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



78
79
80
81
82
83
84
85
86
87
88
# File 'lib/oci/network_load_balancer/models/dns_health_checker_details.rb', line 78

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'transport_protocol': :'String',
    'domain_name': :'String',
    'query_class': :'String',
    'query_type': :'String',
    'rcodes': :'Array<OCI::NetworkLoadBalancer::Models::DnsHealthCheckRCodes>'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



180
181
182
183
184
185
186
187
188
189
# File 'lib/oci/network_load_balancer/models/dns_health_checker_details.rb', line 180

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    transport_protocol == other.transport_protocol &&
    domain_name == other.domain_name &&
    query_class == other.query_class &&
    query_type == other.query_type &&
    rcodes == other.rcodes
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



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/oci/network_load_balancer/models/dns_health_checker_details.rb', line 214

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)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      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) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


194
195
196
# File 'lib/oci/network_load_balancer/models/dns_health_checker_details.rb', line 194

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



203
204
205
# File 'lib/oci/network_load_balancer/models/dns_health_checker_details.rb', line 203

def hash
  [transport_protocol, domain_name, query_class, query_type, rcodes].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



247
248
249
250
251
252
253
254
255
256
# File 'lib/oci/network_load_balancer/models/dns_health_checker_details.rb', line 247

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



241
242
243
# File 'lib/oci/network_load_balancer/models/dns_health_checker_details.rb', line 241

def to_s
  to_hash.to_s
end