Class: OCI::Self::Models::PartnerSubscription

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

Overview

These api for partner to communicate to OCI.

Constant Summary collapse

SOURCE_TYPE_ENUM =
[
  SOURCE_TYPE_OCI_NATIVE = 'OCI_NATIVE'.freeze,
  SOURCE_TYPE_THIRD_PARTY = 'THIRD_PARTY'.freeze,
  SOURCE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
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 = {}) ⇒ PartnerSubscription

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/oci/self/models/partner_subscription.rb', line 169

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

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

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

  self.source_type = attributes[:'sourceType'] if attributes[:'sourceType']

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

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

  self.product_id = attributes[:'productId'] if attributes[:'productId']

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

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

  self.is_auto_renew = attributes[:'isAutoRenew'] unless attributes[:'isAutoRenew'].nil?

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

  self.is_auto_renew = attributes[:'is_auto_renew'] unless attributes[:'is_auto_renew'].nil?

  self.additional_details = attributes[:'additionalDetails'] if attributes[:'additionalDetails']

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

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

  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']

  self.time_started = attributes[:'timeStarted'] if attributes[:'timeStarted']

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

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

  self.time_ended = attributes[:'timeEnded'] if attributes[:'timeEnded']

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

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

  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']

  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']
end

Instance Attribute Details

#additional_detailsArray<OCI::Self::Models::ExtendedMetadata>

Additional details that are specific for this subscription such as activation details.



68
69
70
# File 'lib/oci/self/models/partner_subscription.rb', line 68

def additional_details
  @additional_details
end

#display_nameString

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

Returns:

  • (String)


49
50
51
# File 'lib/oci/self/models/partner_subscription.rb', line 49

def display_name
  @display_name
end

#is_auto_renewBOOLEAN

Whether subscription should be auto-renewed at the end of cycle.

Returns:

  • (BOOLEAN)


64
65
66
# File 'lib/oci/self/models/partner_subscription.rb', line 64

def is_auto_renew
  @is_auto_renew
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)


78
79
80
# File 'lib/oci/self/models/partner_subscription.rb', line 78

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

The current state of the Subscription.

Returns:

  • (String)


72
73
74
# File 'lib/oci/self/models/partner_subscription.rb', line 72

def lifecycle_state
  @lifecycle_state
end

#pricing_planOCI::Self::Models::PricingPlan



52
53
54
# File 'lib/oci/self/models/partner_subscription.rb', line 52

def pricing_plan
  @pricing_plan
end

#product_idString

The unique OCID of the product, effectively functioning as the listing ID.

Returns:

  • (String)


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

def product_id
  @product_id
end

#source_typeString

The type of seller in SELF Service.

Returns:

  • (String)


56
57
58
# File 'lib/oci/self/models/partner_subscription.rb', line 56

def source_type
  @source_type
end

#subscription_idString

[Required] The unique identifier of the Subscription.

Returns:

  • (String)


45
46
47
# File 'lib/oci/self/models/partner_subscription.rb', line 45

def subscription_id
  @subscription_id
end

#time_createdDateTime

The date and time the Subscription was created, in the format defined by RFC 3339.

Example: 2016-08-25T21:10:29.600Z

Returns:

  • (DateTime)


99
100
101
# File 'lib/oci/self/models/partner_subscription.rb', line 99

def time_created
  @time_created
end

#time_endedDateTime

The date and time the Subscription was ended, in the format defined by RFC 3339.

Example: 2016-08-25T21:10:29.600Z

Returns:

  • (DateTime)


92
93
94
# File 'lib/oci/self/models/partner_subscription.rb', line 92

def time_ended
  @time_ended
end

#time_startedDateTime

The date and time the Subscription was started, in the format defined by RFC 3339.

Example: 2016-08-25T21:10:29.600Z

Returns:

  • (DateTime)


85
86
87
# File 'lib/oci/self/models/partner_subscription.rb', line 85

def time_started
  @time_started
end

#time_updatedDateTime

The date and time the Subscription was updated, in the format defined by RFC 3339.

Example: 2016-08-25T21:10:29.600Z

Returns:

  • (DateTime)


106
107
108
# File 'lib/oci/self/models/partner_subscription.rb', line 106

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/oci/self/models/partner_subscription.rb', line 109

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'subscription_id': :'subscriptionId',
    'display_name': :'displayName',
    'pricing_plan': :'pricingPlan',
    'source_type': :'sourceType',
    'product_id': :'productId',
    'is_auto_renew': :'isAutoRenew',
    'additional_details': :'additionalDetails',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_details': :'lifecycleDetails',
    'time_started': :'timeStarted',
    'time_ended': :'timeEnded',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/oci/self/models/partner_subscription.rb', line 130

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'subscription_id': :'String',
    'display_name': :'String',
    'pricing_plan': :'OCI::Self::Models::PricingPlan',
    'source_type': :'String',
    'product_id': :'String',
    'is_auto_renew': :'BOOLEAN',
    'additional_details': :'Array<OCI::Self::Models::ExtendedMetadata>',
    'lifecycle_state': :'String',
    'lifecycle_details': :'String',
    'time_started': :'DateTime',
    'time_ended': :'DateTime',
    'time_created': :'DateTime',
    'time_updated': :'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



300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/oci/self/models/partner_subscription.rb', line 300

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

  self.class == other.class &&
    subscription_id == other.subscription_id &&
    display_name == other.display_name &&
    pricing_plan == other.pricing_plan &&
    source_type == other.source_type &&
    product_id == other.product_id &&
    is_auto_renew == other.is_auto_renew &&
    additional_details == other.additional_details &&
    lifecycle_state == other.lifecycle_state &&
    lifecycle_details == other.lifecycle_details &&
    time_started == other.time_started &&
    time_ended == other.time_ended &&
    time_created == other.time_created &&
    time_updated == other.time_updated
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



342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# File 'lib/oci/self/models/partner_subscription.rb', line 342

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


322
323
324
# File 'lib/oci/self/models/partner_subscription.rb', line 322

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



331
332
333
# File 'lib/oci/self/models/partner_subscription.rb', line 331

def hash
  [subscription_id, display_name, pricing_plan, source_type, product_id, is_auto_renew, additional_details, lifecycle_state, lifecycle_details, time_started, time_ended, time_created, time_updated].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



375
376
377
378
379
380
381
382
383
384
# File 'lib/oci/self/models/partner_subscription.rb', line 375

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



369
370
371
# File 'lib/oci/self/models/partner_subscription.rb', line 369

def to_s
  to_hash.to_s
end