Class: OCI::Core::Models::DrgPromotionStatusResponse

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

Overview

The promotion/unpromotion status of a DRG

Constant Summary collapse

DRG_PROMOTION_STATUS_ENUM =
[
  DRG_PROMOTION_STATUS_UNPROMOTED = 'UNPROMOTED'.freeze,
  DRG_PROMOTION_STATUS_PROMOTING = 'PROMOTING'.freeze,
  DRG_PROMOTION_STATUS_PROMOTED = 'PROMOTED'.freeze,
  DRG_PROMOTION_STATUS_UNPROMOTING = 'UNPROMOTING'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DrgPromotionStatusResponse

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :drg_id (String)

    The value to assign to the #drg_id property

  • :drg_promotion_status (String)

    The value to assign to the #drg_promotion_status property

  • :rpc_promotion_status (Hash<String, String>)

    The value to assign to the #rpc_promotion_status property

  • :vc_promotion_status (Hash<String, String>)

    The value to assign to the #vc_promotion_status property

  • :ipsec_promotion_status (Hash<String, String>)

    The value to assign to the #ipsec_promotion_status property



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
109
110
# File 'lib/oci/core/models/drg_promotion_status_response.rb', line 75

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

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

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

  self.drg_promotion_status = attributes[:'drgPromotionStatus'] if attributes[:'drgPromotionStatus']

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

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

  self.rpc_promotion_status = attributes[:'rpcPromotionStatus'] if attributes[:'rpcPromotionStatus']

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

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

  self.vc_promotion_status = attributes[:'vcPromotionStatus'] if attributes[:'vcPromotionStatus']

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

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

  self.ipsec_promotion_status = attributes[:'ipsecPromotionStatus'] if attributes[:'ipsecPromotionStatus']

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

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

Instance Attribute Details

#drg_idString

[Required] OCID of the DRG

Returns:

  • (String)


20
21
22
# File 'lib/oci/core/models/drg_promotion_status_response.rb', line 20

def drg_id
  @drg_id
end

#drg_promotion_statusString

The promotion status of the DRG

Returns:

  • (String)


24
25
26
# File 'lib/oci/core/models/drg_promotion_status_response.rb', line 24

def drg_promotion_status
  @drg_promotion_status
end

#ipsec_promotion_statusHash<String, String>

A map of the promotion status of each IPSec connection on this DRG -> promo_status

Returns:

  • (Hash<String, String>)


36
37
38
# File 'lib/oci/core/models/drg_promotion_status_response.rb', line 36

def ipsec_promotion_status
  @ipsec_promotion_status
end

#rpc_promotion_statusHash<String, String>

A map of the promotion status of each RPC connection on this DRG -> promo_status

Returns:

  • (Hash<String, String>)


28
29
30
# File 'lib/oci/core/models/drg_promotion_status_response.rb', line 28

def rpc_promotion_status
  @rpc_promotion_status
end

#vc_promotion_statusHash<String, String>

A map of the promotion status of each VC on this DRG -> promo_status

Returns:

  • (Hash<String, String>)


32
33
34
# File 'lib/oci/core/models/drg_promotion_status_response.rb', line 32

def vc_promotion_status
  @vc_promotion_status
end

Class Method Details

.attribute_mapObject

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



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/oci/core/models/drg_promotion_status_response.rb', line 39

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'drg_id': :'drgId',
    'drg_promotion_status': :'drgPromotionStatus',
    'rpc_promotion_status': :'rpcPromotionStatus',
    'vc_promotion_status': :'vcPromotionStatus',
    'ipsec_promotion_status': :'ipsecPromotionStatus'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



52
53
54
55
56
57
58
59
60
61
62
# File 'lib/oci/core/models/drg_promotion_status_response.rb', line 52

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'drg_id': :'String',
    'drg_promotion_status': :'String',
    'rpc_promotion_status': :'Hash<String, String>',
    'vc_promotion_status': :'Hash<String, String>',
    'ipsec_promotion_status': :'Hash<String, 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



127
128
129
130
131
132
133
134
135
136
# File 'lib/oci/core/models/drg_promotion_status_response.rb', line 127

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

  self.class == other.class &&
    drg_id == other.drg_id &&
    drg_promotion_status == other.drg_promotion_status &&
    rpc_promotion_status == other.rpc_promotion_status &&
    vc_promotion_status == other.vc_promotion_status &&
    ipsec_promotion_status == other.ipsec_promotion_status
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



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/oci/core/models/drg_promotion_status_response.rb', line 161

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


141
142
143
# File 'lib/oci/core/models/drg_promotion_status_response.rb', line 141

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



150
151
152
# File 'lib/oci/core/models/drg_promotion_status_response.rb', line 150

def hash
  [drg_id, drg_promotion_status, rpc_promotion_status, vc_promotion_status, ipsec_promotion_status].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



194
195
196
197
198
199
200
201
202
203
# File 'lib/oci/core/models/drg_promotion_status_response.rb', line 194

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



188
189
190
# File 'lib/oci/core/models/drg_promotion_status_response.rb', line 188

def to_s
  to_hash.to_s
end