Class: OCI::ServiceManagerProxy::Models::ServiceEnvironment

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/service_manager_proxy/models/service_environment.rb

Overview

Detailed information about a service environment.

Note: Service URL formats may vary from the provided example.

Constant Summary collapse

STATUS_ENUM =
[
  STATUS_INITIALIZED = 'INITIALIZED'.freeze,
  STATUS_BEGIN_ACTIVATION = 'BEGIN_ACTIVATION'.freeze,
  STATUS_ACTIVE = 'ACTIVE'.freeze,
  STATUS_BEGIN_SOFT_TERMINATION = 'BEGIN_SOFT_TERMINATION'.freeze,
  STATUS_SOFT_TERMINATED = 'SOFT_TERMINATED'.freeze,
  STATUS_BEGIN_TERMINATION = 'BEGIN_TERMINATION'.freeze,
  STATUS_CANCELED = 'CANCELED'.freeze,
  STATUS_TERMINATED = 'TERMINATED'.freeze,
  STATUS_BEGIN_DISABLING = 'BEGIN_DISABLING'.freeze,
  STATUS_BEGIN_ENABLING = 'BEGIN_ENABLING'.freeze,
  STATUS_BEGIN_MIGRATION = 'BEGIN_MIGRATION'.freeze,
  STATUS_DISABLED = 'DISABLED'.freeze,
  STATUS_BEGIN_SUSPENSION = 'BEGIN_SUSPENSION'.freeze,
  STATUS_BEGIN_RESUMPTION = 'BEGIN_RESUMPTION'.freeze,
  STATUS_SUSPENDED = 'SUSPENDED'.freeze,
  STATUS_BEGIN_LOCK_RELOCATION = 'BEGIN_LOCK_RELOCATION'.freeze,
  STATUS_LOCKED_RELOCATION = 'LOCKED_RELOCATION'.freeze,
  STATUS_BEGIN_RELOCATION = 'BEGIN_RELOCATION'.freeze,
  STATUS_RELOCATED = 'RELOCATED'.freeze,
  STATUS_BEGIN_UNLOCK_RELOCATION = 'BEGIN_UNLOCK_RELOCATION'.freeze,
  STATUS_UNLOCKED_RELOCATION = 'UNLOCKED_RELOCATION'.freeze,
  STATUS_FAILED_LOCK_RELOCATION = 'FAILED_LOCK_RELOCATION'.freeze,
  STATUS_FAILED_ACTIVATION = 'FAILED_ACTIVATION'.freeze,
  STATUS_FAILED_MIGRATION = 'FAILED_MIGRATION'.freeze,
  STATUS_ACCESS_DISABLED = 'ACCESS_DISABLED'.freeze,
  STATUS_BEGIN_DISABLING_ACCESS = 'BEGIN_DISABLING_ACCESS'.freeze,
  STATUS_BEGIN_ENABLING_ACCESS = 'BEGIN_ENABLING_ACCESS'.freeze,
  STATUS_TRA_UNKNOWN = 'TRA_UNKNOWN'.freeze,
  STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ServiceEnvironment

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/oci/service_manager_proxy/models/service_environment.rb', line 123

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

  self.subscription_id = attributes[:'subscriptionId'] if attributes[:'subscriptionId']

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

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

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

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

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

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

  self.service_definition = attributes[:'serviceDefinition'] if attributes[:'serviceDefinition']

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

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

  self.console_url = attributes[:'consoleUrl'] if attributes[:'consoleUrl']

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

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

  self.service_environment_endpoints = attributes[:'serviceEnvironmentEndpoints'] if attributes[:'serviceEnvironmentEndpoints']

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

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

Instance Attribute Details

#compartment_idString

[Required] The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) for the compartment.

Returns:

  • (String)


66
67
68
# File 'lib/oci/service_manager_proxy/models/service_environment.rb', line 66

def compartment_id
  @compartment_id
end

#console_urlString

The URL for the console.

Returns:

  • (String)


74
75
76
# File 'lib/oci/service_manager_proxy/models/service_environment.rb', line 74

def console_url
  @console_url
end

#idString

[Required] Unqiue identifier for the entitlement related to the environment.

Note: Not an [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm).

Returns:

  • (String)


51
52
53
# File 'lib/oci/service_manager_proxy/models/service_environment.rb', line 51

def id
  @id
end

#service_definitionOCI::ServiceManagerProxy::Models::ServiceDefinition

This attribute is required.



70
71
72
# File 'lib/oci/service_manager_proxy/models/service_environment.rb', line 70

def service_definition
  @service_definition
end

#service_environment_endpointsArray<OCI::ServiceManagerProxy::Models::ServiceEnvironmentEndPointOverview>

Array of service environment end points.



78
79
80
# File 'lib/oci/service_manager_proxy/models/service_environment.rb', line 78

def service_environment_endpoints
  @service_environment_endpoints
end

#statusString

[Required] Status of the entitlement registration for the service.

Returns:

  • (String)


62
63
64
# File 'lib/oci/service_manager_proxy/models/service_environment.rb', line 62

def status
  @status
end

#subscription_idString

[Required] The unique subscription ID associated with the service environment ID.

Note: Not an [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm).

Returns:

  • (String)


58
59
60
# File 'lib/oci/service_manager_proxy/models/service_environment.rb', line 58

def subscription_id
  @subscription_id
end

Class Method Details

.attribute_mapObject

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



81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/oci/service_manager_proxy/models/service_environment.rb', line 81

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'subscription_id': :'subscriptionId',
    'status': :'status',
    'compartment_id': :'compartmentId',
    'service_definition': :'serviceDefinition',
    'console_url': :'consoleUrl',
    'service_environment_endpoints': :'serviceEnvironmentEndpoints'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/oci/service_manager_proxy/models/service_environment.rb', line 96

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'subscription_id': :'String',
    'status': :'String',
    'compartment_id': :'String',
    'service_definition': :'OCI::ServiceManagerProxy::Models::ServiceDefinition',
    'console_url': :'String',
    'service_environment_endpoints': :'Array<OCI::ServiceManagerProxy::Models::ServiceEnvironmentEndPointOverview>'
    # 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



184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/oci/service_manager_proxy/models/service_environment.rb', line 184

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

  self.class == other.class &&
    id == other.id &&
    subscription_id == other.subscription_id &&
    status == other.status &&
    compartment_id == other.compartment_id &&
    service_definition == other.service_definition &&
    console_url == other.console_url &&
    service_environment_endpoints == other.service_environment_endpoints
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



220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/oci/service_manager_proxy/models/service_environment.rb', line 220

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


200
201
202
# File 'lib/oci/service_manager_proxy/models/service_environment.rb', line 200

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



209
210
211
# File 'lib/oci/service_manager_proxy/models/service_environment.rb', line 209

def hash
  [id, subscription_id, status, compartment_id, service_definition, console_url, service_environment_endpoints].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



253
254
255
256
257
258
259
260
261
262
# File 'lib/oci/service_manager_proxy/models/service_environment.rb', line 253

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



247
248
249
# File 'lib/oci/service_manager_proxy/models/service_environment.rb', line 247

def to_s
  to_hash.to_s
end