Class: OCI::Core::Models::CrossConnectStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/core/models/cross_connect_status.rb

Overview

The status of the cross-connect.

Constant Summary collapse

INTERFACE_STATE_ENUM =

rubocop:disable Metrics/LineLength

[
  INTERFACE_STATE_UP = 'UP'.freeze,
  INTERFACE_STATE_DOWN = 'DOWN'.freeze,
  INTERFACE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LIGHT_LEVEL_INDICATOR_ENUM =
[
  LIGHT_LEVEL_INDICATOR_NO_LIGHT = 'NO_LIGHT'.freeze,
  LIGHT_LEVEL_INDICATOR_LOW_WARN = 'LOW_WARN'.freeze,
  LIGHT_LEVEL_INDICATOR_HIGH_WARN = 'HIGH_WARN'.freeze,
  LIGHT_LEVEL_INDICATOR_BAD = 'BAD'.freeze,
  LIGHT_LEVEL_INDICATOR_GOOD = 'GOOD'.freeze,
  LIGHT_LEVEL_INDICATOR_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CrossConnectStatus

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/oci/core/models/cross_connect_status.rb', line 89

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.cross_connect_id = attributes[:'crossConnectId'] if attributes[:'crossConnectId']

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

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

  self.interface_state = attributes[:'interfaceState'] if attributes[:'interfaceState']

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

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

  self.light_level_ind_bm = attributes[:'lightLevelIndBm'] if attributes[:'lightLevelIndBm']

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

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

  self.light_level_indicator = attributes[:'lightLevelIndicator'] if attributes[:'lightLevelIndicator']

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

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

Instance Attribute Details

#cross_connect_idString

[Required] The OCID of the cross-connect.

Returns:

  • (String)


27
28
29
# File 'lib/oci/core/models/cross_connect_status.rb', line 27

def cross_connect_id
  @cross_connect_id
end

#interface_stateString

Whether Oracle’s side of the interface is up or down.

Returns:

  • (String)


31
32
33
# File 'lib/oci/core/models/cross_connect_status.rb', line 31

def interface_state
  @interface_state
end

#light_level_ind_bmFloat

The light level of the cross-connect (in dBm).

Example: ‘14.0`

Returns:

  • (Float)


38
39
40
# File 'lib/oci/core/models/cross_connect_status.rb', line 38

def light_level_ind_bm
  @light_level_ind_bm
end

#light_level_indicatorString

Status indicator corresponding to the light level.

* **NO_LIGHT:** No measurable light

* **LOW_WARN:** There's measurable light but it's too low

* **HIGH_WARN:** Light level is too high

* **BAD:** There's measurable light but the signal-to-noise ratio is bad

* **GOOD:** Good light level

Returns:

  • (String)


53
54
55
# File 'lib/oci/core/models/cross_connect_status.rb', line 53

def light_level_indicator
  @light_level_indicator
end

Class Method Details

.attribute_mapObject

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



56
57
58
59
60
61
62
63
64
65
# File 'lib/oci/core/models/cross_connect_status.rb', line 56

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'cross_connect_id': :'crossConnectId',
    'interface_state': :'interfaceState',
    'light_level_ind_bm': :'lightLevelIndBm',
    'light_level_indicator': :'lightLevelIndicator'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



68
69
70
71
72
73
74
75
76
77
# File 'lib/oci/core/models/cross_connect_status.rb', line 68

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'cross_connect_id': :'String',
    'interface_state': :'String',
    'light_level_ind_bm': :'Float',
    'light_level_indicator': :'String'
    # 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



157
158
159
160
161
162
163
164
# File 'lib/oci/core/models/cross_connect_status.rb', line 157

def ==(other)
  return true if equal?(other)
  self.class == other.class &&
    cross_connect_id == other.cross_connect_id &&
    interface_state == other.interface_state &&
    light_level_ind_bm == other.light_level_ind_bm &&
    light_level_indicator == other.light_level_indicator
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



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/oci/core/models/cross_connect_status.rb', line 189

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


169
170
171
# File 'lib/oci/core/models/cross_connect_status.rb', line 169

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



178
179
180
# File 'lib/oci/core/models/cross_connect_status.rb', line 178

def hash
  [cross_connect_id, interface_state, light_level_ind_bm, light_level_indicator].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



221
222
223
224
225
226
227
228
229
# File 'lib/oci/core/models/cross_connect_status.rb', line 221

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



215
216
217
# File 'lib/oci/core/models/cross_connect_status.rb', line 215

def to_s
  to_hash.to_s
end