Class: OCI::Self::Models::ActivateSubscriptionResult

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/self/models/activate_subscription_result.rb

Overview

Response model for the activation of a subscription. Includes the details of the activated subscription.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_INACTIVE = 'INACTIVE'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LIFECYCLE_DETAILS_ENUM =
[
  LIFECYCLE_DETAILS_CREATED = 'CREATED'.freeze,
  LIFECYCLE_DETAILS_PENDING_ACTIVATION = 'PENDING_ACTIVATION'.freeze,
  LIFECYCLE_DETAILS_PROVISIONING_STARTED = 'PROVISIONING_STARTED'.freeze,
  LIFECYCLE_DETAILS_PROVISIONING_COMPLETED = 'PROVISIONING_COMPLETED'.freeze,
  LIFECYCLE_DETAILS_PROVISIONING_FAILED = 'PROVISIONING_FAILED'.freeze,
  LIFECYCLE_DETAILS_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_DETAILS_EXPIRED = 'EXPIRED'.freeze,
  LIFECYCLE_DETAILS_TERMINATED = 'TERMINATED'.freeze,
  LIFECYCLE_DETAILS_FAILED = 'FAILED'.freeze,
  LIFECYCLE_DETAILS_DELETING = 'DELETING'.freeze,
  LIFECYCLE_DETAILS_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_DETAILS_DELETED = 'DELETED'.freeze,
  LIFECYCLE_DETAILS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ActivateSubscriptionResult

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :subscription_id (String)

    The value to assign to the #subscription_id property

  • :display_name (String)

    The value to assign to the #display_name property

  • :time_start (DateTime)

    The value to assign to the #time_start property

  • :time_end (DateTime)

    The value to assign to the #time_end property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :lifecycle_details (String)

    The value to assign to the #lifecycle_details property



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/oci/self/models/activate_subscription_result.rb', line 102

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

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

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

  self.time_start = attributes[:'timeStart'] if attributes[:'timeStart']

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

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

  self.time_end = attributes[:'timeEnd'] if attributes[:'timeEnd']

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

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

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

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

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

  self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']

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

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

Instance Attribute Details

#display_nameString

The subscription name. Must be unique within the compartment. This value can be updated.

Returns:

  • (String)


42
43
44
# File 'lib/oci/self/models/activate_subscription_result.rb', line 42

def display_name
  @display_name
end

#lifecycle_detailsString

A message that describes the current state of the Subscription in more detail. For example, can be used to provide actionable information for a resource in the Failed state.

Returns:

  • (String)


60
61
62
# File 'lib/oci/self/models/activate_subscription_result.rb', line 60

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

The current state of the Subscription.

Returns:

  • (String)


54
55
56
# File 'lib/oci/self/models/activate_subscription_result.rb', line 54

def lifecycle_state
  @lifecycle_state
end

#subscription_idString

[Required] The unique identifier of the activated subscription.

Returns:

  • (String)


38
39
40
# File 'lib/oci/self/models/activate_subscription_result.rb', line 38

def subscription_id
  @subscription_id
end

#time_endDateTime

The end date of the subscription.

Returns:

  • (DateTime)


50
51
52
# File 'lib/oci/self/models/activate_subscription_result.rb', line 50

def time_end
  @time_end
end

#time_startDateTime

The start date of the subscription.

Returns:

  • (DateTime)


46
47
48
# File 'lib/oci/self/models/activate_subscription_result.rb', line 46

def time_start
  @time_start
end

Class Method Details

.attribute_mapObject

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



63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/oci/self/models/activate_subscription_result.rb', line 63

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'subscription_id': :'subscriptionId',
    'display_name': :'displayName',
    'time_start': :'timeStart',
    'time_end': :'timeEnd',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_details': :'lifecycleDetails'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/oci/self/models/activate_subscription_result.rb', line 77

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'subscription_id': :'String',
    'display_name': :'String',
    'time_start': :'DateTime',
    'time_end': :'DateTime',
    'lifecycle_state': :'String',
    'lifecycle_details': :'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



178
179
180
181
182
183
184
185
186
187
188
# File 'lib/oci/self/models/activate_subscription_result.rb', line 178

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

  self.class == other.class &&
    subscription_id == other.subscription_id &&
    display_name == other.display_name &&
    time_start == other.time_start &&
    time_end == other.time_end &&
    lifecycle_state == other.lifecycle_state &&
    lifecycle_details == other.lifecycle_details
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



213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/oci/self/models/activate_subscription_result.rb', line 213

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


193
194
195
# File 'lib/oci/self/models/activate_subscription_result.rb', line 193

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



202
203
204
# File 'lib/oci/self/models/activate_subscription_result.rb', line 202

def hash
  [subscription_id, display_name, time_start, time_end, lifecycle_state, lifecycle_details].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



246
247
248
249
250
251
252
253
254
255
# File 'lib/oci/self/models/activate_subscription_result.rb', line 246

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



240
241
242
# File 'lib/oci/self/models/activate_subscription_result.rb', line 240

def to_s
  to_hash.to_s
end