bf_ruby2 1.2016.229 → 1.2016.230
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +53 -29
- data/bf_ruby2-1.2016.229.gem +0 -0
- data/docs/AccountsApi.md +82 -31
- data/docs/AddChargeToAccountResponse.md +9 -0
- data/docs/AddChargeToAccountResponsePagedMetadata.md +14 -0
- data/docs/AddChargesToAccountAPIRequest.md +17 -0
- data/docs/AddressesApi.md +4 -4
- data/docs/AmendmentsApi.md +13 -13
- data/docs/AnalyticsApi.md +15 -15
- data/docs/AuditlogsApi.md +5 -5
- data/docs/BatchUpdatePricingComponentValuesRequest.md +9 -0
- data/docs/ChargesApi.md +56 -8
- data/docs/ClientsApi.md +6 -6
- data/docs/ConfigurationsApi.md +6 -6
- data/docs/CouponbookApi.md +11 -11
- data/docs/CouponbookdefinitionApi.md +8 -8
- data/docs/CoupondefinitionApi.md +7 -7
- data/docs/CouponinstanceApi.md +12 -12
- data/docs/CouponmodifierApi.md +9 -9
- data/docs/CouponruleApi.md +6 -6
- data/docs/CouponsApi.md +10 -10
- data/docs/CreateSubscriptionChargeAmendment.md +0 -1
- data/docs/CreateSubscriptionRequest.md +2 -0
- data/docs/CreditnotesApi.md +7 -7
- data/docs/CybersourcetokensApi.md +7 -7
- data/docs/DunninglinesApi.md +8 -8
- data/docs/EmailprovidersApi.md +5 -5
- data/docs/EmailsApi.md +1 -1
- data/docs/EmailsubscriptionsApi.md +7 -7
- data/docs/FixedtermdefinitionsApi.md +4 -4
- data/docs/FixedtermsApi.md +2 -2
- data/docs/Invoice.md +3 -0
- data/docs/InvoicesApi.md +63 -63
- data/docs/MetadataApi.md +6 -6
- data/docs/NestedChargeRequest.md +19 -0
- data/docs/NotificationsApi.md +6 -6
- data/docs/OrganizationsApi.md +9 -9
- data/docs/PasswordsApi.md +2 -2
- data/docs/PaymentmethodsApi.md +10 -10
- data/docs/PaymentmethodsubscriptionlinksApi.md +3 -3
- data/docs/PaymentsApi.md +9 -9
- data/docs/PeriodsApi.md +2 -2
- data/docs/PermissionsApi.md +8 -8
- data/docs/PricingcalculatorApi.md +6 -6
- data/docs/PricingcomponentsApi.md +8 -8
- data/docs/PricingcomponenttiersApi.md +7 -7
- data/docs/PricingcomponentvaluechangesApi.md +7 -7
- data/docs/PricingcomponentvaluesApi.md +7 -7
- data/docs/ProductrateplansApi.md +27 -27
- data/docs/ProductsApi.md +17 -17
- data/docs/ProfilesApi.md +6 -6
- data/docs/QuotesApi.md +2 -2
- data/docs/RecalculateChargeBatchRequest.md +12 -0
- data/docs/RecalculateChargeBatchResponse.md +11 -0
- data/docs/RecalculateChargeBatchResponsePagedMetadata.md +14 -0
- data/docs/ReceiptsApi.md +6 -6
- data/docs/RefundsApi.md +9 -9
- data/docs/RolesApi.md +8 -8
- data/docs/SearchApi.md +1 -1
- data/docs/SingleRecalculateChargeRequest.md +15 -0
- data/docs/Subscription.md +1 -0
- data/docs/SubscriptionsApi.md +153 -102
- data/docs/SynchAppConfigsApi.md +6 -6
- data/docs/SynchConfigsApi.md +8 -8
- data/docs/SynchJobsApi.md +10 -10
- data/docs/TaxationlinksApi.md +8 -8
- data/docs/TaxationstrategiesApi.md +11 -11
- data/docs/TimeApi.md +1 -1
- data/docs/TokenizationApi.md +6 -6
- data/docs/UnitofmeasureApi.md +6 -6
- data/docs/UpdatePricingComponentValueChangeResult.md +19 -0
- data/docs/UpdatePricingComponentValueRequest.md +10 -0
- data/docs/UpdatePricingComponentValueResponse.md +9 -0
- data/docs/UpdatePricingComponentValueResponsePagedMetadata.md +14 -0
- data/docs/UsageApi.md +7 -7
- data/docs/UsageperiodsApi.md +3 -3
- data/docs/UsageroundingstrategiesApi.md +6 -6
- data/docs/UsagesessionsApi.md +6 -6
- data/docs/UsernamesApi.md +2 -2
- data/docs/UsersApi.md +16 -16
- data/docs/VaultedgatewaysApi.md +22 -22
- data/docs/WebhooksApi.md +10 -10
- data/lib/bf_ruby2.rb +13 -0
- data/lib/bf_ruby2/api/accounts_api.rb +92 -31
- data/lib/bf_ruby2/api/addresses_api.rb +4 -4
- data/lib/bf_ruby2/api/amendments_api.rb +13 -13
- data/lib/bf_ruby2/api/analytics_api.rb +15 -15
- data/lib/bf_ruby2/api/auditlogs_api.rb +5 -5
- data/lib/bf_ruby2/api/charges_api.rb +65 -8
- data/lib/bf_ruby2/api/clients_api.rb +6 -6
- data/lib/bf_ruby2/api/configurations_api.rb +6 -6
- data/lib/bf_ruby2/api/couponbook_api.rb +11 -11
- data/lib/bf_ruby2/api/couponbookdefinition_api.rb +8 -8
- data/lib/bf_ruby2/api/coupondefinition_api.rb +7 -7
- data/lib/bf_ruby2/api/couponinstance_api.rb +12 -12
- data/lib/bf_ruby2/api/couponmodifier_api.rb +9 -9
- data/lib/bf_ruby2/api/couponrule_api.rb +6 -6
- data/lib/bf_ruby2/api/coupons_api.rb +10 -10
- data/lib/bf_ruby2/api/creditnotes_api.rb +7 -7
- data/lib/bf_ruby2/api/cybersourcetokens_api.rb +7 -7
- data/lib/bf_ruby2/api/dunninglines_api.rb +8 -8
- data/lib/bf_ruby2/api/emailproviders_api.rb +5 -5
- data/lib/bf_ruby2/api/emails_api.rb +1 -1
- data/lib/bf_ruby2/api/emailsubscriptions_api.rb +7 -7
- data/lib/bf_ruby2/api/fixedtermdefinitions_api.rb +4 -4
- data/lib/bf_ruby2/api/fixedterms_api.rb +2 -2
- data/lib/bf_ruby2/api/invoices_api.rb +63 -63
- data/lib/bf_ruby2/api/metadata_api.rb +6 -6
- data/lib/bf_ruby2/api/notifications_api.rb +6 -6
- data/lib/bf_ruby2/api/organizations_api.rb +9 -9
- data/lib/bf_ruby2/api/passwords_api.rb +2 -2
- data/lib/bf_ruby2/api/paymentmethods_api.rb +10 -10
- data/lib/bf_ruby2/api/paymentmethodsubscriptionlinks_api.rb +3 -3
- data/lib/bf_ruby2/api/payments_api.rb +9 -9
- data/lib/bf_ruby2/api/periods_api.rb +2 -2
- data/lib/bf_ruby2/api/permissions_api.rb +8 -8
- data/lib/bf_ruby2/api/pricingcalculator_api.rb +6 -6
- data/lib/bf_ruby2/api/pricingcomponents_api.rb +8 -8
- data/lib/bf_ruby2/api/pricingcomponenttiers_api.rb +7 -7
- data/lib/bf_ruby2/api/pricingcomponentvaluechanges_api.rb +7 -7
- data/lib/bf_ruby2/api/pricingcomponentvalues_api.rb +7 -7
- data/lib/bf_ruby2/api/productrateplans_api.rb +27 -27
- data/lib/bf_ruby2/api/products_api.rb +17 -17
- data/lib/bf_ruby2/api/profiles_api.rb +6 -6
- data/lib/bf_ruby2/api/quotes_api.rb +2 -2
- data/lib/bf_ruby2/api/receipts_api.rb +6 -6
- data/lib/bf_ruby2/api/refunds_api.rb +9 -9
- data/lib/bf_ruby2/api/roles_api.rb +8 -8
- data/lib/bf_ruby2/api/search_api.rb +1 -1
- data/lib/bf_ruby2/api/subscriptions_api.rb +163 -102
- data/lib/bf_ruby2/api/synch_app_configs_api.rb +6 -6
- data/lib/bf_ruby2/api/synch_configs_api.rb +8 -8
- data/lib/bf_ruby2/api/synch_jobs_api.rb +10 -10
- data/lib/bf_ruby2/api/taxationlinks_api.rb +8 -8
- data/lib/bf_ruby2/api/taxationstrategies_api.rb +11 -11
- data/lib/bf_ruby2/api/time_api.rb +1 -1
- data/lib/bf_ruby2/api/tokenization_api.rb +6 -6
- data/lib/bf_ruby2/api/unitofmeasure_api.rb +6 -6
- data/lib/bf_ruby2/api/usage_api.rb +7 -7
- data/lib/bf_ruby2/api/usageperiods_api.rb +3 -3
- data/lib/bf_ruby2/api/usageroundingstrategies_api.rb +6 -6
- data/lib/bf_ruby2/api/usagesessions_api.rb +6 -6
- data/lib/bf_ruby2/api/usernames_api.rb +2 -2
- data/lib/bf_ruby2/api/users_api.rb +16 -16
- data/lib/bf_ruby2/api/vaultedgateways_api.rb +22 -22
- data/lib/bf_ruby2/api/webhooks_api.rb +10 -10
- data/lib/bf_ruby2/models/add_charge_to_account_response.rb +212 -0
- data/lib/bf_ruby2/models/add_charge_to_account_response_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/add_charges_to_account_api_request.rb +337 -0
- data/lib/bf_ruby2/models/batch_update_pricing_component_values_request.rb +244 -0
- data/lib/bf_ruby2/models/create_subscription_charge_amendment.rb +1 -24
- data/lib/bf_ruby2/models/create_subscription_request.rb +24 -4
- data/lib/bf_ruby2/models/invoice.rb +32 -1
- data/lib/bf_ruby2/models/nested_charge_request.rb +343 -0
- data/lib/bf_ruby2/models/recalculate_charge_batch_request.rb +279 -0
- data/lib/bf_ruby2/models/recalculate_charge_batch_response.rb +234 -0
- data/lib/bf_ruby2/models/recalculate_charge_batch_response_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/single_recalculate_charge_request.rb +317 -0
- data/lib/bf_ruby2/models/subscription.rb +11 -1
- data/lib/bf_ruby2/models/update_pricing_component_value_change_result.rb +367 -0
- data/lib/bf_ruby2/models/update_pricing_component_value_request.rb +253 -0
- data/lib/bf_ruby2/models/update_pricing_component_value_response.rb +210 -0
- data/lib/bf_ruby2/models/update_pricing_component_value_response_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/version.rb +1 -1
- data/spec/models/add_charge_to_account_response_paged_metadata_spec.rb +89 -0
- data/spec/models/add_charge_to_account_response_spec.rb +59 -0
- data/spec/models/add_charges_to_account_api_request_spec.rb +115 -0
- data/spec/models/batch_update_pricing_component_values_request_spec.rb +63 -0
- data/spec/models/nested_charge_request_spec.rb +123 -0
- data/spec/models/recalculate_charge_batch_request_spec.rb +81 -0
- data/spec/models/recalculate_charge_batch_response_paged_metadata_spec.rb +89 -0
- data/spec/models/recalculate_charge_batch_response_spec.rb +71 -0
- data/spec/models/single_recalculate_charge_request_spec.rb +103 -0
- data/spec/models/update_pricing_component_value_change_result_spec.rb +131 -0
- data/spec/models/update_pricing_component_value_request_spec.rb +69 -0
- data/spec/models/update_pricing_component_value_response_paged_metadata_spec.rb +89 -0
- data/spec/models/update_pricing_component_value_response_spec.rb +59 -0
- metadata +54 -2
- data/setup.scratch.rb +0 -33
@@ -74,9 +74,6 @@ module BillForward
|
|
74
74
|
# { \"description\" : \"\", \"verbs\":[] }
|
75
75
|
attr_accessor :discount
|
76
76
|
|
77
|
-
# { \"description\" : \"\", \"default\" : \"Manual\", \"verbs\":[] }
|
78
|
-
attr_accessor :type
|
79
|
-
|
80
77
|
# { \"description\" : \"<span class=\\\"label label-default\\\">Immediate</span> invoicing will result in an invoice being issued immediately for the charge. <span class=\\\"label label-default\\\">Aggregated</span> invoicing will generate a charge to be added to the next issued invoice, for example at the current billing period end.\", \"default\" : \"Aggregated\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }
|
81
78
|
attr_accessor :invoicing_type
|
82
79
|
|
@@ -133,7 +130,6 @@ module BillForward
|
|
133
130
|
:'description' => :'description',
|
134
131
|
:'amount' => :'amount',
|
135
132
|
:'discount' => :'discount',
|
136
|
-
:'type' => :'type',
|
137
133
|
:'invoicing_type' => :'invoicingType',
|
138
134
|
:'tax_status' => :'taxStatus',
|
139
135
|
:'subscription_charge' => :'subscriptionCharge',
|
@@ -161,7 +157,6 @@ module BillForward
|
|
161
157
|
:'description' => :'String',
|
162
158
|
:'amount' => :'Float',
|
163
159
|
:'discount' => :'Float',
|
164
|
-
:'type' => :'String',
|
165
160
|
:'invoicing_type' => :'String',
|
166
161
|
:'tax_status' => :'String',
|
167
162
|
:'subscription_charge' => :'SubscriptionCharge',
|
@@ -244,10 +239,6 @@ module BillForward
|
|
244
239
|
self.discount = attributes[:'discount']
|
245
240
|
end
|
246
241
|
|
247
|
-
if attributes.has_key?(:'type')
|
248
|
-
self.type = attributes[:'type']
|
249
|
-
end
|
250
|
-
|
251
242
|
if attributes.has_key?(:'invoicingType')
|
252
243
|
self.invoicing_type = attributes[:'invoicingType']
|
253
244
|
end
|
@@ -292,9 +283,6 @@ module BillForward
|
|
292
283
|
return false unless state_validator.valid?(@state)
|
293
284
|
return false if @deleted.nil?
|
294
285
|
return false if @amount.nil?
|
295
|
-
return false if @type.nil?
|
296
|
-
type_validator = EnumAttributeValidator.new('String', ["Setup", "Upgrade", "Manual", "ProductRatePlanMigration", "Arrears", "Advance", "Coupon", "Usage", "PricingComponent"])
|
297
|
-
return false unless type_validator.valid?(@type)
|
298
286
|
return false if @invoicing_type.nil?
|
299
287
|
invoicing_type_validator = EnumAttributeValidator.new('String', ["Immediate", "Aggregated"])
|
300
288
|
return false unless invoicing_type_validator.valid?(@invoicing_type)
|
@@ -334,16 +322,6 @@ module BillForward
|
|
334
322
|
@state = state
|
335
323
|
end
|
336
324
|
|
337
|
-
# Custom attribute writer method checking allowed values (enum).
|
338
|
-
# @param [Object] type Object to be assigned
|
339
|
-
def type=(type)
|
340
|
-
validator = EnumAttributeValidator.new('String', ["Setup", "Upgrade", "Manual", "ProductRatePlanMigration", "Arrears", "Advance", "Coupon", "Usage", "PricingComponent"])
|
341
|
-
unless validator.valid?(type)
|
342
|
-
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
|
343
|
-
end
|
344
|
-
@type = type
|
345
|
-
end
|
346
|
-
|
347
325
|
# Custom attribute writer method checking allowed values (enum).
|
348
326
|
# @param [Object] invoicing_type Object to be assigned
|
349
327
|
def invoicing_type=(invoicing_type)
|
@@ -385,7 +363,6 @@ module BillForward
|
|
385
363
|
description == o.description &&
|
386
364
|
amount == o.amount &&
|
387
365
|
discount == o.discount &&
|
388
|
-
type == o.type &&
|
389
366
|
invoicing_type == o.invoicing_type &&
|
390
367
|
tax_status == o.tax_status &&
|
391
368
|
subscription_charge == o.subscription_charge &&
|
@@ -402,7 +379,7 @@ module BillForward
|
|
402
379
|
# Calculates hash code according to all attributes.
|
403
380
|
# @return [Fixnum] Hash code
|
404
381
|
def hash
|
405
|
-
[created, changed_by, updated, type, id, organization_id, subscription_id, amendment_type, actioning_time, actioned_time, state, deleted, subscription_charge_id, description, amount, discount,
|
382
|
+
[created, changed_by, updated, type, id, organization_id, subscription_id, amendment_type, actioning_time, actioned_time, state, deleted, subscription_charge_id, description, amount, discount, invoicing_type, tax_status, subscription_charge, pricing_component_value_change, pricing_component_id].hash
|
406
383
|
end
|
407
384
|
|
408
385
|
# Builds the object from hash
|
@@ -75,12 +75,18 @@ module BillForward
|
|
75
75
|
|
76
76
|
attr_accessor :payment_terms
|
77
77
|
|
78
|
+
# { \"default\": \" \", \"description\":\"Purchase order associated with the subscription. If specified this is copied to any invoices issued for this subscription.\",\"verbs\":[\"POST\"]}
|
79
|
+
attr_accessor :purchase_order
|
80
|
+
|
78
81
|
# {\"description\":\"start of the contracted period. This will be after a trial, if one exists\",\"verbs\":[\"GET\"]}
|
79
82
|
attr_accessor :contract_start
|
80
83
|
|
81
84
|
# {\"default\":\"None\",\"description\":\"The action that should be taken, should an invoice for some subscription to this rate plan remain unpaid despite the dunning period's being exceeded.<br><span class=\\\"label label-default\\\">CancelSubscription</span> — Demotes the subscription to the `Failed` state as soon as the dunning period is exceeded.<br><span class=\\\"label label-default\\\">None</span> — The subscription is allowed to continue in the `AwaitingPayment` state indefinitely even if the dunning period is exceeded.For slow payment cycles — or when manual invoice remediation is common — <span class=\\\"label label-default\\\">None</span> is recommended.<br>In a heavily-automated SaaS environment, automatic cancellation via <span class=\\\"label label-default\\\">CancelSubscription</span> is recommended.\",\"verbs\":[\"POST\",\"PUT\",\"GET\"]}
|
82
85
|
attr_accessor :failed_payment_behaviour
|
83
86
|
|
87
|
+
# { \"description\":\"How much prepayment should be taken upfront.\", \"verbs\":[\"POST\",\"GET\"]}
|
88
|
+
attr_accessor :prepayment_amount
|
89
|
+
|
84
90
|
class EnumAttributeValidator
|
85
91
|
attr_reader :datatype
|
86
92
|
attr_reader :allowable_values
|
@@ -123,8 +129,10 @@ module BillForward
|
|
123
129
|
:'pricing_component_quantities' => :'pricingComponentQuantities',
|
124
130
|
:'metadata' => :'metadata',
|
125
131
|
:'payment_terms' => :'paymentTerms',
|
132
|
+
:'purchase_order' => :'purchaseOrder',
|
126
133
|
:'contract_start' => :'contractStart',
|
127
|
-
:'failed_payment_behaviour' => :'failedPaymentBehaviour'
|
134
|
+
:'failed_payment_behaviour' => :'failedPaymentBehaviour',
|
135
|
+
:'prepayment_amount' => :'prepaymentAmount'
|
128
136
|
}
|
129
137
|
end
|
130
138
|
|
@@ -148,8 +156,10 @@ module BillForward
|
|
148
156
|
:'pricing_component_quantities' => :'Array<PricingComponentQuantityRequest>',
|
149
157
|
:'metadata' => :'DynamicMetadata',
|
150
158
|
:'payment_terms' => :'Integer',
|
159
|
+
:'purchase_order' => :'String',
|
151
160
|
:'contract_start' => :'DateTime',
|
152
|
-
:'failed_payment_behaviour' => :'String'
|
161
|
+
:'failed_payment_behaviour' => :'String',
|
162
|
+
:'prepayment_amount' => :'Float'
|
153
163
|
}
|
154
164
|
end
|
155
165
|
|
@@ -235,6 +245,10 @@ module BillForward
|
|
235
245
|
self.payment_terms = attributes[:'paymentTerms']
|
236
246
|
end
|
237
247
|
|
248
|
+
if attributes.has_key?(:'purchaseOrder')
|
249
|
+
self.purchase_order = attributes[:'purchaseOrder']
|
250
|
+
end
|
251
|
+
|
238
252
|
if attributes.has_key?(:'contractStart')
|
239
253
|
self.contract_start = attributes[:'contractStart']
|
240
254
|
end
|
@@ -243,6 +257,10 @@ module BillForward
|
|
243
257
|
self.failed_payment_behaviour = attributes[:'failedPaymentBehaviour']
|
244
258
|
end
|
245
259
|
|
260
|
+
if attributes.has_key?(:'prepaymentAmount')
|
261
|
+
self.prepayment_amount = attributes[:'prepaymentAmount']
|
262
|
+
end
|
263
|
+
|
246
264
|
end
|
247
265
|
|
248
266
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -319,8 +337,10 @@ module BillForward
|
|
319
337
|
pricing_component_quantities == o.pricing_component_quantities &&
|
320
338
|
metadata == o.metadata &&
|
321
339
|
payment_terms == o.payment_terms &&
|
340
|
+
purchase_order == o.purchase_order &&
|
322
341
|
contract_start == o.contract_start &&
|
323
|
-
failed_payment_behaviour == o.failed_payment_behaviour
|
342
|
+
failed_payment_behaviour == o.failed_payment_behaviour &&
|
343
|
+
prepayment_amount == o.prepayment_amount
|
324
344
|
end
|
325
345
|
|
326
346
|
# @see the `==` method
|
@@ -332,7 +352,7 @@ module BillForward
|
|
332
352
|
# Calculates hash code according to all attributes.
|
333
353
|
# @return [Fixnum] Hash code
|
334
354
|
def hash
|
335
|
-
[account_id, product, product_rate_plan, organization_id, name, description, start, _end, state, trial_end, type, parent_id, aggregate_all_subscriptions_on_account, align_period_with_aggregating_subscription, pricing_component_quantities, metadata, payment_terms, contract_start, failed_payment_behaviour].hash
|
355
|
+
[account_id, product, product_rate_plan, organization_id, name, description, start, _end, state, trial_end, type, parent_id, aggregate_all_subscriptions_on_account, align_period_with_aggregating_subscription, pricing_component_quantities, metadata, payment_terms, purchase_order, contract_start, failed_payment_behaviour, prepayment_amount].hash
|
336
356
|
end
|
337
357
|
|
338
358
|
# Builds the object from hash
|
@@ -143,6 +143,14 @@ module BillForward
|
|
143
143
|
# { \"description\" : \"Is this an initial invoice. An initial invoice is the first invoice generated for a subscription. Initial invoices will not have dunning applied to them and as such will only have a single payment attempt. For trial periods, the trial invoice is the initial invoice.\", \"verbs\":[\"GET\"] }
|
144
144
|
attr_accessor :initial_invoice
|
145
145
|
|
146
|
+
# { \"processing\" : \"If true, the invoice is processing.\", \"verbs\":[] }
|
147
|
+
attr_accessor :processing
|
148
|
+
|
149
|
+
attr_accessor :payment_terms
|
150
|
+
|
151
|
+
# { \"description\" : \"Purchase order associated with the subscription. If specified this is copied to any invoices issued for this subscription.\", \"verbs\":[\"GET\",\"PUT\",\"POST\"] }
|
152
|
+
attr_accessor :purchase_order
|
153
|
+
|
146
154
|
# { \"description\" : \"The version number of the Invoice. The first version of an Invoice is version number 1\", \"verbs\":[\"GET\"] }
|
147
155
|
attr_accessor :version_number
|
148
156
|
|
@@ -228,6 +236,9 @@ module BillForward
|
|
228
236
|
:'locked' => :'locked',
|
229
237
|
:'managed_by' => :'managedBy',
|
230
238
|
:'initial_invoice' => :'initialInvoice',
|
239
|
+
:'processing' => :'processing',
|
240
|
+
:'payment_terms' => :'paymentTerms',
|
241
|
+
:'purchase_order' => :'purchaseOrder',
|
231
242
|
:'version_number' => :'versionNumber',
|
232
243
|
:'invoice_lines' => :'invoiceLines',
|
233
244
|
:'tax_lines' => :'taxLines',
|
@@ -281,6 +292,9 @@ module BillForward
|
|
281
292
|
:'locked' => :'String',
|
282
293
|
:'managed_by' => :'String',
|
283
294
|
:'initial_invoice' => :'BOOLEAN',
|
295
|
+
:'processing' => :'BOOLEAN',
|
296
|
+
:'payment_terms' => :'Integer',
|
297
|
+
:'purchase_order' => :'String',
|
284
298
|
:'version_number' => :'Integer',
|
285
299
|
:'invoice_lines' => :'Array<InvoiceLine>',
|
286
300
|
:'tax_lines' => :'Array<InsertableBillingEntity>',
|
@@ -460,6 +474,20 @@ module BillForward
|
|
460
474
|
self.initial_invoice = false
|
461
475
|
end
|
462
476
|
|
477
|
+
if attributes.has_key?(:'processing')
|
478
|
+
self.processing = attributes[:'processing']
|
479
|
+
else
|
480
|
+
self.processing = false
|
481
|
+
end
|
482
|
+
|
483
|
+
if attributes.has_key?(:'paymentTerms')
|
484
|
+
self.payment_terms = attributes[:'paymentTerms']
|
485
|
+
end
|
486
|
+
|
487
|
+
if attributes.has_key?(:'purchaseOrder')
|
488
|
+
self.purchase_order = attributes[:'purchaseOrder']
|
489
|
+
end
|
490
|
+
|
463
491
|
if attributes.has_key?(:'versionNumber')
|
464
492
|
self.version_number = attributes[:'versionNumber']
|
465
493
|
end
|
@@ -615,6 +643,9 @@ module BillForward
|
|
615
643
|
locked == o.locked &&
|
616
644
|
managed_by == o.managed_by &&
|
617
645
|
initial_invoice == o.initial_invoice &&
|
646
|
+
processing == o.processing &&
|
647
|
+
payment_terms == o.payment_terms &&
|
648
|
+
purchase_order == o.purchase_order &&
|
618
649
|
version_number == o.version_number &&
|
619
650
|
invoice_lines == o.invoice_lines &&
|
620
651
|
tax_lines == o.tax_lines &&
|
@@ -634,7 +665,7 @@ module BillForward
|
|
634
665
|
# Calculates hash code according to all attributes.
|
635
666
|
# @return [Fixnum] Hash code
|
636
667
|
def hash
|
637
|
-
[created, changed_by, updated, version_id, id, crm_id, subscription_id, subscription_version_id, account_id, organization_id, parent_invoice_id, name, description, state, issued, period_start, period_end, due, deleted, total_execution_attempts, last_execution_attempt, next_execution_attempt, final_execution_attempt, payment_received, currency, cost_excluding_tax, invoice_cost, non_discounted_cost, non_discounted_cost_excluding_tax, invoice_paid, discount_amount, discount_amount_excluding_tax, invoice_refunded, credit_rolled_over, credit_rolled_over_excluding_tax, type, locked, managed_by, initial_invoice, version_number, invoice_lines, tax_lines, invoice_payments, invoice_refunds, invoice_credit_notes, charges, children].hash
|
668
|
+
[created, changed_by, updated, version_id, id, crm_id, subscription_id, subscription_version_id, account_id, organization_id, parent_invoice_id, name, description, state, issued, period_start, period_end, due, deleted, total_execution_attempts, last_execution_attempt, next_execution_attempt, final_execution_attempt, payment_received, currency, cost_excluding_tax, invoice_cost, non_discounted_cost, non_discounted_cost_excluding_tax, invoice_paid, discount_amount, discount_amount_excluding_tax, invoice_refunded, credit_rolled_over, credit_rolled_over_excluding_tax, type, locked, managed_by, initial_invoice, processing, payment_terms, purchase_order, version_number, invoice_lines, tax_lines, invoice_payments, invoice_refunds, invoice_credit_notes, charges, children].hash
|
638
669
|
end
|
639
670
|
|
640
671
|
# Builds the object from hash
|
@@ -0,0 +1,343 @@
|
|
1
|
+
=begin
|
2
|
+
#BillForward REST API
|
3
|
+
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
you may not use this file except in compliance with the License.
|
12
|
+
You may obtain a copy of the License at
|
13
|
+
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
See the License for the specific language governing permissions and
|
20
|
+
limitations under the License.
|
21
|
+
|
22
|
+
=end
|
23
|
+
|
24
|
+
require 'date'
|
25
|
+
|
26
|
+
module BillForward
|
27
|
+
# Partial request, which -- when accompanied by additional context -- describes some request concerning charges.
|
28
|
+
class NestedChargeRequest
|
29
|
+
# {\"description\":\"Friendly name given to the charge to help identify it.\",\"verbs\":[\"POST\",\"GET\"]}
|
30
|
+
attr_accessor :name
|
31
|
+
|
32
|
+
# {\"description\":\"\",\"verbs\":[\"POST\",\"GET\"]}
|
33
|
+
attr_accessor :description
|
34
|
+
|
35
|
+
# {\"description\":\"Monetary amount for which to charge. Used only for ad-hoc charges i.e charges not associated with any pricing component. Applicable if pricingComponent is NOT defined\",\"verbs\":[\"POST\",\"GET\"]}
|
36
|
+
attr_accessor :amount
|
37
|
+
|
38
|
+
# {\"default\":false,\"description\":\"Applicable if amount is specified and indicates whether or not to apply tax in addition to the value specified.<br><span class=\\\"label label-default\\\">true</span> — Tax will be added on top of the nominal price specified in amount — in accordance with any taxation strategies you have defined.<br><span class=\\\"label label-default\\\">false</span> — No tax will be applied on top of the price specified in amount.\",\"verbs\":[\"POST\",\"GET\"]}
|
39
|
+
attr_accessor :tax_amount
|
40
|
+
|
41
|
+
# {\"default\":\"Now\",\"description\":\"Start of the interval to which the charge applies. This can be used to apply a charge across partial or multiple periods. Pro-rating the price of pricingComponents purchased\",\"verbs\":[\"POST\",\"GET\"]}
|
42
|
+
attr_accessor :period_start
|
43
|
+
|
44
|
+
# {\"default\":\"(End of current period)\",\"description\":\"(Applicable only if `pricingComponent` is defined)<br>End of the interval to which the charge applies. Used in pro-rata calculation\",\"verbs\":[\"POST\",\"GET\"]}
|
45
|
+
attr_accessor :period_end
|
46
|
+
|
47
|
+
# {\"default\":\"<span class=\\\"label label-default\\\">Debit</span>\",\"description\":\"Whether this charge represents an increase or decrease in invoice cost<br><span class=\\\"label label-default\\\">Credit</span> — This results in a reduction to the invoice cost<br><span class=\\\"label label-default\\\">Debit</span> — This will increase the invoice cost\",\"verbs\":[\"POST\",\"GET\"]}
|
48
|
+
attr_accessor :charge_type
|
49
|
+
|
50
|
+
# {\"default\":\"false\",\"description\":\"Whether the charge is meant in the context of a trial.<br><span class=\\\"label label-default\\\">false</span> — This is a non-trial charge, so funds will be sought from the customer.<br><span class=\\\"label label-default\\\">true</span> — This is a trial charge, soThe charge can be considered 'Paid' without taking any funds from the customer.\",\"verbs\":[\"POST\",\"GET\"]}
|
51
|
+
attr_accessor :trial
|
52
|
+
|
53
|
+
# {\"description\":\"[Required only if the `productRatePlan` field is populated with a name (as opposed to an ID)]. The ID or name of the product rate plan to which the referenced rate plan belongs.\",\"verbs\":[\"POST\",\"GET\"]}
|
54
|
+
attr_accessor :product
|
55
|
+
|
56
|
+
# {\"description\":\"[Required only if the `pricingComponent` field is populated with a name (as opposed to an ID)]. The ID or name of the rate plan to which the referenced PricingComponent belongs.\",\"verbs\":[\"POST\",\"GET\"]}
|
57
|
+
attr_accessor :product_rate_plan
|
58
|
+
|
59
|
+
# {\"description\":\"Specifies that this charge is for consumption of some quantity of this pricing component (whose name or ID can be provided).<br>If left blank:<br>The charge will be created as 'ad-hoc'. That is: a monetary lump sum, associated with no pricing component\",\"verbs\":[\"POST\",\"GET\"]}
|
60
|
+
attr_accessor :pricing_component
|
61
|
+
|
62
|
+
# {\"description\":\"[Required if pricingComponent is defined]. The value consumed of the pricing component which this charge concerns.\",\"verbs\":[\"POST\",\"GET\"]}
|
63
|
+
attr_accessor :pricing_component_value
|
64
|
+
|
65
|
+
class EnumAttributeValidator
|
66
|
+
attr_reader :datatype
|
67
|
+
attr_reader :allowable_values
|
68
|
+
|
69
|
+
def initialize(datatype, allowable_values)
|
70
|
+
@allowable_values = allowable_values.map do |value|
|
71
|
+
case datatype.to_s
|
72
|
+
when /Integer/i
|
73
|
+
value.to_i
|
74
|
+
when /Float/i
|
75
|
+
value.to_f
|
76
|
+
else
|
77
|
+
value
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
def valid?(value)
|
83
|
+
!value || allowable_values.include?(value)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
88
|
+
def self.attribute_map
|
89
|
+
{
|
90
|
+
:'name' => :'name',
|
91
|
+
:'description' => :'description',
|
92
|
+
:'amount' => :'amount',
|
93
|
+
:'tax_amount' => :'taxAmount',
|
94
|
+
:'period_start' => :'periodStart',
|
95
|
+
:'period_end' => :'periodEnd',
|
96
|
+
:'charge_type' => :'chargeType',
|
97
|
+
:'trial' => :'trial',
|
98
|
+
:'product' => :'product',
|
99
|
+
:'product_rate_plan' => :'productRatePlan',
|
100
|
+
:'pricing_component' => :'pricingComponent',
|
101
|
+
:'pricing_component_value' => :'pricingComponentValue'
|
102
|
+
}
|
103
|
+
end
|
104
|
+
|
105
|
+
# Attribute type mapping.
|
106
|
+
def self.swagger_types
|
107
|
+
{
|
108
|
+
:'name' => :'String',
|
109
|
+
:'description' => :'String',
|
110
|
+
:'amount' => :'Float',
|
111
|
+
:'tax_amount' => :'BOOLEAN',
|
112
|
+
:'period_start' => :'DateTime',
|
113
|
+
:'period_end' => :'DateTime',
|
114
|
+
:'charge_type' => :'String',
|
115
|
+
:'trial' => :'BOOLEAN',
|
116
|
+
:'product' => :'String',
|
117
|
+
:'product_rate_plan' => :'String',
|
118
|
+
:'pricing_component' => :'String',
|
119
|
+
:'pricing_component_value' => :'Integer'
|
120
|
+
}
|
121
|
+
end
|
122
|
+
|
123
|
+
# Initializes the object
|
124
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
125
|
+
def initialize(attributes = {})
|
126
|
+
return unless attributes.is_a?(Hash)
|
127
|
+
|
128
|
+
# convert string to symbol for hash key
|
129
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
130
|
+
|
131
|
+
if attributes.has_key?(:'name')
|
132
|
+
self.name = attributes[:'name']
|
133
|
+
end
|
134
|
+
|
135
|
+
if attributes.has_key?(:'description')
|
136
|
+
self.description = attributes[:'description']
|
137
|
+
end
|
138
|
+
|
139
|
+
if attributes.has_key?(:'amount')
|
140
|
+
self.amount = attributes[:'amount']
|
141
|
+
end
|
142
|
+
|
143
|
+
if attributes.has_key?(:'taxAmount')
|
144
|
+
self.tax_amount = attributes[:'taxAmount']
|
145
|
+
end
|
146
|
+
|
147
|
+
if attributes.has_key?(:'periodStart')
|
148
|
+
self.period_start = attributes[:'periodStart']
|
149
|
+
end
|
150
|
+
|
151
|
+
if attributes.has_key?(:'periodEnd')
|
152
|
+
self.period_end = attributes[:'periodEnd']
|
153
|
+
end
|
154
|
+
|
155
|
+
if attributes.has_key?(:'chargeType')
|
156
|
+
self.charge_type = attributes[:'chargeType']
|
157
|
+
end
|
158
|
+
|
159
|
+
if attributes.has_key?(:'trial')
|
160
|
+
self.trial = attributes[:'trial']
|
161
|
+
end
|
162
|
+
|
163
|
+
if attributes.has_key?(:'product')
|
164
|
+
self.product = attributes[:'product']
|
165
|
+
end
|
166
|
+
|
167
|
+
if attributes.has_key?(:'productRatePlan')
|
168
|
+
self.product_rate_plan = attributes[:'productRatePlan']
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.has_key?(:'pricingComponent')
|
172
|
+
self.pricing_component = attributes[:'pricingComponent']
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.has_key?(:'pricingComponentValue')
|
176
|
+
self.pricing_component_value = attributes[:'pricingComponentValue']
|
177
|
+
end
|
178
|
+
|
179
|
+
end
|
180
|
+
|
181
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
182
|
+
# @return Array for valid properies with the reasons
|
183
|
+
def list_invalid_properties
|
184
|
+
invalid_properties = Array.new
|
185
|
+
return invalid_properties
|
186
|
+
end
|
187
|
+
|
188
|
+
# Check to see if the all the properties in the model are valid
|
189
|
+
# @return true if the model is valid
|
190
|
+
def valid?
|
191
|
+
charge_type_validator = EnumAttributeValidator.new('String', ["Credit", "Debit"])
|
192
|
+
return false unless charge_type_validator.valid?(@charge_type)
|
193
|
+
return true
|
194
|
+
end
|
195
|
+
|
196
|
+
# Custom attribute writer method checking allowed values (enum).
|
197
|
+
# @param [Object] charge_type Object to be assigned
|
198
|
+
def charge_type=(charge_type)
|
199
|
+
validator = EnumAttributeValidator.new('String', ["Credit", "Debit"])
|
200
|
+
unless validator.valid?(charge_type)
|
201
|
+
fail ArgumentError, "invalid value for 'charge_type', must be one of #{validator.allowable_values}."
|
202
|
+
end
|
203
|
+
@charge_type = charge_type
|
204
|
+
end
|
205
|
+
|
206
|
+
# Checks equality by comparing each attribute.
|
207
|
+
# @param [Object] Object to be compared
|
208
|
+
def ==(o)
|
209
|
+
return true if self.equal?(o)
|
210
|
+
self.class == o.class &&
|
211
|
+
name == o.name &&
|
212
|
+
description == o.description &&
|
213
|
+
amount == o.amount &&
|
214
|
+
tax_amount == o.tax_amount &&
|
215
|
+
period_start == o.period_start &&
|
216
|
+
period_end == o.period_end &&
|
217
|
+
charge_type == o.charge_type &&
|
218
|
+
trial == o.trial &&
|
219
|
+
product == o.product &&
|
220
|
+
product_rate_plan == o.product_rate_plan &&
|
221
|
+
pricing_component == o.pricing_component &&
|
222
|
+
pricing_component_value == o.pricing_component_value
|
223
|
+
end
|
224
|
+
|
225
|
+
# @see the `==` method
|
226
|
+
# @param [Object] Object to be compared
|
227
|
+
def eql?(o)
|
228
|
+
self == o
|
229
|
+
end
|
230
|
+
|
231
|
+
# Calculates hash code according to all attributes.
|
232
|
+
# @return [Fixnum] Hash code
|
233
|
+
def hash
|
234
|
+
[name, description, amount, tax_amount, period_start, period_end, charge_type, trial, product, product_rate_plan, pricing_component, pricing_component_value].hash
|
235
|
+
end
|
236
|
+
|
237
|
+
# Builds the object from hash
|
238
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
239
|
+
# @return [Object] Returns the model itself
|
240
|
+
def build_from_hash(attributes)
|
241
|
+
return nil unless attributes.is_a?(Hash)
|
242
|
+
self.class.swagger_types.each_pair do |key, type|
|
243
|
+
if type =~ /^Array<(.*)>/i
|
244
|
+
# check to ensure the input is an array given that the the attribute
|
245
|
+
# is documented as an array but the input is not
|
246
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
247
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
248
|
+
end
|
249
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
250
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
251
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
252
|
+
end
|
253
|
+
|
254
|
+
self
|
255
|
+
end
|
256
|
+
|
257
|
+
# Deserializes the data based on type
|
258
|
+
# @param string type Data type
|
259
|
+
# @param string value Value to be deserialized
|
260
|
+
# @return [Object] Deserialized data
|
261
|
+
def _deserialize(type, value)
|
262
|
+
case type.to_sym
|
263
|
+
when :DateTime
|
264
|
+
DateTime.parse(value)
|
265
|
+
when :Date
|
266
|
+
Date.parse(value)
|
267
|
+
when :String
|
268
|
+
value.to_s
|
269
|
+
when :Integer
|
270
|
+
value.to_i
|
271
|
+
when :Float
|
272
|
+
value.to_f
|
273
|
+
when :BOOLEAN
|
274
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
275
|
+
true
|
276
|
+
else
|
277
|
+
false
|
278
|
+
end
|
279
|
+
when :Object
|
280
|
+
# generic object (usually a Hash), return directly
|
281
|
+
value
|
282
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
283
|
+
inner_type = Regexp.last_match[:inner_type]
|
284
|
+
value.map { |v| _deserialize(inner_type, v) }
|
285
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
286
|
+
k_type = Regexp.last_match[:k_type]
|
287
|
+
v_type = Regexp.last_match[:v_type]
|
288
|
+
{}.tap do |hash|
|
289
|
+
value.each do |k, v|
|
290
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
291
|
+
end
|
292
|
+
end
|
293
|
+
else # model
|
294
|
+
temp_model = BillForward.const_get(type).new
|
295
|
+
temp_model.build_from_hash(value)
|
296
|
+
end
|
297
|
+
end
|
298
|
+
|
299
|
+
# Returns the string representation of the object
|
300
|
+
# @return [String] String presentation of the object
|
301
|
+
def to_s
|
302
|
+
to_hash.to_s
|
303
|
+
end
|
304
|
+
|
305
|
+
# to_body is an alias to to_hash (backward compatibility)
|
306
|
+
# @return [Hash] Returns the object in the form of hash
|
307
|
+
def to_body
|
308
|
+
to_hash
|
309
|
+
end
|
310
|
+
|
311
|
+
# Returns the object in the form of hash
|
312
|
+
# @return [Hash] Returns the object in the form of hash
|
313
|
+
def to_hash
|
314
|
+
hash = {}
|
315
|
+
self.class.attribute_map.each_pair do |attr, param|
|
316
|
+
value = self.send(attr)
|
317
|
+
next if value.nil?
|
318
|
+
hash[param] = _to_hash(value)
|
319
|
+
end
|
320
|
+
hash
|
321
|
+
end
|
322
|
+
|
323
|
+
# Outputs non-array value in the form of hash
|
324
|
+
# For object, use to_hash. Otherwise, just return the value
|
325
|
+
# @param [Object] value Any valid value
|
326
|
+
# @return [Hash] Returns the value in the form of hash
|
327
|
+
def _to_hash(value)
|
328
|
+
if value.is_a?(Array)
|
329
|
+
value.compact.map{ |v| _to_hash(v) }
|
330
|
+
elsif value.is_a?(Hash)
|
331
|
+
{}.tap do |hash|
|
332
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
333
|
+
end
|
334
|
+
elsif value.respond_to? :to_hash
|
335
|
+
value.to_hash
|
336
|
+
else
|
337
|
+
value
|
338
|
+
end
|
339
|
+
end
|
340
|
+
|
341
|
+
end
|
342
|
+
|
343
|
+
end
|