Class: AdvancedBilling::SubscriptionComponent

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/advanced_billing/models/subscription_component.rb

Overview

SubscriptionComponent Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

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

Constructor Details

#initialize(id: SKIP, name: SKIP, kind: SKIP, unit_name: SKIP, enabled: SKIP, unit_balance: SKIP, currency: SKIP, allocated_quantity: SKIP, pricing_scheme: SKIP, component_id: SKIP, component_handle: SKIP, subscription_id: SKIP, recurring: SKIP, upgrade_charge: SKIP, downgrade_credit: SKIP, archived_at: SKIP, price_point_id: SKIP, price_point_handle: SKIP, price_point_type: SKIP, price_point_name: SKIP, product_family_id: SKIP, product_family_handle: SKIP, created_at: SKIP, updated_at: SKIP, use_site_exchange_rate: SKIP, description: SKIP, allow_fractional_quantities: SKIP, subscription: SKIP, historic_usages: SKIP, display_on_hosted_page: SKIP, interval: SKIP, interval_unit: SKIP, additional_properties: {}) ⇒ SubscriptionComponent

Returns a new instance of SubscriptionComponent.



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
# File 'lib/advanced_billing/models/subscription_component.rb', line 272

def initialize(id: SKIP, name: SKIP, kind: SKIP, unit_name: SKIP,
               enabled: SKIP, unit_balance: SKIP, currency: SKIP,
               allocated_quantity: SKIP, pricing_scheme: SKIP,
               component_id: SKIP, component_handle: SKIP,
               subscription_id: SKIP, recurring: SKIP, upgrade_charge: SKIP,
               downgrade_credit: SKIP, archived_at: SKIP,
               price_point_id: SKIP, price_point_handle: SKIP,
               price_point_type: SKIP, price_point_name: SKIP,
               product_family_id: SKIP, product_family_handle: SKIP,
               created_at: SKIP, updated_at: SKIP,
               use_site_exchange_rate: SKIP, description: SKIP,
               allow_fractional_quantities: SKIP, subscription: SKIP,
               historic_usages: SKIP, display_on_hosted_page: SKIP,
               interval: SKIP, interval_unit: SKIP,
               additional_properties: {})
  # Add additional model properties to the instance.
  additional_properties.each do |_name, _value|
    instance_variable_set("@#{_name}", _value)
  end

  @id = id unless id == SKIP
  @name = name unless name == SKIP
  @kind = kind unless kind == SKIP
  @unit_name = unit_name unless unit_name == SKIP
  @enabled = enabled unless enabled == SKIP
  @unit_balance = unit_balance unless unit_balance == SKIP
  @currency = currency unless currency == SKIP
  @allocated_quantity = allocated_quantity unless allocated_quantity == SKIP
  @pricing_scheme = pricing_scheme unless pricing_scheme == SKIP
  @component_id = component_id unless component_id == SKIP
  @component_handle = component_handle unless component_handle == SKIP
  @subscription_id = subscription_id unless subscription_id == SKIP
  @recurring = recurring unless recurring == SKIP
  @upgrade_charge = upgrade_charge unless upgrade_charge == SKIP
  @downgrade_credit = downgrade_credit unless downgrade_credit == SKIP
  @archived_at = archived_at unless archived_at == SKIP
  @price_point_id = price_point_id unless price_point_id == SKIP
  @price_point_handle = price_point_handle unless price_point_handle == SKIP
  @price_point_type = price_point_type unless price_point_type == SKIP
  @price_point_name = price_point_name unless price_point_name == SKIP
  @product_family_id = product_family_id unless product_family_id == SKIP
  @product_family_handle = product_family_handle unless product_family_handle == SKIP
  @created_at = created_at unless created_at == SKIP
  @updated_at = updated_at unless updated_at == SKIP
  @use_site_exchange_rate = use_site_exchange_rate unless use_site_exchange_rate == SKIP
  @description = description unless description == SKIP
  unless allow_fractional_quantities == SKIP
    @allow_fractional_quantities =
      allow_fractional_quantities
  end
  @subscription = subscription unless subscription == SKIP
  @historic_usages = historic_usages unless historic_usages == SKIP
  @display_on_hosted_page = display_on_hosted_page unless display_on_hosted_page == SKIP
  @interval = interval unless interval == SKIP
  @interval_unit = interval_unit unless interval_unit == SKIP
end

Instance Attribute Details

#allocated_quantityObject

For Quantity-based components: The current allocation for the component on the given subscription. For On/Off components: Use 1 for on. Use 0 for off.

Returns:

  • (Object)


48
49
50
# File 'lib/advanced_billing/models/subscription_component.rb', line 48

def allocated_quantity
  @allocated_quantity
end

#allow_fractional_quantitiesTrueClass | FalseClass

The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.

Returns:

  • (TrueClass | FalseClass)


148
149
150
# File 'lib/advanced_billing/models/subscription_component.rb', line 148

def allow_fractional_quantities
  @allow_fractional_quantities
end

#archived_atDateTime

The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.

Returns:

  • (DateTime)


93
94
95
# File 'lib/advanced_billing/models/subscription_component.rb', line 93

def archived_at
  @archived_at
end

#component_handleString

For Quantity-based components: The current allocation for the component on the given subscription. For On/Off components: Use 1 for on. Use 0 for off.

Returns:

  • (String)


66
67
68
# File 'lib/advanced_billing/models/subscription_component.rb', line 66

def component_handle
  @component_handle
end

#component_idInteger

For Quantity-based components: The current allocation for the component on the given subscription. For On/Off components: Use 1 for on. Use 0 for off.

Returns:

  • (Integer)


60
61
62
# File 'lib/advanced_billing/models/subscription_component.rb', line 60

def component_id
  @component_id
end

#created_atDateTime

The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.

Returns:

  • (DateTime)


128
129
130
# File 'lib/advanced_billing/models/subscription_component.rb', line 128

def created_at
  @created_at
end

#currencyString

(for on/off components) indicates if the component is enabled for the subscription

Returns:

  • (String)


42
43
44
# File 'lib/advanced_billing/models/subscription_component.rb', line 42

def currency
  @currency
end

#descriptionString

The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.

Returns:

  • (String)


143
144
145
# File 'lib/advanced_billing/models/subscription_component.rb', line 143

def description
  @description
end

#display_on_hosted_pageTrueClass | FalseClass

An optional object, will be returned if provided ‘include=subscription` query param.

Returns:

  • (TrueClass | FalseClass)


163
164
165
# File 'lib/advanced_billing/models/subscription_component.rb', line 163

def display_on_hosted_page
  @display_on_hosted_page
end

#downgrade_creditCreditType

The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.

Returns:



88
89
90
# File 'lib/advanced_billing/models/subscription_component.rb', line 88

def downgrade_credit
  @downgrade_credit
end

#enabledTrueClass | FalseClass

(for on/off components) indicates if the component is enabled for the subscription

Returns:

  • (TrueClass | FalseClass)


32
33
34
# File 'lib/advanced_billing/models/subscription_component.rb', line 32

def enabled
  @enabled
end

#historic_usagesArray[HistoricUsage]

An optional object, will be returned if provided ‘include=subscription` query param.

Returns:



158
159
160
# File 'lib/advanced_billing/models/subscription_component.rb', line 158

def historic_usages
  @historic_usages
end

#idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


15
16
17
# File 'lib/advanced_billing/models/subscription_component.rb', line 15

def id
  @id
end

#intervalInteger

The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled.

Returns:

  • (Integer)


170
171
172
# File 'lib/advanced_billing/models/subscription_component.rb', line 170

def interval
  @interval
end

#interval_unitIntervalUnit

A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled.

Returns:



176
177
178
# File 'lib/advanced_billing/models/subscription_component.rb', line 176

def interval_unit
  @interval_unit
end

#kindComponentKind

A handle for the component type

Returns:



23
24
25
# File 'lib/advanced_billing/models/subscription_component.rb', line 23

def kind
  @kind
end

#nameString

TODO: Write general description for this method

Returns:

  • (String)


19
20
21
# File 'lib/advanced_billing/models/subscription_component.rb', line 19

def name
  @name
end

#price_point_handleString

The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.

Returns:

  • (String)


103
104
105
# File 'lib/advanced_billing/models/subscription_component.rb', line 103

def price_point_handle
  @price_point_handle
end

#price_point_idInteger

The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.

Returns:

  • (Integer)


98
99
100
# File 'lib/advanced_billing/models/subscription_component.rb', line 98

def price_point_id
  @price_point_id
end

#price_point_nameString

The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.

Returns:

  • (String)


113
114
115
# File 'lib/advanced_billing/models/subscription_component.rb', line 113

def price_point_name
  @price_point_name
end

#price_point_typePricePointType

The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.

Returns:



108
109
110
# File 'lib/advanced_billing/models/subscription_component.rb', line 108

def price_point_type
  @price_point_type
end

#pricing_schemePricingScheme

For Quantity-based components: The current allocation for the component on the given subscription. For On/Off components: Use 1 for on. Use 0 for off.

Returns:



54
55
56
# File 'lib/advanced_billing/models/subscription_component.rb', line 54

def pricing_scheme
  @pricing_scheme
end

#product_family_handleString

The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.

Returns:

  • (String)


123
124
125
# File 'lib/advanced_billing/models/subscription_component.rb', line 123

def product_family_handle
  @product_family_handle
end

#product_family_idInteger

The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.

Returns:

  • (Integer)


118
119
120
# File 'lib/advanced_billing/models/subscription_component.rb', line 118

def product_family_id
  @product_family_id
end

#recurringTrueClass | FalseClass

For Quantity-based components: The current allocation for the component on the given subscription. For On/Off components: Use 1 for on. Use 0 for off.

Returns:

  • (TrueClass | FalseClass)


78
79
80
# File 'lib/advanced_billing/models/subscription_component.rb', line 78

def recurring
  @recurring
end

#subscriptionSubscriptionComponentSubscription

An optional object, will be returned if provided ‘include=subscription` query param.



153
154
155
# File 'lib/advanced_billing/models/subscription_component.rb', line 153

def subscription
  @subscription
end

#subscription_idInteger

For Quantity-based components: The current allocation for the component on the given subscription. For On/Off components: Use 1 for on. Use 0 for off.

Returns:

  • (Integer)


72
73
74
# File 'lib/advanced_billing/models/subscription_component.rb', line 72

def subscription_id
  @subscription_id
end

#unit_balanceInteger

(for on/off components) indicates if the component is enabled for the subscription

Returns:

  • (Integer)


37
38
39
# File 'lib/advanced_billing/models/subscription_component.rb', line 37

def unit_balance
  @unit_balance
end

#unit_nameString

A handle for the component type

Returns:

  • (String)


27
28
29
# File 'lib/advanced_billing/models/subscription_component.rb', line 27

def unit_name
  @unit_name
end

#updated_atDateTime

The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.

Returns:

  • (DateTime)


133
134
135
# File 'lib/advanced_billing/models/subscription_component.rb', line 133

def updated_at
  @updated_at
end

#upgrade_chargeCreditType

The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.

Returns:



83
84
85
# File 'lib/advanced_billing/models/subscription_component.rb', line 83

def upgrade_charge
  @upgrade_charge
end

#use_site_exchange_rateTrueClass | FalseClass

The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.

Returns:

  • (TrueClass | FalseClass)


138
139
140
# File 'lib/advanced_billing/models/subscription_component.rb', line 138

def use_site_exchange_rate
  @use_site_exchange_rate
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
386
387
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
# File 'lib/advanced_billing/models/subscription_component.rb', line 330

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  kind = hash.key?('kind') ? hash['kind'] : SKIP
  unit_name = hash.key?('unit_name') ? hash['unit_name'] : SKIP
  enabled = hash.key?('enabled') ? hash['enabled'] : SKIP
  unit_balance = hash.key?('unit_balance') ? hash['unit_balance'] : SKIP
  currency = hash.key?('currency') ? hash['currency'] : SKIP
  allocated_quantity = hash.key?('allocated_quantity') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:SubscriptionComponentAllocatedQuantity), hash['allocated_quantity']
  ) : SKIP
  pricing_scheme =
    hash.key?('pricing_scheme') ? hash['pricing_scheme'] : SKIP
  component_id = hash.key?('component_id') ? hash['component_id'] : SKIP
  component_handle =
    hash.key?('component_handle') ? hash['component_handle'] : SKIP
  subscription_id =
    hash.key?('subscription_id') ? hash['subscription_id'] : SKIP
  recurring = hash.key?('recurring') ? hash['recurring'] : SKIP
  upgrade_charge =
    hash.key?('upgrade_charge') ? hash['upgrade_charge'] : SKIP
  downgrade_credit =
    hash.key?('downgrade_credit') ? hash['downgrade_credit'] : SKIP
  archived_at = if hash.key?('archived_at')
                  (DateTimeHelper.from_rfc3339(hash['archived_at']) if hash['archived_at'])
                else
                  SKIP
                end
  price_point_id =
    hash.key?('price_point_id') ? hash['price_point_id'] : SKIP
  price_point_handle =
    hash.key?('price_point_handle') ? hash['price_point_handle'] : SKIP
  price_point_type =
    hash.key?('price_point_type') ? hash['price_point_type'] : SKIP
  price_point_name =
    hash.key?('price_point_name') ? hash['price_point_name'] : SKIP
  product_family_id =
    hash.key?('product_family_id') ? hash['product_family_id'] : SKIP
  product_family_handle =
    hash.key?('product_family_handle') ? hash['product_family_handle'] : SKIP
  created_at = if hash.key?('created_at')
                 (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at'])
               else
                 SKIP
               end
  updated_at = if hash.key?('updated_at')
                 (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at'])
               else
                 SKIP
               end
  use_site_exchange_rate =
    hash.key?('use_site_exchange_rate') ? hash['use_site_exchange_rate'] : SKIP
  description = hash.key?('description') ? hash['description'] : SKIP
  allow_fractional_quantities =
    hash.key?('allow_fractional_quantities') ? hash['allow_fractional_quantities'] : SKIP
  subscription = SubscriptionComponentSubscription.from_hash(hash['subscription']) if
    hash['subscription']
  # Parameter is an array, so we need to iterate through it
  historic_usages = nil
  unless hash['historic_usages'].nil?
    historic_usages = []
    hash['historic_usages'].each do |structure|
      historic_usages << (HistoricUsage.from_hash(structure) if structure)
    end
  end

  historic_usages = SKIP unless hash.key?('historic_usages')
  display_on_hosted_page =
    hash.key?('display_on_hosted_page') ? hash['display_on_hosted_page'] : SKIP
  interval = hash.key?('interval') ? hash['interval'] : SKIP
  interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : SKIP

  # Clean out expected properties from Hash.
  additional_properties = hash.reject { |k, _| names.value?(k) }

  # Create object from extracted values.
  SubscriptionComponent.new(id: id,
                            name: name,
                            kind: kind,
                            unit_name: unit_name,
                            enabled: enabled,
                            unit_balance: unit_balance,
                            currency: currency,
                            allocated_quantity: allocated_quantity,
                            pricing_scheme: pricing_scheme,
                            component_id: component_id,
                            component_handle: component_handle,
                            subscription_id: subscription_id,
                            recurring: recurring,
                            upgrade_charge: upgrade_charge,
                            downgrade_credit: downgrade_credit,
                            archived_at: archived_at,
                            price_point_id: price_point_id,
                            price_point_handle: price_point_handle,
                            price_point_type: price_point_type,
                            price_point_name: price_point_name,
                            product_family_id: product_family_id,
                            product_family_handle: product_family_handle,
                            created_at: created_at,
                            updated_at: updated_at,
                            use_site_exchange_rate: use_site_exchange_rate,
                            description: description,
                            allow_fractional_quantities: allow_fractional_quantities,
                            subscription: subscription,
                            historic_usages: historic_usages,
                            display_on_hosted_page: display_on_hosted_page,
                            interval: interval,
                            interval_unit: interval_unit,
                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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
# File 'lib/advanced_billing/models/subscription_component.rb', line 179

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['name'] = 'name'
  @_hash['kind'] = 'kind'
  @_hash['unit_name'] = 'unit_name'
  @_hash['enabled'] = 'enabled'
  @_hash['unit_balance'] = 'unit_balance'
  @_hash['currency'] = 'currency'
  @_hash['allocated_quantity'] = 'allocated_quantity'
  @_hash['pricing_scheme'] = 'pricing_scheme'
  @_hash['component_id'] = 'component_id'
  @_hash['component_handle'] = 'component_handle'
  @_hash['subscription_id'] = 'subscription_id'
  @_hash['recurring'] = 'recurring'
  @_hash['upgrade_charge'] = 'upgrade_charge'
  @_hash['downgrade_credit'] = 'downgrade_credit'
  @_hash['archived_at'] = 'archived_at'
  @_hash['price_point_id'] = 'price_point_id'
  @_hash['price_point_handle'] = 'price_point_handle'
  @_hash['price_point_type'] = 'price_point_type'
  @_hash['price_point_name'] = 'price_point_name'
  @_hash['product_family_id'] = 'product_family_id'
  @_hash['product_family_handle'] = 'product_family_handle'
  @_hash['created_at'] = 'created_at'
  @_hash['updated_at'] = 'updated_at'
  @_hash['use_site_exchange_rate'] = 'use_site_exchange_rate'
  @_hash['description'] = 'description'
  @_hash['allow_fractional_quantities'] = 'allow_fractional_quantities'
  @_hash['subscription'] = 'subscription'
  @_hash['historic_usages'] = 'historic_usages'
  @_hash['display_on_hosted_page'] = 'display_on_hosted_page'
  @_hash['interval'] = 'interval'
  @_hash['interval_unit'] = 'interval_unit'
  @_hash
end

.nullablesObject

An array for nullable fields



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/advanced_billing/models/subscription_component.rb', line 255

def self.nullables
  %w[
    pricing_scheme
    component_handle
    upgrade_charge
    downgrade_credit
    archived_at
    price_point_id
    price_point_handle
    price_point_type
    price_point_name
    use_site_exchange_rate
    description
    interval_unit
  ]
end

.optionalsObject

An array for optional fields



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/advanced_billing/models/subscription_component.rb', line 217

def self.optionals
  %w[
    id
    name
    kind
    unit_name
    enabled
    unit_balance
    currency
    allocated_quantity
    pricing_scheme
    component_id
    component_handle
    subscription_id
    recurring
    upgrade_charge
    downgrade_credit
    archived_at
    price_point_id
    price_point_handle
    price_point_type
    price_point_name
    product_family_id
    product_family_handle
    created_at
    updated_at
    use_site_exchange_rate
    description
    allow_fractional_quantities
    subscription
    historic_usages
    display_on_hosted_page
    interval
    interval_unit
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



458
459
460
461
462
463
464
# File 'lib/advanced_billing/models/subscription_component.rb', line 458

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
# File 'lib/advanced_billing/models/subscription_component.rb', line 487

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}, kind: #{@kind.inspect},"\
  " unit_name: #{@unit_name.inspect}, enabled: #{@enabled.inspect}, unit_balance:"\
  " #{@unit_balance.inspect}, currency: #{@currency.inspect}, allocated_quantity:"\
  " #{@allocated_quantity.inspect}, pricing_scheme: #{@pricing_scheme.inspect}, component_id:"\
  " #{@component_id.inspect}, component_handle: #{@component_handle.inspect}, subscription_id:"\
  " #{@subscription_id.inspect}, recurring: #{@recurring.inspect}, upgrade_charge:"\
  " #{@upgrade_charge.inspect}, downgrade_credit: #{@downgrade_credit.inspect}, archived_at:"\
  " #{@archived_at.inspect}, price_point_id: #{@price_point_id.inspect}, price_point_handle:"\
  " #{@price_point_handle.inspect}, price_point_type: #{@price_point_type.inspect},"\
  " price_point_name: #{@price_point_name.inspect}, product_family_id:"\
  " #{@product_family_id.inspect}, product_family_handle: #{@product_family_handle.inspect},"\
  " created_at: #{@created_at.inspect}, updated_at: #{@updated_at.inspect},"\
  " use_site_exchange_rate: #{@use_site_exchange_rate.inspect}, description:"\
  " #{@description.inspect}, allow_fractional_quantities:"\
  " #{@allow_fractional_quantities.inspect}, subscription: #{@subscription.inspect},"\
  " historic_usages: #{@historic_usages.inspect}, display_on_hosted_page:"\
  " #{@display_on_hosted_page.inspect}, interval: #{@interval.inspect}, interval_unit:"\
  " #{@interval_unit.inspect}, additional_properties: #{get_additional_properties}>"
end

#to_custom_archived_atObject



444
445
446
# File 'lib/advanced_billing/models/subscription_component.rb', line 444

def to_custom_archived_at
  DateTimeHelper.to_rfc3339(archived_at)
end

#to_custom_created_atObject



448
449
450
# File 'lib/advanced_billing/models/subscription_component.rb', line 448

def to_custom_created_at
  DateTimeHelper.to_rfc3339(created_at)
end

#to_custom_updated_atObject



452
453
454
# File 'lib/advanced_billing/models/subscription_component.rb', line 452

def to_custom_updated_at
  DateTimeHelper.to_rfc3339(updated_at)
end

#to_sObject

Provides a human-readable string representation of the object.



467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
# File 'lib/advanced_billing/models/subscription_component.rb', line 467

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, name: #{@name}, kind: #{@kind}, unit_name: #{@unit_name},"\
  " enabled: #{@enabled}, unit_balance: #{@unit_balance}, currency: #{@currency},"\
  " allocated_quantity: #{@allocated_quantity}, pricing_scheme: #{@pricing_scheme},"\
  " component_id: #{@component_id}, component_handle: #{@component_handle}, subscription_id:"\
  " #{@subscription_id}, recurring: #{@recurring}, upgrade_charge: #{@upgrade_charge},"\
  " downgrade_credit: #{@downgrade_credit}, archived_at: #{@archived_at}, price_point_id:"\
  " #{@price_point_id}, price_point_handle: #{@price_point_handle}, price_point_type:"\
  " #{@price_point_type}, price_point_name: #{@price_point_name}, product_family_id:"\
  " #{@product_family_id}, product_family_handle: #{@product_family_handle}, created_at:"\
  " #{@created_at}, updated_at: #{@updated_at}, use_site_exchange_rate:"\
  " #{@use_site_exchange_rate}, description: #{@description}, allow_fractional_quantities:"\
  " #{@allow_fractional_quantities}, subscription: #{@subscription}, historic_usages:"\
  " #{@historic_usages}, display_on_hosted_page: #{@display_on_hosted_page}, interval:"\
  " #{@interval}, interval_unit: #{@interval_unit}, additional_properties:"\
  " #{get_additional_properties}>"
end