Class: ApiReference::NewSubscription

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/api_reference/models/new_subscription.rb

Overview

NewSubscription Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(usage_customer_ids: SKIP, filter: SKIP, metadata: SKIP, plan_id: SKIP, external_plan_id: SKIP, price_overrides: SKIP, per_credit_overage_amount: SKIP, credits_overage_rate: SKIP, trial_duration_days: SKIP, net_terms: SKIP, auto_collection: SKIP, auto_issuance: SKIP, default_invoice_memo: SKIP, coupon_redemption_code: SKIP, invoicing_threshold: SKIP, initial_phase_order: SKIP, add_prices: SKIP, remove_prices: SKIP, replace_prices: SKIP, add_adjustments: SKIP, remove_adjustments: SKIP, replace_adjustments: SKIP, customer_id: SKIP, external_customer_id: SKIP, currency: SKIP, name: SKIP, start_date: SKIP, end_date: SKIP, plan_version_number: SKIP, external_marketplace: SKIP, external_marketplace_reporting_id: SKIP, aws_region: SKIP, align_billing_with_subscription_start_date: false, billing_cycle_anchor_configuration: SKIP) ⇒ NewSubscription

Returns a new instance of NewSubscription.



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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
# File 'lib/api_reference/models/new_subscription.rb', line 323

def initialize(usage_customer_ids: SKIP, filter: SKIP, metadata: SKIP,
               plan_id: SKIP, external_plan_id: SKIP, price_overrides: SKIP,
               per_credit_overage_amount: SKIP, credits_overage_rate: SKIP,
               trial_duration_days: SKIP, net_terms: SKIP,
               auto_collection: SKIP, auto_issuance: SKIP,
               default_invoice_memo: SKIP, coupon_redemption_code: SKIP,
               invoicing_threshold: SKIP, initial_phase_order: SKIP,
               add_prices: SKIP, remove_prices: SKIP, replace_prices: SKIP,
               add_adjustments: SKIP, remove_adjustments: SKIP,
               replace_adjustments: SKIP, customer_id: SKIP,
               external_customer_id: SKIP, currency: SKIP, name: SKIP,
               start_date: SKIP, end_date: SKIP, plan_version_number: SKIP,
               external_marketplace: SKIP,
               external_marketplace_reporting_id: SKIP, aws_region: SKIP,
               align_billing_with_subscription_start_date: false,
               billing_cycle_anchor_configuration: SKIP)
  @usage_customer_ids = usage_customer_ids unless usage_customer_ids == SKIP
  @filter = filter unless filter == SKIP
  @metadata =  unless  == SKIP
  @plan_id = plan_id unless plan_id == SKIP
  @external_plan_id = external_plan_id unless external_plan_id == SKIP
  @price_overrides = price_overrides unless price_overrides == SKIP
  unless per_credit_overage_amount == SKIP
    @per_credit_overage_amount =
      per_credit_overage_amount
  end
  @credits_overage_rate = credits_overage_rate unless credits_overage_rate == SKIP
  @trial_duration_days = trial_duration_days unless trial_duration_days == SKIP
  @net_terms = net_terms unless net_terms == SKIP
  @auto_collection = auto_collection unless auto_collection == SKIP
  @auto_issuance = auto_issuance unless auto_issuance == SKIP
  @default_invoice_memo = default_invoice_memo unless default_invoice_memo == SKIP
  @coupon_redemption_code = coupon_redemption_code unless coupon_redemption_code == SKIP
  @invoicing_threshold = invoicing_threshold unless invoicing_threshold == SKIP
  @initial_phase_order = initial_phase_order unless initial_phase_order == SKIP
  @add_prices = add_prices unless add_prices == SKIP
  @remove_prices = remove_prices unless remove_prices == SKIP
  @replace_prices = replace_prices unless replace_prices == SKIP
  @add_adjustments = add_adjustments unless add_adjustments == SKIP
  @remove_adjustments = remove_adjustments unless remove_adjustments == SKIP
  @replace_adjustments = replace_adjustments unless replace_adjustments == SKIP
  @customer_id = customer_id unless customer_id == SKIP
  @external_customer_id = external_customer_id unless external_customer_id == SKIP
  @currency = currency unless currency == SKIP
  @name = name unless name == SKIP
  @start_date = start_date unless start_date == SKIP
  @end_date = end_date unless end_date == SKIP
  @plan_version_number = plan_version_number unless plan_version_number == SKIP
  @external_marketplace = external_marketplace unless external_marketplace == SKIP
  unless external_marketplace_reporting_id == SKIP
    @external_marketplace_reporting_id =
      external_marketplace_reporting_id
  end
  @aws_region = aws_region unless aws_region == SKIP
  unless align_billing_with_subscription_start_date == SKIP
    @align_billing_with_subscription_start_date =
      align_billing_with_subscription_start_date
  end
  unless billing_cycle_anchor_configuration == SKIP
    @billing_cycle_anchor_configuration =
      billing_cycle_anchor_configuration
  end
end

Instance Attribute Details

#add_adjustmentsArray[AddSubscriptionAdjustmentParams]

Additional adjustments to be added to the subscription. (Only available for accounts that have migrated off of legacy subscription overrides)



126
127
128
# File 'lib/api_reference/models/new_subscription.rb', line 126

def add_adjustments
  @add_adjustments
end

#add_pricesArray[AddSubscriptionPriceParams]

Additional prices to be added to the subscription. (Only available for accounts that have migrated off of legacy subscription overrides)

Returns:



110
111
112
# File 'lib/api_reference/models/new_subscription.rb', line 110

def add_prices
  @add_prices
end

#align_billing_with_subscription_start_dateTrueClass | FalseClass

Specifies which version of the plan to subscribe to. If null, the default version will be used.

Returns:

  • (TrueClass | FalseClass)


194
195
196
# File 'lib/api_reference/models/new_subscription.rb', line 194

def align_billing_with_subscription_start_date
  @align_billing_with_subscription_start_date
end

#auto_collectionTrueClass | FalseClass

Determines whether issued invoices for this subscription will automatically be charged with the saved payment method on the due date. If not specified, this defaults to the behavior configured for this customer.

Returns:

  • (TrueClass | FalseClass)


76
77
78
# File 'lib/api_reference/models/new_subscription.rb', line 76

def auto_collection
  @auto_collection
end

#auto_issuanceTrueClass | FalseClass

Used to determine if invoices for this subscription will be automatically issued. If true, invoices will be automatically issued. If false, invoices will require manual approval. If null is specified, this defaults to the behavior configured for this customer.

Returns:

  • (TrueClass | FalseClass)


83
84
85
# File 'lib/api_reference/models/new_subscription.rb', line 83

def auto_issuance
  @auto_issuance
end

#aws_regionString

Specifies which version of the plan to subscribe to. If null, the default version will be used.

Returns:

  • (String)


189
190
191
# File 'lib/api_reference/models/new_subscription.rb', line 189

def aws_region
  @aws_region
end

#billing_cycle_anchor_configurationBillingCycleAnchorConfiguration

Specifies which version of the plan to subscribe to. If null, the default version will be used.



199
200
201
# File 'lib/api_reference/models/new_subscription.rb', line 199

def billing_cycle_anchor_configuration
  @billing_cycle_anchor_configuration
end

#coupon_redemption_codeString

Redemption code to be used for this subscription. If the coupon cannot be found by its redemption code, or cannot be redeemed, an error response will be returned and the subscription creation or plan change will not be scheduled.

Returns:

  • (String)


95
96
97
# File 'lib/api_reference/models/new_subscription.rb', line 95

def coupon_redemption_code
  @coupon_redemption_code
end

#credits_overage_rateFloat

Optionally provide a list of overrides for prices on the plan

Returns:

  • (Float)


57
58
59
# File 'lib/api_reference/models/new_subscription.rb', line 57

def credits_overage_rate
  @credits_overage_rate
end

#currencyString

The currency to use for the subscription. If not specified, the invoicing currency for the plan will be used.

Returns:

  • (String)


154
155
156
# File 'lib/api_reference/models/new_subscription.rb', line 154

def currency
  @currency
end

#customer_idString

Plan adjustments to be replaced with additional adjustments on the subscription. (Only available for accounts that have migrated off of legacy subscription overrides)

Returns:

  • (String)


143
144
145
# File 'lib/api_reference/models/new_subscription.rb', line 143

def customer_id
  @customer_id
end

#default_invoice_memoString

Determines the default memo on this subscription's invoices. Note that if this is not provided, it is determined by the plan configuration.

Returns:

  • (String)


88
89
90
# File 'lib/api_reference/models/new_subscription.rb', line 88

def default_invoice_memo
  @default_invoice_memo
end

#end_dateDateTime

The name to use for the subscription. If not specified, the plan name will be used.

Returns:

  • (DateTime)


169
170
171
# File 'lib/api_reference/models/new_subscription.rb', line 169

def end_date
  @end_date
end

#external_customer_idString

Plan adjustments to be replaced with additional adjustments on the subscription. (Only available for accounts that have migrated off of legacy subscription overrides)

Returns:

  • (String)


149
150
151
# File 'lib/api_reference/models/new_subscription.rb', line 149

def external_customer_id
  @external_customer_id
end

#external_marketplaceExternalMarketplace

Specifies which version of the plan to subscribe to. If null, the default version will be used.

Returns:



179
180
181
# File 'lib/api_reference/models/new_subscription.rb', line 179

def external_marketplace
  @external_marketplace
end

#external_marketplace_reporting_idString

Specifies which version of the plan to subscribe to. If null, the default version will be used.

Returns:

  • (String)


184
185
186
# File 'lib/api_reference/models/new_subscription.rb', line 184

def external_marketplace_reporting_id
  @external_marketplace_reporting_id
end

#external_plan_idString

The external_plan_id of the plan that the given subscription should be switched to. Note that either this property or plan_id must be specified.

Returns:

  • (String)


45
46
47
# File 'lib/api_reference/models/new_subscription.rb', line 45

def external_plan_id
  @external_plan_id
end

#filterString

An additional filter to apply to usage queries. This filter must be expressed as a boolean computed property. If null, usage queries will not include any additional filter.

Returns:

  • (String)


28
29
30
# File 'lib/api_reference/models/new_subscription.rb', line 28

def filter
  @filter
end

#initial_phase_orderInteger

The phase of the plan to start with

Returns:

  • (Integer)


105
106
107
# File 'lib/api_reference/models/new_subscription.rb', line 105

def initial_phase_order
  @initial_phase_order
end

#invoicing_thresholdString

When this subscription's accrued usage reaches this threshold, an invoice will be issued for the subscription. If not specified, invoices will only be issued at the end of the billing period.

Returns:

  • (String)


101
102
103
# File 'lib/api_reference/models/new_subscription.rb', line 101

def invoicing_threshold
  @invoicing_threshold
end

#metadataHash[String, String]

User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.

Returns:

  • (Hash[String, String])


34
35
36
# File 'lib/api_reference/models/new_subscription.rb', line 34

def 
  @metadata
end

#nameString

The name to use for the subscription. If not specified, the plan name will be used.

Returns:

  • (String)


159
160
161
# File 'lib/api_reference/models/new_subscription.rb', line 159

def name
  @name
end

#net_termsInteger

The net terms determines the difference between the invoice date and the issue date for the invoice. If you intend the invoice to be due on issue, set this to 0. If not provided, this defaults to the value specified in the plan.

Returns:

  • (Integer)


70
71
72
# File 'lib/api_reference/models/new_subscription.rb', line 70

def net_terms
  @net_terms
end

#per_credit_overage_amountFloat

Optionally provide a list of overrides for prices on the plan

Returns:

  • (Float)


53
54
55
# File 'lib/api_reference/models/new_subscription.rb', line 53

def per_credit_overage_amount
  @per_credit_overage_amount
end

#plan_idString

The plan that the given subscription should be switched to. Note that either this property or external_plan_id must be specified.

Returns:

  • (String)


39
40
41
# File 'lib/api_reference/models/new_subscription.rb', line 39

def plan_id
  @plan_id
end

#plan_version_numberInteger

Specifies which version of the plan to subscribe to. If null, the default version will be used.

Returns:

  • (Integer)


174
175
176
# File 'lib/api_reference/models/new_subscription.rb', line 174

def plan_version_number
  @plan_version_number
end

#price_overridesArray[Object]

Optionally provide a list of overrides for prices on the plan

Returns:

  • (Array[Object])


49
50
51
# File 'lib/api_reference/models/new_subscription.rb', line 49

def price_overrides
  @price_overrides
end

#remove_adjustmentsArray[RemoveSubscriptionAdjustmentParams]

Plan adjustments to be removed from the subscription. (Only available for accounts that have migrated off of legacy subscription overrides)



131
132
133
# File 'lib/api_reference/models/new_subscription.rb', line 131

def remove_adjustments
  @remove_adjustments
end

#remove_pricesArray[RemoveSubscriptionPriceParams]

Plan prices to be removed from the subscription. (Only available for accounts that have migrated off of legacy subscription overrides)

Returns:



115
116
117
# File 'lib/api_reference/models/new_subscription.rb', line 115

def remove_prices
  @remove_prices
end

#replace_adjustmentsArray[ReplaceSubscriptionAdjustmentParams]

Plan adjustments to be replaced with additional adjustments on the subscription. (Only available for accounts that have migrated off of legacy subscription overrides)



137
138
139
# File 'lib/api_reference/models/new_subscription.rb', line 137

def replace_adjustments
  @replace_adjustments
end

#replace_pricesArray[ReplaceSubscriptionPriceParams]

Plan prices to be replaced with additional prices on the subscription. (Only available for accounts that have migrated off of legacy subscription overrides)

Returns:



121
122
123
# File 'lib/api_reference/models/new_subscription.rb', line 121

def replace_prices
  @replace_prices
end

#start_dateDateTime

The name to use for the subscription. If not specified, the plan name will be used.

Returns:

  • (DateTime)


164
165
166
# File 'lib/api_reference/models/new_subscription.rb', line 164

def start_date
  @start_date
end

#trial_duration_daysInteger

The duration of the trial period in days. If not provided, this defaults to the value specified in the plan. If 0 is provided, the trial on the plan will be skipped.

Returns:

  • (Integer)


63
64
65
# File 'lib/api_reference/models/new_subscription.rb', line 63

def trial_duration_days
  @trial_duration_days
end

#usage_customer_idsArray[String]

A list of customer IDs whose usage events will be aggregated and billed under this subscription. By default, a subscription only considers usage events associated with its attached customer's customer_id. When usage_customer_ids is provided, the subscription includes usage events from the specified customers only. Provided usage_customer_ids must be either the customer for this subscription itself, or any of that customer's children.

Returns:

  • (Array[String])


21
22
23
# File 'lib/api_reference/models/new_subscription.rb', line 21

def usage_customer_ids
  @usage_customer_ids
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
# File 'lib/api_reference/models/new_subscription.rb', line 388

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  usage_customer_ids =
    hash.key?('usage_customer_ids') ? hash['usage_customer_ids'] : SKIP
  filter = hash.key?('filter') ? hash['filter'] : SKIP
   = hash.key?('metadata') ? hash['metadata'] : SKIP
  plan_id = hash.key?('plan_id') ? hash['plan_id'] : SKIP
  external_plan_id =
    hash.key?('external_plan_id') ? hash['external_plan_id'] : SKIP
  price_overrides =
    hash.key?('price_overrides') ? hash['price_overrides'] : SKIP
  per_credit_overage_amount =
    hash.key?('per_credit_overage_amount') ? hash['per_credit_overage_amount'] : SKIP
  credits_overage_rate =
    hash.key?('credits_overage_rate') ? hash['credits_overage_rate'] : SKIP
  trial_duration_days =
    hash.key?('trial_duration_days') ? hash['trial_duration_days'] : SKIP
  net_terms = hash.key?('net_terms') ? hash['net_terms'] : SKIP
  auto_collection =
    hash.key?('auto_collection') ? hash['auto_collection'] : SKIP
  auto_issuance = hash.key?('auto_issuance') ? hash['auto_issuance'] : SKIP
  default_invoice_memo =
    hash.key?('default_invoice_memo') ? hash['default_invoice_memo'] : SKIP
  coupon_redemption_code =
    hash.key?('coupon_redemption_code') ? hash['coupon_redemption_code'] : SKIP
  invoicing_threshold =
    hash.key?('invoicing_threshold') ? hash['invoicing_threshold'] : SKIP
  initial_phase_order =
    hash.key?('initial_phase_order') ? hash['initial_phase_order'] : SKIP
  # Parameter is an array, so we need to iterate through it
  add_prices = nil
  unless hash['add_prices'].nil?
    add_prices = []
    hash['add_prices'].each do |structure|
      add_prices << (AddSubscriptionPriceParams.from_hash(structure) if structure)
    end
  end

  add_prices = SKIP unless hash.key?('add_prices')
  # Parameter is an array, so we need to iterate through it
  remove_prices = nil
  unless hash['remove_prices'].nil?
    remove_prices = []
    hash['remove_prices'].each do |structure|
      remove_prices << (RemoveSubscriptionPriceParams.from_hash(structure) if structure)
    end
  end

  remove_prices = SKIP unless hash.key?('remove_prices')
  # Parameter is an array, so we need to iterate through it
  replace_prices = nil
  unless hash['replace_prices'].nil?
    replace_prices = []
    hash['replace_prices'].each do |structure|
      replace_prices << (ReplaceSubscriptionPriceParams.from_hash(structure) if structure)
    end
  end

  replace_prices = SKIP unless hash.key?('replace_prices')
  # Parameter is an array, so we need to iterate through it
  add_adjustments = nil
  unless hash['add_adjustments'].nil?
    add_adjustments = []
    hash['add_adjustments'].each do |structure|
      add_adjustments << (AddSubscriptionAdjustmentParams.from_hash(structure) if structure)
    end
  end

  add_adjustments = SKIP unless hash.key?('add_adjustments')
  # Parameter is an array, so we need to iterate through it
  remove_adjustments = nil
  unless hash['remove_adjustments'].nil?
    remove_adjustments = []
    hash['remove_adjustments'].each do |structure|
      remove_adjustments << (RemoveSubscriptionAdjustmentParams.from_hash(structure) if structure)
    end
  end

  remove_adjustments = SKIP unless hash.key?('remove_adjustments')
  # Parameter is an array, so we need to iterate through it
  replace_adjustments = nil
  unless hash['replace_adjustments'].nil?
    replace_adjustments = []
    hash['replace_adjustments'].each do |structure|
      replace_adjustments << (ReplaceSubscriptionAdjustmentParams.from_hash(structure) if structure)
    end
  end

  replace_adjustments = SKIP unless hash.key?('replace_adjustments')
  customer_id = hash.key?('customer_id') ? hash['customer_id'] : SKIP
  external_customer_id =
    hash.key?('external_customer_id') ? hash['external_customer_id'] : SKIP
  currency = hash.key?('currency') ? hash['currency'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  start_date = if hash.key?('start_date')
                 (DateTimeHelper.from_rfc3339(hash['start_date']) if hash['start_date'])
               else
                 SKIP
               end
  end_date = if hash.key?('end_date')
               (DateTimeHelper.from_rfc3339(hash['end_date']) if hash['end_date'])
             else
               SKIP
             end
  plan_version_number =
    hash.key?('plan_version_number') ? hash['plan_version_number'] : SKIP
  external_marketplace =
    hash.key?('external_marketplace') ? hash['external_marketplace'] : SKIP
  external_marketplace_reporting_id =
    hash.key?('external_marketplace_reporting_id') ? hash['external_marketplace_reporting_id'] : SKIP
  aws_region = hash.key?('aws_region') ? hash['aws_region'] : SKIP
  align_billing_with_subscription_start_date =
    hash['align_billing_with_subscription_start_date'] ||= false
  if hash['billing_cycle_anchor_configuration']
    billing_cycle_anchor_configuration = BillingCycleAnchorConfiguration.from_hash(hash['billing_cycle_anchor_configuration'])
  end

  # Create object from extracted values.
  NewSubscription.new(usage_customer_ids: usage_customer_ids,
                      filter: filter,
                      metadata: ,
                      plan_id: plan_id,
                      external_plan_id: external_plan_id,
                      price_overrides: price_overrides,
                      per_credit_overage_amount: per_credit_overage_amount,
                      credits_overage_rate: credits_overage_rate,
                      trial_duration_days: trial_duration_days,
                      net_terms: net_terms,
                      auto_collection: auto_collection,
                      auto_issuance: auto_issuance,
                      default_invoice_memo: default_invoice_memo,
                      coupon_redemption_code: coupon_redemption_code,
                      invoicing_threshold: invoicing_threshold,
                      initial_phase_order: initial_phase_order,
                      add_prices: add_prices,
                      remove_prices: remove_prices,
                      replace_prices: replace_prices,
                      add_adjustments: add_adjustments,
                      remove_adjustments: remove_adjustments,
                      replace_adjustments: replace_adjustments,
                      customer_id: customer_id,
                      external_customer_id: external_customer_id,
                      currency: currency,
                      name: name,
                      start_date: start_date,
                      end_date: end_date,
                      plan_version_number: plan_version_number,
                      external_marketplace: external_marketplace,
                      external_marketplace_reporting_id: external_marketplace_reporting_id,
                      aws_region: aws_region,
                      align_billing_with_subscription_start_date: align_billing_with_subscription_start_date,
                      billing_cycle_anchor_configuration: billing_cycle_anchor_configuration)
end

.namesObject

A mapping from model property names to API property names.



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
# File 'lib/api_reference/models/new_subscription.rb', line 202

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['usage_customer_ids'] = 'usage_customer_ids'
  @_hash['filter'] = 'filter'
  @_hash['metadata'] = 'metadata'
  @_hash['plan_id'] = 'plan_id'
  @_hash['external_plan_id'] = 'external_plan_id'
  @_hash['price_overrides'] = 'price_overrides'
  @_hash['per_credit_overage_amount'] = 'per_credit_overage_amount'
  @_hash['credits_overage_rate'] = 'credits_overage_rate'
  @_hash['trial_duration_days'] = 'trial_duration_days'
  @_hash['net_terms'] = 'net_terms'
  @_hash['auto_collection'] = 'auto_collection'
  @_hash['auto_issuance'] = 'auto_issuance'
  @_hash['default_invoice_memo'] = 'default_invoice_memo'
  @_hash['coupon_redemption_code'] = 'coupon_redemption_code'
  @_hash['invoicing_threshold'] = 'invoicing_threshold'
  @_hash['initial_phase_order'] = 'initial_phase_order'
  @_hash['add_prices'] = 'add_prices'
  @_hash['remove_prices'] = 'remove_prices'
  @_hash['replace_prices'] = 'replace_prices'
  @_hash['add_adjustments'] = 'add_adjustments'
  @_hash['remove_adjustments'] = 'remove_adjustments'
  @_hash['replace_adjustments'] = 'replace_adjustments'
  @_hash['customer_id'] = 'customer_id'
  @_hash['external_customer_id'] = 'external_customer_id'
  @_hash['currency'] = 'currency'
  @_hash['name'] = 'name'
  @_hash['start_date'] = 'start_date'
  @_hash['end_date'] = 'end_date'
  @_hash['plan_version_number'] = 'plan_version_number'
  @_hash['external_marketplace'] = 'external_marketplace'
  @_hash['external_marketplace_reporting_id'] =
    'external_marketplace_reporting_id'
  @_hash['aws_region'] = 'aws_region'
  @_hash['align_billing_with_subscription_start_date'] =
    'align_billing_with_subscription_start_date'
  @_hash['billing_cycle_anchor_configuration'] =
    'billing_cycle_anchor_configuration'
  @_hash
end

.nullablesObject

An array for nullable fields



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
# File 'lib/api_reference/models/new_subscription.rb', line 285

def self.nullables
  %w[
    usage_customer_ids
    filter
    metadata
    plan_id
    external_plan_id
    price_overrides
    per_credit_overage_amount
    credits_overage_rate
    trial_duration_days
    net_terms
    auto_collection
    auto_issuance
    default_invoice_memo
    coupon_redemption_code
    invoicing_threshold
    initial_phase_order
    add_prices
    remove_prices
    replace_prices
    add_adjustments
    remove_adjustments
    replace_adjustments
    customer_id
    external_customer_id
    currency
    name
    start_date
    end_date
    plan_version_number
    external_marketplace
    external_marketplace_reporting_id
    aws_region
    billing_cycle_anchor_configuration
  ]
end

.optionalsObject

An array for optional fields



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
# File 'lib/api_reference/models/new_subscription.rb', line 245

def self.optionals
  %w[
    usage_customer_ids
    filter
    metadata
    plan_id
    external_plan_id
    price_overrides
    per_credit_overage_amount
    credits_overage_rate
    trial_duration_days
    net_terms
    auto_collection
    auto_issuance
    default_invoice_memo
    coupon_redemption_code
    invoicing_threshold
    initial_phase_order
    add_prices
    remove_prices
    replace_prices
    add_adjustments
    remove_adjustments
    replace_adjustments
    customer_id
    external_customer_id
    currency
    name
    start_date
    end_date
    plan_version_number
    external_marketplace
    external_marketplace_reporting_id
    aws_region
    align_billing_with_subscription_start_date
    billing_cycle_anchor_configuration
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
# File 'lib/api_reference/models/new_subscription.rb', line 577

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} usage_customer_ids: #{@usage_customer_ids.inspect}, filter:"\
  " #{@filter.inspect}, metadata: #{@metadata.inspect}, plan_id: #{@plan_id.inspect},"\
  " external_plan_id: #{@external_plan_id.inspect}, price_overrides:"\
  " #{@price_overrides.inspect}, per_credit_overage_amount:"\
  " #{@per_credit_overage_amount.inspect}, credits_overage_rate:"\
  " #{@credits_overage_rate.inspect}, trial_duration_days: #{@trial_duration_days.inspect},"\
  " net_terms: #{@net_terms.inspect}, auto_collection: #{@auto_collection.inspect},"\
  " auto_issuance: #{@auto_issuance.inspect}, default_invoice_memo:"\
  " #{@default_invoice_memo.inspect}, coupon_redemption_code:"\
  " #{@coupon_redemption_code.inspect}, invoicing_threshold: #{@invoicing_threshold.inspect},"\
  " initial_phase_order: #{@initial_phase_order.inspect}, add_prices: #{@add_prices.inspect},"\
  " remove_prices: #{@remove_prices.inspect}, replace_prices: #{@replace_prices.inspect},"\
  " add_adjustments: #{@add_adjustments.inspect}, remove_adjustments:"\
  " #{@remove_adjustments.inspect}, replace_adjustments: #{@replace_adjustments.inspect},"\
  " customer_id: #{@customer_id.inspect}, external_customer_id:"\
  " #{@external_customer_id.inspect}, currency: #{@currency.inspect}, name: #{@name.inspect},"\
  " start_date: #{@start_date.inspect}, end_date: #{@end_date.inspect}, plan_version_number:"\
  " #{@plan_version_number.inspect}, external_marketplace: #{@external_marketplace.inspect},"\
  " external_marketplace_reporting_id: #{@external_marketplace_reporting_id.inspect},"\
  " aws_region: #{@aws_region.inspect}, align_billing_with_subscription_start_date:"\
  " #{@align_billing_with_subscription_start_date.inspect},"\
  " billing_cycle_anchor_configuration: #{@billing_cycle_anchor_configuration.inspect}>"
end

#to_custom_end_dateObject



548
549
550
# File 'lib/api_reference/models/new_subscription.rb', line 548

def to_custom_end_date
  DateTimeHelper.to_rfc3339(end_date)
end

#to_custom_start_dateObject



544
545
546
# File 'lib/api_reference/models/new_subscription.rb', line 544

def to_custom_start_date
  DateTimeHelper.to_rfc3339(start_date)
end

#to_sObject

Provides a human-readable string representation of the object.



553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
# File 'lib/api_reference/models/new_subscription.rb', line 553

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} usage_customer_ids: #{@usage_customer_ids}, filter: #{@filter}, metadata:"\
  " #{@metadata}, plan_id: #{@plan_id}, external_plan_id: #{@external_plan_id},"\
  " price_overrides: #{@price_overrides}, per_credit_overage_amount:"\
  " #{@per_credit_overage_amount}, credits_overage_rate: #{@credits_overage_rate},"\
  " trial_duration_days: #{@trial_duration_days}, net_terms: #{@net_terms}, auto_collection:"\
  " #{@auto_collection}, auto_issuance: #{@auto_issuance}, default_invoice_memo:"\
  " #{@default_invoice_memo}, coupon_redemption_code: #{@coupon_redemption_code},"\
  " invoicing_threshold: #{@invoicing_threshold}, initial_phase_order:"\
  " #{@initial_phase_order}, add_prices: #{@add_prices}, remove_prices: #{@remove_prices},"\
  " replace_prices: #{@replace_prices}, add_adjustments: #{@add_adjustments},"\
  " remove_adjustments: #{@remove_adjustments}, replace_adjustments: #{@replace_adjustments},"\
  " customer_id: #{@customer_id}, external_customer_id: #{@external_customer_id}, currency:"\
  " #{@currency}, name: #{@name}, start_date: #{@start_date}, end_date: #{@end_date},"\
  " plan_version_number: #{@plan_version_number}, external_marketplace:"\
  " #{@external_marketplace}, external_marketplace_reporting_id:"\
  " #{@external_marketplace_reporting_id}, aws_region: #{@aws_region},"\
  ' align_billing_with_subscription_start_date:'\
  " #{@align_billing_with_subscription_start_date}, billing_cycle_anchor_configuration:"\
  " #{@billing_cycle_anchor_configuration}>"
end