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):



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
163
# File 'lib/oci/service_manager_proxy/models/service_environment.rb', line 124

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 for the compartment.

Returns:

  • (String)


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

def compartment_id
  @compartment_id
end

#console_urlString

The URL for the console.

Returns:

  • (String)


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

def console_url
  @console_url
end

#idString

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

Note: Not an OCID.

Returns:

  • (String)


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

def id
  @id
end

#service_definitionOCI::ServiceManagerProxy::Models::ServiceDefinition

This attribute is required.



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

def service_definition
  @service_definition
end

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

Array of service environment end points.



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

def service_environment_endpoints
  @service_environment_endpoints
end

#statusString

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

Returns:

  • (String)


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

def status
  @status
end

#subscription_idString

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

Note: Not an OCID.

Returns:

  • (String)


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

def subscription_id
  @subscription_id
end

Class Method Details

.attribute_mapObject

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



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

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.



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

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



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

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



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

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


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

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



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

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



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

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



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

def to_s
  to_hash.to_s
end