Class: BillForward::ProductRatePlan

Inherits:
Object
  • Object
show all
Defined in:
lib/bf_ruby2/models/product_rate_plan.rb

Overview

A rate plan describes a pricing system under which a subscription can be made to a product.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ProductRatePlan

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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/bf_ruby2/models/product_rate_plan.rb', line 224

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}

  if attributes.has_key?(:'created')
    self.created = attributes[:'created']
  end

  if attributes.has_key?(:'changedBy')
    self.changed_by = attributes[:'changedBy']
  end

  if attributes.has_key?(:'updated')
    self.updated = attributes[:'updated']
  end

  if attributes.has_key?(:'metadata')
    self. = attributes[:'metadata']
  end

  if attributes.has_key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.has_key?(:'crmID')
    self.crm_id = attributes[:'crmID']
  end

  if attributes.has_key?(:'productID')
    self.product_id = attributes[:'productID']
  end

  if attributes.has_key?(:'currency')
    self.currency = attributes[:'currency']
  end

  if attributes.has_key?(:'taxStatus')
    self.tax_status = attributes[:'taxStatus']
  end

  if attributes.has_key?(:'failedPaymentBehaviour')
    self.failed_payment_behaviour = attributes[:'failedPaymentBehaviour']
  end

  if attributes.has_key?(:'duration')
    self.duration = attributes[:'duration']
  end

  if attributes.has_key?(:'durationPeriod')
    self.duration_period = attributes[:'durationPeriod']
  end

  if attributes.has_key?(:'trial')
    self.trial = attributes[:'trial']
  end

  if attributes.has_key?(:'trialPeriod')
    self.trial_period = attributes[:'trialPeriod']
  end

  if attributes.has_key?(:'productType')
    self.product_type = attributes[:'productType']
  end

  if attributes.has_key?(:'proRataMode')
    self.pro_rata_mode = attributes[:'proRataMode']
  end

  if attributes.has_key?(:'createZeroValuedInvoices')
    self.create_zero_valued_invoices = attributes[:'createZeroValuedInvoices']
  else
    self.create_zero_valued_invoices = false
  end

  if attributes.has_key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.has_key?(:'publicName')
    self.public_name = attributes[:'publicName']
  end

  if attributes.has_key?(:'validFrom')
    self.valid_from = attributes[:'validFrom']
  end

  if attributes.has_key?(:'validTill')
    self.valid_till = attributes[:'validTill']
  end

  if attributes.has_key?(:'status')
    self.status = attributes[:'status']
  end

  if attributes.has_key?(:'migrationBehaviour')
    self.migration_behaviour = attributes[:'migrationBehaviour']
  end

  if attributes.has_key?(:'invoiceIssueType')
    self.invoice_issue_type = attributes[:'invoiceIssueType']
  end

  if attributes.has_key?(:'issueDuration')
    self.issue_duration = attributes[:'issueDuration']
  end

  if attributes.has_key?(:'issuePeriod')
    self.issue_period = attributes[:'issuePeriod']
  end

  if attributes.has_key?(:'taxation')
    if (value = attributes[:'taxation']).is_a?(Array)
      self.taxation = value
    end
  end

  if attributes.has_key?(:'fixedTermDefinitions')
    if (value = attributes[:'fixedTermDefinitions']).is_a?(Array)
      self.fixed_term_definitions = value
    end
  end

  if attributes.has_key?(:'product')
    self.product = attributes[:'product']
  end

  if attributes.has_key?(:'pricingComponents')
    if (value = attributes[:'pricingComponents']).is_a?(Array)
      self.pricing_components = value
    end
  end

  if attributes.has_key?(:'aggregatingComponents')
    if (value = attributes[:'aggregatingComponents']).is_a?(Array)
      self.aggregating_components = value
    end
  end

  if attributes.has_key?(:'paymentTerms')
    self.payment_terms = attributes[:'paymentTerms']
  end

end

Instance Attribute Details

#aggregating_componentsObject

list)","description":"List of AggregatingComponents — these describe pricing components whose prices should be recalculated upon invoice aggregation. For example: two subscriptions’ individual consumptions may be neither of them large enough to achieve bulk-buy discounts. When aggregated, though, the same two subscriptions’ consumption may add up to a quantity which does merit a bulk buy discount within your tiering system.“,”verbs“:



120
121
122
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 120

def aggregating_components
  @aggregating_components
end

#changed_byObject

{ "description" : "ID of the user who last updated the entity.", "verbs":[] }



33
34
35
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 33

def changed_by
  @changed_by
end

#create_zero_valued_invoicesObject

{"default":"true","description":"Whether invoices are created if they have a zero valued cost before any discounts are applied.“,”verbs“: }



78
79
80
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 78

def create_zero_valued_invoices
  @create_zero_valued_invoices
end

#createdObject

{ "description" : "The UTC DateTime when the object was created.", "verbs":[] }



30
31
32
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 30

def created
  @created
end

#crm_idObject

ID of the rate plan.“,”verbs“:



45
46
47
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 45

def crm_id
  @crm_id
end

#currencyObject

currency of the product-rate-plan — as specified by a three-character ISO 4217 currency code (i.e. USD).“,”verbs“:



51
52
53
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 51

def currency
  @currency
end

#durationObject

of length-measures which constitute the rate plan’s period. If left unspecified: the rate plan will use the same duration number as the Product to which it belongs.“,”verbs“:



60
61
62
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 60

def duration
  @duration
end

#duration_periodObject

describing the magnitude of the rate plan’s period. If left unspecified: the rate plan will use the same durationPeriod magnitude as the Product to which it belongs.“,”verbs“:



63
64
65
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 63

def duration_period
  @duration_period
end

#failed_payment_behaviourObject

action that should be taken, should an invoice for some subscription to this rate plan remain unpaid despite the dunning period’s being exceeded.
<span class=\"label label-default\">CancelSubscription</span> &mdash; Demotes the subscription to the Failed state as soon as the dunning period is exceeded.
<span class=\"label label-default\">None</span> &mdash; The subscription is allowed to continue in the AwaitingPayment state indefinitely even if the dunning period is exceeded.For slow payment cycles &mdash; or when manual invoice remediation is common &mdash; <span class=\"label label-default\">None</span> is recommended.
In a heavily-automated SaaS environment, automatic cancellation via <span class=\"label label-default\">CancelSubscription</span> is recommended.“,”verbs“:



57
58
59
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 57

def failed_payment_behaviour
  @failed_payment_behaviour
end

#fixed_term_definitionsObject

list linking \"Fixed-Term Definitions\" to the rate plan.“,”verbs“:



111
112
113
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 111

def fixed_term_definitions
  @fixed_term_definitions
end

#idObject

uniquely identifying this rate plan.“,”verbs“:



42
43
44
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 42

def id
  @id
end

#invoice_issue_typeObject

class=\"label label-default\">Immediate</span>","description":"The strategy for how invoices for this plan will be issued.
<span class=\"label label-default\">Immediate</span> &mdash; All generated invoices move immediately to the ‘Unpaid’ state &mdash; beginning the payment pursuit process.
<span class=\"label label-default\">Delayed</span> &mdash; All generated invoices begin in the ‘Pending’ state. An ‘Issue Invoice’ amendment is scheduled (based on the rate plan’s issueDuration and issuePeriod) that will move the invoice to the ‘Unpaid’ state (beginning the payment pursuit process) in accordance with the rate plan’s issuance schedule.
<span class=\"label label-default\">Manual</span> &mdash; All generated invoices sit in the ‘Pending’ state &mdash; they will not be issued to the customer unless explicit action is taken. This gives you an opportunity to review or recalculate the invoice.“verbs”:



99
100
101
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 99

def invoice_issue_type
  @invoice_issue_type
end

#issue_durationObject

of issue-length-measures between issuance of invoices for this rate plan.“”verbs“:



102
103
104
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 102

def issue_duration
  @issue_duration
end

#issue_periodObject

describing the magnitude of the invoice issuance period.“,”verbs“:



105
106
107
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 105

def issue_period
  @issue_period
end

#metadataObject

{ "description" : "Add metadata.", "verbs“: }



39
40
41
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 39

def 
  
end

#migration_behaviourObject

action that should be taken, should the pro-rata calculation result in a negative value.
<span class=\"label label-default\">NoCharge</span> &mdash; Don’t return to the customer any money.
<span class=\"label label-default\">CreditAccount</span> &mdash; Credit the customer’s account with the amount.“,”verbs“:



96
97
98
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 96

def migration_behaviour
  @migration_behaviour
end

#nameObject

friendly name &mdash; for your benefit &mdash; used to identify this rate plan within some product in BillForward. The name should reflect the fact that this rate plan provides to the customer a price tiering system within which a subscription to its Product can be made.
The rate plan’s name could describe the nature of its price tiering (e.g. \"Default pricing\", \"Student pricing\").
Remember also that rate plans can override the timing prescribed by their product. If your rate plan is defined by its overriding the default timing of its product, then that can be reflected in that rate plan’s name. (e.g. \"Student pricing - Annual").“,”verbs“:



81
82
83
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 81

def name
  @name
end

#payment_termsObject

Returns the value of attribute payment_terms.



122
123
124
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 122

def payment_terms
  @payment_terms
end

#pricing_componentsObject

pricing-components which describe the price tiering system of this rate plan. A product rate plan may have 1 or more pricing components. Each pricing component represents a different charge associated with the subscription. Pricing components are versioned.“,”verbs“:



117
118
119
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 117

def pricing_components
  @pricing_components
end

#pro_rata_modeObject

pro-rata mode for the rate plan.
<span class=\"label label-default\">None</span> &mdash; The pro-rata cost for upgrades will be ignored.
<span class=\"label label-default\">WithCoupon</span> &mdash; The pro-rata cost for upgrades will be calculated based on the time remaining for the subscription. Discounts from any attached coupons will be deducted from the pro-rated cost.
<span class=\"label label-default\">WithoutCoupon</span> &mdash; The pro-rata cost for upgrades will be calculated based on the time remaining for the subscription. Discounts from any attached coupons will not be deducted from the pro-rated cost. ","verbs":[]



75
76
77
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 75

def pro_rata_mode
  @pro_rata_mode
end

#productObject

product to which this rate plan belongs. A product is essentially a collection of rate plans, and describes the service conferred to a customer upon subscription to any of said product’s rate plans. The product serves also as a template from which its rate plans can infer default attributes.“,”verbs“:



114
115
116
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 114

def product
  @product
end

#product_idObject

of the product to which this rate plan belongs. A product is essentially a collection of rate plans, and describes the service conferred to a customer upon subscription to any of said product’s rate plans. The product serves also as a template from which its rate plans can infer default attributes.“,”verbs“:



48
49
50
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 48

def product_id
  @product_id
end

#product_typeObject

frequency of the rate plan &mdash; either recurring or non-recurring. If left unspecified: the rate plan will use the same productType frequency as the Product to which it belongs.“,”verbs“:



72
73
74
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 72

def product_type
  @product_type
end

#public_nameObject

friendly non-unique name used to identify this product-rate-plan“,”verbs“:



84
85
86
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 84

def public_name
  @public_name
end

#statusObject

current status of the rate plan.","verbs":[]



93
94
95
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 93

def status
  @status
end

#tax_statusObject

tax status of the product-rate-plan &mdash; either inclusive or exclusive.
<span class=\"label label-default\">exclusive</span>pricing indicates that the cost of the Pricing Components do not include tax; when BillForward generates an Invoice, the tax will be calculated with this price as a base.
Tax-<span class=\"label label-default\">inclusive</span>pricing indicates that the Pricing components include Tax. BillForward will still calculate tax on each invoice. Tax will be calculated from the sales price.“,”verbs“:



54
55
56
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 54

def tax_status
  @tax_status
end

#taxationObject

list linking taxation strategies to the rate plan.“,”verbs“:



108
109
110
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 108

def taxation
  @taxation
end

#trialObject

of trial-length-measures which constitute the rate plan’s trial period. If left unspecified: the rate plan will use the same trial number as the Product to which it belongs.“,”verbs“:



66
67
68
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 66

def trial
  @trial
end

#trial_periodObject

describing the magnitude of the rate plan’s trial period. If left unspecified: the rate plan will use the same trialPeriod magnitude as the Product to which it belongs.“,”verbs“:



69
70
71
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 69

def trial_period
  @trial_period
end

#updatedObject

{ "description" : "The UTC DateTime when the object was last updated.", "verbs":[] }



36
37
38
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 36

def updated
  @updated
end

#valid_fromObject

UTC DateTime specifying when the rate plan is valid from.“,”verbs“:



87
88
89
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 87

def valid_from
  @valid_from
end

#valid_tillObject

UTC DateTime specifying when the product-rate-plan is valid till.“,”verbs“:



90
91
92
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 90

def valid_till
  @valid_till
end

Class Method Details

.attribute_mapObject

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



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 147

def self.attribute_map
  {
    :'created' => :'created',
    :'changed_by' => :'changedBy',
    :'updated' => :'updated',
    :'metadata' => :'metadata',
    :'id' => :'id',
    :'crm_id' => :'crmID',
    :'product_id' => :'productID',
    :'currency' => :'currency',
    :'tax_status' => :'taxStatus',
    :'failed_payment_behaviour' => :'failedPaymentBehaviour',
    :'duration' => :'duration',
    :'duration_period' => :'durationPeriod',
    :'trial' => :'trial',
    :'trial_period' => :'trialPeriod',
    :'product_type' => :'productType',
    :'pro_rata_mode' => :'proRataMode',
    :'create_zero_valued_invoices' => :'createZeroValuedInvoices',
    :'name' => :'name',
    :'public_name' => :'publicName',
    :'valid_from' => :'validFrom',
    :'valid_till' => :'validTill',
    :'status' => :'status',
    :'migration_behaviour' => :'migrationBehaviour',
    :'invoice_issue_type' => :'invoiceIssueType',
    :'issue_duration' => :'issueDuration',
    :'issue_period' => :'issuePeriod',
    :'taxation' => :'taxation',
    :'fixed_term_definitions' => :'fixedTermDefinitions',
    :'product' => :'product',
    :'pricing_components' => :'pricingComponents',
    :'aggregating_components' => :'aggregatingComponents',
    :'payment_terms' => :'paymentTerms'
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 185

def self.swagger_types
  {
    :'created' => :'DateTime',
    :'changed_by' => :'String',
    :'updated' => :'DateTime',
    :'metadata' => :'DynamicMetadata',
    :'id' => :'String',
    :'crm_id' => :'String',
    :'product_id' => :'String',
    :'currency' => :'String',
    :'tax_status' => :'String',
    :'failed_payment_behaviour' => :'String',
    :'duration' => :'Integer',
    :'duration_period' => :'String',
    :'trial' => :'Integer',
    :'trial_period' => :'String',
    :'product_type' => :'String',
    :'pro_rata_mode' => :'String',
    :'create_zero_valued_invoices' => :'BOOLEAN',
    :'name' => :'String',
    :'public_name' => :'String',
    :'valid_from' => :'DateTime',
    :'valid_till' => :'DateTime',
    :'status' => :'String',
    :'migration_behaviour' => :'String',
    :'invoice_issue_type' => :'String',
    :'issue_duration' => :'Integer',
    :'issue_period' => :'String',
    :'taxation' => :'Array<MutableBillingEntity>',
    :'fixed_term_definitions' => :'Array<MutableBillingEntity>',
    :'product' => :'Product',
    :'pricing_components' => :'Array<PricingComponent>',
    :'aggregating_components' => :'Array<AggregatingComponent>',
    :'payment_terms' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 503

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      created == o.created &&
      changed_by == o.changed_by &&
      updated == o.updated &&
       == o. &&
      id == o.id &&
      crm_id == o.crm_id &&
      product_id == o.product_id &&
      currency == o.currency &&
      tax_status == o.tax_status &&
      failed_payment_behaviour == o.failed_payment_behaviour &&
      duration == o.duration &&
      duration_period == o.duration_period &&
      trial == o.trial &&
      trial_period == o.trial_period &&
      product_type == o.product_type &&
      pro_rata_mode == o.pro_rata_mode &&
      create_zero_valued_invoices == o.create_zero_valued_invoices &&
      name == o.name &&
      public_name == o.public_name &&
      valid_from == o.valid_from &&
      valid_till == o.valid_till &&
      status == o.status &&
      migration_behaviour == o.migration_behaviour &&
      invoice_issue_type == o.invoice_issue_type &&
      issue_duration == o.issue_duration &&
      issue_period == o.issue_period &&
      taxation == o.taxation &&
      fixed_term_definitions == o.fixed_term_definitions &&
      product == o.product &&
      pricing_components == o.pricing_components &&
      aggregating_components == o.aggregating_components &&
      payment_terms == o.payment_terms
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



576
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
602
603
604
605
606
607
608
609
610
611
612
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 576

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /^(true|t|yes|y|1)$/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = BillForward.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



642
643
644
645
646
647
648
649
650
651
652
653
654
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 642

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map{ |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
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



555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 555

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)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(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?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


542
543
544
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 542

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



548
549
550
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 548

def hash
  [created, changed_by, updated, , id, crm_id, product_id, currency, tax_status, failed_payment_behaviour, duration, duration_period, trial, trial_period, product_type, pro_rata_mode, create_zero_valued_invoices, name, public_name, valid_from, valid_till, status, migration_behaviour, invoice_issue_type, issue_duration, issue_period, taxation, fixed_term_definitions, product, pricing_components, aggregating_components, payment_terms].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properies with the reasons



372
373
374
375
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 372

def list_invalid_properties
  invalid_properties = Array.new
  return invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



622
623
624
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 622

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



628
629
630
631
632
633
634
635
636
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 628

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



616
617
618
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 616

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



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
# File 'lib/bf_ruby2/models/product_rate_plan.rb', line 379

def valid?
  return false if @product_id.nil?
  return false if @currency.nil?
  return false if @tax_status.nil?
  tax_status_validator = EnumAttributeValidator.new('String', ["inclusive", "exclusive"])
  return false unless tax_status_validator.valid?(@tax_status)
  return false if @failed_payment_behaviour.nil?
  failed_payment_behaviour_validator = EnumAttributeValidator.new('String', ["CancelSubscription", "None"])
  return false unless failed_payment_behaviour_validator.valid?(@failed_payment_behaviour)
  return false if @duration_period.nil?
  duration_period_validator = EnumAttributeValidator.new('String', ["minutes", "days", "months", "years"])
  return false unless duration_period_validator.valid?(@duration_period)
  trial_period_validator = EnumAttributeValidator.new('String', ["none", "minutes", "days", "months"])
  return false unless trial_period_validator.valid?(@trial_period)
  product_type_validator = EnumAttributeValidator.new('String', ["nonrecurring", "recurring"])
  return false unless product_type_validator.valid?(@product_type)
  return false if @pro_rata_mode.nil?
  pro_rata_mode_validator = EnumAttributeValidator.new('String', ["None", "WithCoupon", "WithoutCoupon", "Full"])
  return false unless pro_rata_mode_validator.valid?(@pro_rata_mode)
  return false if @create_zero_valued_invoices.nil?
  return false if @name.nil?
  return false if @migration_behaviour.nil?
  migration_behaviour_validator = EnumAttributeValidator.new('String', ["NoCharge", "CreditAccount"])
  return false unless migration_behaviour_validator.valid?(@migration_behaviour)
  invoice_issue_type_validator = EnumAttributeValidator.new('String', ["Immediate", "Delayed", "Manual"])
  return false unless invoice_issue_type_validator.valid?(@invoice_issue_type)
  issue_period_validator = EnumAttributeValidator.new('String', ["minutes", "days", "months", "years"])
  return false unless issue_period_validator.valid?(@issue_period)
  return false if @pricing_components.nil?
  return true
end