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

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

Constant Summary collapse

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

Instance Attribute 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



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/oci/core/models/cross_connect_status.rb', line 53

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

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

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

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

end

Instance Attribute Details

#cross_connect_idString

The OCID of the cross-connect.

Returns:

  • (String)


22
23
24
# File 'lib/oci/core/models/cross_connect_status.rb', line 22

def cross_connect_id
  @cross_connect_id
end

#interface_stateString

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

Returns:

  • (String)


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

def interface_state
  @interface_state
end

#light_level_ind_bmFloat

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

Example: ‘14.0`

Returns:

  • (Float)


33
34
35
# File 'lib/oci/core/models/cross_connect_status.rb', line 33

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)


48
49
50
# File 'lib/oci/core/models/cross_connect_status.rb', line 48

def light_level_indicator
  @light_level_indicator
end

Instance Method Details

#==(other_object) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other_object (Object)

    to be compared



99
100
101
102
103
104
105
106
# File 'lib/oci/core/models/cross_connect_status.rb', line 99

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



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/oci/core/models/cross_connect_status.rb', line 123

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


110
111
112
# File 'lib/oci/core/models/cross_connect_status.rb', line 110

def eql?(other_object)
  self == other_object
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



116
117
118
# File 'lib/oci/core/models/cross_connect_status.rb', line 116

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



148
149
150
151
152
153
154
155
156
# File 'lib/oci/core/models/cross_connect_status.rb', line 148

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



142
143
144
# File 'lib/oci/core/models/cross_connect_status.rb', line 142

def to_s
  to_hash.to_s
end