Class: OCI::Onesubscription::Models::SubscriptionSubscribedService

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/onesubscription/models/subscription_subscribed_service.rb

Overview

Subscribed Service summary

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SubscriptionSubscribedService

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 233

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

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

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

  self.operation_type = attributes[:'operationType'] if attributes[:'operationType']

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

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

  self.net_unit_price = attributes[:'netUnitPrice'] if attributes[:'netUnitPrice']

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

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

  self.used_amount = attributes[:'usedAmount'] if attributes[:'usedAmount']

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

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

  self.available_amount = attributes[:'availableAmount'] if attributes[:'availableAmount']

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

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

  self.funded_allocation_value = attributes[:'fundedAllocationValue'] if attributes[:'fundedAllocationValue']

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

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

  self.partner_transaction_type = attributes[:'partnerTransactionType'] if attributes[:'partnerTransactionType']

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

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

  self.term_value = attributes[:'termValue'] if attributes[:'termValue']

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

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

  self.term_value_uom = attributes[:'termValueUom'] if attributes[:'termValueUom']

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

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

  self.booking_opty_number = attributes[:'bookingOptyNumber'] if attributes[:'bookingOptyNumber']

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

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

  self.total_value = attributes[:'totalValue'] if attributes[:'totalValue']

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

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

  self.original_promo_amount = attributes[:'originalPromoAmount'] if attributes[:'originalPromoAmount']

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

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

  self.order_number = attributes[:'orderNumber'] if attributes[:'orderNumber']

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

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

  self.data_center_region = attributes[:'dataCenterRegion'] if attributes[:'dataCenterRegion']

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

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

  self.pricing_model = attributes[:'pricingModel'] if attributes[:'pricingModel']

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

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

  self.program_type = attributes[:'programType'] if attributes[:'programType']

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

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

  self.promo_type = attributes[:'promoType'] if attributes[:'promoType']

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

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

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

  self.is_intent_to_pay = attributes[:'isIntentToPay'] unless attributes[:'isIntentToPay'].nil?

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

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

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

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

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

Instance Attribute Details

#available_amountString

Subscribed sercice available or remaining amount

Returns:

  • (String)


48
49
50
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 48

def available_amount
  @available_amount
end

#booking_opty_numberString

Booking Opportunity Number of Subscribed Service

Returns:

  • (String)


74
75
76
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 74

def booking_opty_number
  @booking_opty_number
end

#commitment_servicesArray<OCI::Onesubscription::Models::CommitmentService>

List of Commitment services of a line



134
135
136
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 134

def commitment_services
  @commitment_services
end

#csiInteger

Subscribed service CSI number

Returns:

  • (Integer)


114
115
116
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 114

def csi
  @csi
end

#data_center_regionString

Subscribed service data center region

Returns:

  • (String)


94
95
96
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 94

def data_center_region
  @data_center_region
end

#funded_allocation_valueString

Funded Allocation line value example: 12000.00

Returns:

  • (String)


54
55
56
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 54

def funded_allocation_value
  @funded_allocation_value
end

#idString

[Required] SPM internal Subscribed Service ID

Returns:

  • (String)


15
16
17
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 15

def id
  @id
end

#is_intent_to_payBOOLEAN

Subscribed service intent to pay flag

Returns:

  • (BOOLEAN)


119
120
121
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 119

def is_intent_to_pay
  @is_intent_to_pay
end

#net_unit_priceString

Subscribed service net unit price

Returns:

  • (String)


38
39
40
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 38

def net_unit_price
  @net_unit_price
end

#operation_typeString

Subscribed service operation type

Returns:

  • (String)


33
34
35
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 33

def operation_type
  @operation_type
end

#order_numberInteger

Sales Order Number associated to the subscribed service

Returns:

  • (Integer)


89
90
91
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 89

def order_number
  @order_number
end

#original_promo_amountString

Subscribed service Promotion Amount

Returns:

  • (String)


84
85
86
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 84

def original_promo_amount
  @original_promo_amount
end

#partner_transaction_typeString

This field contains the name of the partner to which the subscription belongs - depending on which the invoicing may differ

Returns:

  • (String)


59
60
61
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 59

def partner_transaction_type
  @partner_transaction_type
end

#pricing_modelString

Subscribed service pricing model

Returns:

  • (String)


99
100
101
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 99

def pricing_model
  @pricing_model
end

#productOCI::Onesubscription::Models::SubscriptionProduct



18
19
20
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 18

def product
  @product
end

#program_typeString

Subscribed service program type

Returns:

  • (String)


104
105
106
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 104

def program_type
  @program_type
end

#promo_typeString

Subscribed service promotion type

Returns:

  • (String)


109
110
111
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 109

def promo_type
  @promo_type
end

#quantityString

Subscribed service quantity

Returns:

  • (String)


23
24
25
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 23

def quantity
  @quantity
end

#statusString

Subscribed service status

Returns:

  • (String)


28
29
30
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 28

def status
  @status
end

#term_valueInteger

Term value in Months

Returns:

  • (Integer)


64
65
66
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 64

def term_value
  @term_value
end

#term_value_uomString

Term value UOM

Returns:

  • (String)


69
70
71
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 69

def term_value_uom
  @term_value_uom
end

#time_endDateTime

Subscribed service end date

Returns:

  • (DateTime)


129
130
131
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 129

def time_end
  @time_end
end

#time_startDateTime

Subscribed service start date

Returns:

  • (DateTime)


124
125
126
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 124

def time_start
  @time_start
end

#total_valueString

Subscribed service total value

Returns:

  • (String)


79
80
81
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 79

def total_value
  @total_value
end

#used_amountString

Subscribed service used amount

Returns:

  • (String)


43
44
45
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 43

def used_amount
  @used_amount
end

Class Method Details

.attribute_mapObject

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



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
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 137

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'product': :'product',
    'quantity': :'quantity',
    'status': :'status',
    'operation_type': :'operationType',
    'net_unit_price': :'netUnitPrice',
    'used_amount': :'usedAmount',
    'available_amount': :'availableAmount',
    'funded_allocation_value': :'fundedAllocationValue',
    'partner_transaction_type': :'partnerTransactionType',
    'term_value': :'termValue',
    'term_value_uom': :'termValueUom',
    'booking_opty_number': :'bookingOptyNumber',
    'total_value': :'totalValue',
    'original_promo_amount': :'originalPromoAmount',
    'order_number': :'orderNumber',
    'data_center_region': :'dataCenterRegion',
    'pricing_model': :'pricingModel',
    'program_type': :'programType',
    'promo_type': :'promoType',
    'csi': :'csi',
    'is_intent_to_pay': :'isIntentToPay',
    'time_start': :'timeStart',
    'time_end': :'timeEnd',
    'commitment_services': :'commitmentServices'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 170

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'product': :'OCI::Onesubscription::Models::SubscriptionProduct',
    'quantity': :'String',
    'status': :'String',
    'operation_type': :'String',
    'net_unit_price': :'String',
    'used_amount': :'String',
    'available_amount': :'String',
    'funded_allocation_value': :'String',
    'partner_transaction_type': :'String',
    'term_value': :'Integer',
    'term_value_uom': :'String',
    'booking_opty_number': :'String',
    'total_value': :'String',
    'original_promo_amount': :'String',
    'order_number': :'Integer',
    'data_center_region': :'String',
    'pricing_model': :'String',
    'program_type': :'String',
    'promo_type': :'String',
    'csi': :'Integer',
    'is_intent_to_pay': :'BOOLEAN',
    'time_start': :'DateTime',
    'time_end': :'DateTime',
    'commitment_services': :'Array<OCI::Onesubscription::Models::CommitmentService>'
    # 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



377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 377

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

  self.class == other.class &&
    id == other.id &&
    product == other.product &&
    quantity == other.quantity &&
    status == other.status &&
    operation_type == other.operation_type &&
    net_unit_price == other.net_unit_price &&
    used_amount == other.used_amount &&
    available_amount == other.available_amount &&
    funded_allocation_value == other.funded_allocation_value &&
    partner_transaction_type == other.partner_transaction_type &&
    term_value == other.term_value &&
    term_value_uom == other.term_value_uom &&
    booking_opty_number == other.booking_opty_number &&
    total_value == other.total_value &&
    original_promo_amount == other.original_promo_amount &&
    order_number == other.order_number &&
    data_center_region == other.data_center_region &&
    pricing_model == other.pricing_model &&
    program_type == other.program_type &&
    promo_type == other.promo_type &&
    csi == other.csi &&
    is_intent_to_pay == other.is_intent_to_pay &&
    time_start == other.time_start &&
    time_end == other.time_end &&
    commitment_services == other.commitment_services
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



431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 431

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


411
412
413
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 411

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



420
421
422
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 420

def hash
  [id, product, quantity, status, operation_type, net_unit_price, used_amount, available_amount, funded_allocation_value, partner_transaction_type, term_value, term_value_uom, booking_opty_number, total_value, original_promo_amount, order_number, data_center_region, pricing_model, program_type, promo_type, csi, is_intent_to_pay, time_start, time_end, commitment_services].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



464
465
466
467
468
469
470
471
472
473
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 464

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



458
459
460
# File 'lib/oci/onesubscription/models/subscription_subscribed_service.rb', line 458

def to_s
  to_hash.to_s
end