Class: TenantManagerControlPlane::Models::SubscriptionSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/tenant_manager_control_plane/models/subscription_summary.rb

Overview

Summary of subscription.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_INACTIVE = 'INACTIVE'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SubscriptionSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :classic_subscription_id (String)

    The value to assign to the #classic_subscription_id property

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :service_name (String)

    The value to assign to the #service_name property

  • :is_classic_subscription (BOOLEAN)

    The value to assign to the #is_classic_subscription property

  • :payment_model (String)

    The value to assign to the #payment_model property

  • :region_assignment (String)

    The value to assign to the #region_assignment property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :start_date (DateTime)

    The value to assign to the #start_date property

  • :end_date (DateTime)

    The value to assign to the #end_date property

  • :time_updated (DateTime)

    The value to assign to the #time_updated property

  • :time_created (DateTime)

    The value to assign to the #time_created property



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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 128

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

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

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

  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_name = attributes[:'serviceName'] if attributes[:'serviceName']

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

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

  self.is_classic_subscription = attributes[:'isClassicSubscription'] unless attributes[:'isClassicSubscription'].nil?
  self.is_classic_subscription = false if is_classic_subscription.nil? && !attributes.key?(:'isClassicSubscription') # rubocop:disable Style/StringLiterals

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

  self.is_classic_subscription = attributes[:'is_classic_subscription'] unless attributes[:'is_classic_subscription'].nil?
  self.is_classic_subscription = false if is_classic_subscription.nil? && !attributes.key?(:'isClassicSubscription') && !attributes.key?(:'is_classic_subscription') # rubocop:disable Style/StringLiterals

  self.payment_model = attributes[:'paymentModel'] if attributes[:'paymentModel']

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

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

  self.region_assignment = attributes[:'regionAssignment'] if attributes[:'regionAssignment']

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

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

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

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

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

  self.end_date = attributes[:'endDate'] if attributes[:'endDate']

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

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

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

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

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

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

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

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

Instance Attribute Details

#classic_subscription_idString

**[Required]** Classic subscription ID.

Returns:

  • (String)


28
29
30
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 28

def classic_subscription_id
  @classic_subscription_id
end

#compartment_idString

**[Required]** OCID of the compartment. Always a tenancy OCID.

Returns:

  • (String)


32
33
34
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 32

def compartment_id
  @compartment_id
end

#end_dateDateTime

Subscription end time.

Returns:

  • (DateTime)


60
61
62
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 60

def end_date
  @end_date
end

#idString

**[Required]** OCID of the subscription details for a particular root compartment or tenancy.

Returns:

  • (String)


24
25
26
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 24

def id
  @id
end

#is_classic_subscriptionBOOLEAN

Denotes if the subscription is from classic systems or not.

Returns:

  • (BOOLEAN)


40
41
42
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 40

def is_classic_subscription
  @is_classic_subscription
end

#lifecycle_stateString

Lifecycle state of the subscription.

Returns:

  • (String)


52
53
54
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 52

def lifecycle_state
  @lifecycle_state
end

#payment_modelString

The pay model of the subscription, such as 'Pay as you go' or 'Monthly'.

Returns:

  • (String)


44
45
46
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 44

def payment_model
  @payment_model
end

#region_assignmentString

Region for the subscription.

Returns:

  • (String)


48
49
50
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 48

def region_assignment
  @region_assignment
end

#service_nameString

**[Required]** The type of subscription, such as 'CLOUDCM', 'SAAS', 'ERP', or 'CRM'.

Returns:

  • (String)


36
37
38
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 36

def service_name
  @service_name
end

#start_dateDateTime

Subscription start time.

Returns:

  • (DateTime)


56
57
58
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 56

def start_date
  @start_date
end

#time_createdDateTime

Date-time when subscription is created.

Returns:

  • (DateTime)


68
69
70
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 68

def time_created
  @time_created
end

#time_updatedDateTime

Date-time when subscription is updated.

Returns:

  • (DateTime)


64
65
66
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 64

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 71

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'classic_subscription_id': :'classicSubscriptionId',
    'compartment_id': :'compartmentId',
    'service_name': :'serviceName',
    'is_classic_subscription': :'isClassicSubscription',
    'payment_model': :'paymentModel',
    'region_assignment': :'regionAssignment',
    'lifecycle_state': :'lifecycleState',
    'start_date': :'startDate',
    'end_date': :'endDate',
    'time_updated': :'timeUpdated',
    'time_created': :'timeCreated'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 91

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'classic_subscription_id': :'String',
    'compartment_id': :'String',
    'service_name': :'String',
    'is_classic_subscription': :'BOOLEAN',
    'payment_model': :'String',
    'region_assignment': :'String',
    'lifecycle_state': :'String',
    'start_date': :'DateTime',
    'end_date': :'DateTime',
    'time_updated': :'DateTime',
    'time_created': :'DateTime'
    # 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



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 225

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

  self.class == other.class &&
    id == other.id &&
    classic_subscription_id == other.classic_subscription_id &&
    compartment_id == other.compartment_id &&
    service_name == other.service_name &&
    is_classic_subscription == other.is_classic_subscription &&
    payment_model == other.payment_model &&
    region_assignment == other.region_assignment &&
    lifecycle_state == other.lifecycle_state &&
    start_date == other.start_date &&
    end_date == other.end_date &&
    time_updated == other.time_updated &&
    time_created == other.time_created
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



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 266

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


246
247
248
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 246

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



255
256
257
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 255

def hash
  [id, classic_subscription_id, compartment_id, service_name, is_classic_subscription, payment_model, region_assignment, lifecycle_state, start_date, end_date, time_updated, time_created].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



299
300
301
302
303
304
305
306
307
308
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 299

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



293
294
295
# File 'lib/oci/tenant_manager_control_plane/models/subscription_summary.rb', line 293

def to_s
  to_hash.to_s
end