maxio-advanced-billing-sdk 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +40 -40
- data/lib/advanced_billing/controllers/advance_invoice_controller.rb +6 -4
- data/lib/advanced_billing/controllers/base_controller.rb +1 -1
- data/lib/advanced_billing/controllers/components_controller.rb +9 -58
- data/lib/advanced_billing/controllers/coupons_controller.rb +6 -115
- data/lib/advanced_billing/controllers/custom_fields_controller.rb +4 -4
- data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +5 -22
- data/lib/advanced_billing/controllers/insights_controller.rb +3 -4
- data/lib/advanced_billing/controllers/invoices_controller.rb +11 -0
- data/lib/advanced_billing/controllers/payment_profiles_controller.rb +26 -0
- data/lib/advanced_billing/controllers/product_families_controller.rb +5 -14
- data/lib/advanced_billing/controllers/product_price_points_controller.rb +3 -40
- data/lib/advanced_billing/controllers/products_controller.rb +5 -14
- data/lib/advanced_billing/controllers/subscription_components_controller.rb +16 -66
- data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +5 -15
- data/lib/advanced_billing/controllers/subscription_groups_controller.rb +6 -6
- data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +13 -20
- data/lib/advanced_billing/controllers/subscriptions_controller.rb +49 -14
- data/lib/advanced_billing/models/ach_agreement.rb +10 -0
- data/lib/advanced_billing/models/address_change.rb +0 -22
- data/lib/advanced_billing/models/agreement_acceptance.rb +10 -0
- data/lib/advanced_billing/models/allocation.rb +1 -3
- data/lib/advanced_billing/models/applied_credit_note_data.rb +10 -0
- data/lib/advanced_billing/models/apply_credit_note_event.rb +139 -0
- data/lib/advanced_billing/models/apply_credit_note_event_data.rb +3 -1
- data/lib/advanced_billing/models/apply_debit_note_event.rb +139 -0
- data/lib/advanced_billing/models/apply_debit_note_event_data.rb +36 -2
- data/lib/advanced_billing/models/apply_payment_event.rb +139 -0
- data/lib/advanced_billing/models/apply_payment_event_data.rb +21 -7
- data/lib/advanced_billing/models/backport_invoice_event.rb +139 -0
- data/lib/advanced_billing/models/bank_account_attributes.rb +10 -0
- data/lib/advanced_billing/models/billing_manifest.rb +5 -1
- data/lib/advanced_billing/models/billing_schedule.rb +10 -0
- data/lib/advanced_billing/models/change_chargeback_status_event.rb +141 -0
- data/lib/advanced_billing/models/change_chargeback_status_event_data.rb +73 -0
- data/lib/advanced_billing/models/change_invoice_collection_method_event.rb +141 -0
- data/lib/advanced_billing/models/change_invoice_status_event.rb +141 -0
- data/lib/advanced_billing/models/change_invoice_status_event_data.rb +131 -0
- data/lib/advanced_billing/models/chargeback_status.rb +29 -0
- data/lib/advanced_billing/models/component.rb +3 -13
- data/lib/advanced_billing/models/component_cost_data.rb +10 -0
- data/lib/advanced_billing/models/component_cost_data_rate_tier.rb +10 -0
- data/lib/advanced_billing/models/component_custom_price.rb +10 -0
- data/lib/advanced_billing/models/component_price_point.rb +2 -13
- data/lib/advanced_billing/models/component_price_point_item.rb +10 -0
- data/lib/advanced_billing/models/coupon.rb +4 -14
- data/lib/advanced_billing/models/create_component_price_point.rb +6 -2
- data/lib/advanced_billing/models/create_component_price_point_request.rb +1 -1
- data/lib/advanced_billing/models/create_component_price_points_request.rb +1 -1
- data/lib/advanced_billing/models/create_credit_note_event.rb +139 -0
- data/lib/advanced_billing/models/create_debit_note_event.rb +139 -0
- data/lib/advanced_billing/models/create_invoice_payment_application.rb +22 -0
- data/lib/advanced_billing/models/create_multi_invoice_payment.rb +6 -2
- data/lib/advanced_billing/models/create_offer_component.rb +11 -0
- data/lib/advanced_billing/models/create_payment_profile.rb +4 -4
- data/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +10 -4
- data/lib/advanced_billing/models/create_product_family.rb +14 -4
- data/lib/advanced_billing/models/create_subscription.rb +2 -2
- data/lib/advanced_billing/models/credit_card_attributes.rb +10 -0
- data/lib/advanced_billing/models/credit_note_application.rb +10 -0
- data/lib/advanced_billing/models/credit_note_line_item.rb +10 -0
- data/lib/advanced_billing/models/customer.rb +13 -1
- data/lib/advanced_billing/models/customer_attributes.rb +10 -0
- data/lib/advanced_billing/models/customer_change.rb +7 -22
- data/lib/advanced_billing/models/customer_custom_fields_change.rb +0 -22
- data/lib/advanced_billing/models/customer_payer_change.rb +0 -22
- data/lib/advanced_billing/models/debit_note.rb +351 -0
- data/lib/advanced_billing/models/debit_note_role.rb +23 -0
- data/lib/advanced_billing/models/debit_note_status.rb +29 -0
- data/lib/advanced_billing/models/deduct_service_credit.rb +10 -16
- data/lib/advanced_billing/models/dunner_data.rb +38 -0
- data/lib/advanced_billing/models/dunning_step_data.rb +34 -0
- data/lib/advanced_billing/models/dunning_step_reached.rb +12 -6
- data/lib/advanced_billing/models/failed_payment_event.rb +139 -0
- data/lib/advanced_billing/models/failed_payment_event_data.rb +132 -0
- data/lib/advanced_billing/models/group_billing.rb +10 -0
- data/lib/advanced_billing/models/group_settings.rb +4 -2
- data/lib/advanced_billing/models/group_target.rb +14 -0
- data/lib/advanced_billing/models/historic_usage.rb +109 -0
- data/lib/advanced_billing/models/include_null_or_not_null.rb +23 -0
- data/lib/advanced_billing/models/invoice.rb +18 -8
- data/lib/advanced_billing/models/invoice_address.rb +10 -0
- data/lib/advanced_billing/models/invoice_balance_item.rb +10 -0
- data/lib/advanced_billing/models/invoice_credit.rb +10 -0
- data/lib/advanced_billing/models/invoice_custom_field.rb +10 -0
- data/lib/advanced_billing/models/invoice_customer.rb +10 -0
- data/lib/advanced_billing/models/invoice_discount.rb +10 -0
- data/lib/advanced_billing/models/invoice_discount_breakout.rb +10 -0
- data/lib/advanced_billing/models/invoice_display_settings.rb +10 -0
- data/lib/advanced_billing/models/invoice_event_type.rb +3 -0
- data/lib/advanced_billing/models/invoice_issued.rb +6 -2
- data/lib/advanced_billing/models/invoice_line_item.rb +3 -3
- data/lib/advanced_billing/models/invoice_line_item_event_data.rb +10 -0
- data/lib/advanced_billing/models/invoice_line_item_pricing_detail.rb +10 -0
- data/lib/advanced_billing/models/invoice_payer.rb +10 -0
- data/lib/advanced_billing/models/invoice_payment.rb +10 -0
- data/lib/advanced_billing/models/invoice_payment_method.rb +10 -0
- data/lib/advanced_billing/models/invoice_pre_payment.rb +0 -10
- data/lib/advanced_billing/models/invoice_previous_balance.rb +10 -0
- data/lib/advanced_billing/models/invoice_refund.rb +10 -0
- data/lib/advanced_billing/models/invoice_seller.rb +10 -0
- data/lib/advanced_billing/models/invoice_status.rb +2 -2
- data/lib/advanced_billing/models/invoice_tax.rb +10 -0
- data/lib/advanced_billing/models/invoice_tax_breakout.rb +10 -0
- data/lib/advanced_billing/models/invoice_tax_component_breakout.rb +10 -0
- data/lib/advanced_billing/models/issue_invoice_event.rb +139 -0
- data/lib/advanced_billing/models/issue_invoice_event_data.rb +6 -6
- data/lib/advanced_billing/models/issue_service_credit.rb +10 -16
- data/lib/advanced_billing/models/item_price_point_changed.rb +8 -4
- data/lib/advanced_billing/models/item_price_point_data.rb +10 -0
- data/lib/advanced_billing/models/list_components_filter.rb +74 -0
- data/lib/advanced_billing/models/list_coupons_filter.rb +168 -0
- data/lib/advanced_billing/models/list_invoice_events_response.rb +14 -11
- data/lib/advanced_billing/models/{refund_prepayment_aggregated_error.rb → list_mrr_filter.rb} +14 -12
- data/lib/advanced_billing/models/{list_subscription_group_prepayment_date_field.rb → list_prepayment_date_field.rb} +4 -4
- data/lib/advanced_billing/models/list_prepayments_filter.rb +88 -0
- data/lib/advanced_billing/models/list_price_points_filter.rb +163 -0
- data/lib/advanced_billing/models/list_products_filter.rb +81 -0
- data/lib/advanced_billing/models/list_segments_filter.rb +103 -0
- data/lib/advanced_billing/models/list_subscription_components_filter.rb +74 -0
- data/lib/advanced_billing/models/list_subscription_components_for_site_filter.rb +84 -0
- data/lib/advanced_billing/models/list_subscription_components_include.rb +4 -1
- data/lib/advanced_billing/models/metafield_scope.rb +10 -0
- data/lib/advanced_billing/models/nested_subscription_group.rb +0 -10
- data/lib/advanced_billing/models/origin_invoice.rb +10 -0
- data/lib/advanced_billing/models/overage_pricing.rb +14 -0
- data/lib/advanced_billing/models/paid_invoice.rb +2 -2
- data/lib/advanced_billing/models/payer_attributes.rb +10 -0
- data/lib/advanced_billing/models/prepaid_component_price_point.rb +10 -0
- data/lib/advanced_billing/models/prepaid_product_price_point_filter.rb +56 -0
- data/lib/advanced_billing/models/prepaid_usage.rb +6 -2
- data/lib/advanced_billing/models/prepaid_usage_allocation_detail.rb +10 -0
- data/lib/advanced_billing/models/product.rb +5 -16
- data/lib/advanced_billing/models/product_price_point.rb +9 -0
- data/lib/advanced_billing/models/proforma_invoice.rb +2 -2
- data/lib/advanced_billing/models/proforma_invoice_issued.rb +6 -2
- data/lib/advanced_billing/models/reactivation_billing.rb +10 -0
- data/lib/advanced_billing/models/record_payment_response.rb +1 -13
- data/lib/advanced_billing/models/refund_invoice_event.rb +139 -0
- data/lib/advanced_billing/models/refund_invoice_event_data.rb +4 -2
- data/lib/advanced_billing/models/refund_invoice_request.rb +1 -1
- data/lib/advanced_billing/models/refund_prepayment.rb +3 -1
- data/lib/advanced_billing/models/remove_payment_event.rb +139 -0
- data/lib/advanced_billing/models/remove_payment_event_data.rb +1 -1
- data/lib/advanced_billing/models/segment_price.rb +10 -0
- data/lib/advanced_billing/models/subscription.rb +10 -16
- data/lib/advanced_billing/models/subscription_component.rb +26 -7
- data/lib/advanced_billing/models/subscription_component_subscription.rb +10 -0
- data/lib/advanced_billing/models/subscription_filter.rb +153 -0
- data/lib/advanced_billing/models/subscription_group.rb +2 -2
- data/lib/advanced_billing/models/subscription_group_bank_account.rb +10 -0
- data/lib/advanced_billing/models/subscription_group_component_custom_price.rb +10 -0
- data/lib/advanced_billing/models/subscription_group_prepayment_response.rb +3 -1
- data/lib/advanced_billing/models/subscription_group_signup.rb +2 -2
- data/lib/advanced_billing/models/subscription_group_signup_failure.rb +4 -2
- data/lib/advanced_billing/models/subscription_group_signup_failure_data.rb +10 -0
- data/lib/advanced_billing/models/subscription_group_signup_item.rb +10 -0
- data/lib/advanced_billing/models/subscription_group_signup_response.rb +2 -2
- data/lib/advanced_billing/models/subscription_group_signup_success.rb +8 -4
- data/lib/advanced_billing/models/subscription_group_signup_success_data.rb +50 -0
- data/lib/advanced_billing/models/update_customer.rb +12 -0
- data/lib/advanced_billing/models/update_subscription_component.rb +10 -0
- data/lib/advanced_billing/models/upsert_prepaid_configuration.rb +10 -0
- data/lib/advanced_billing/models/usage.rb +3 -1
- data/lib/advanced_billing/models/void_invoice_event.rb +139 -0
- data/lib/advanced_billing/models/void_invoice_event_data.rb +8 -7
- data/lib/advanced_billing/models/void_remainder_event.rb +139 -0
- data/lib/advanced_billing/models/void_remainder_event_data.rb +4 -2
- data/lib/advanced_billing/utilities/union_type_lookup.rb +69 -199
- data/lib/advanced_billing.rb +42 -18
- metadata +38 -17
- data/lib/advanced_billing/exceptions/refund_prepayment_aggregated_errors_response_exception.rb +0 -33
- data/lib/advanced_billing/models/billing_address.rb +0 -117
- data/lib/advanced_billing/models/credit_note1.rb +0 -419
- data/lib/advanced_billing/models/customer1.rb +0 -125
- data/lib/advanced_billing/models/invoice_event.rb +0 -124
- data/lib/advanced_billing/models/invoice_event_data.rb +0 -447
- data/lib/advanced_billing/models/invoice_event_payment.rb +0 -168
- data/lib/advanced_billing/models/invoice_event_payment1.rb +0 -160
- data/lib/advanced_billing/models/prepayment_aggregated_error.rb +0 -81
- data/lib/advanced_billing/models/price_point.rb +0 -216
- data/lib/advanced_billing/models/refund.rb +0 -138
- data/lib/advanced_billing/models/seller.rb +0 -92
- data/lib/advanced_billing/models/shipping_address.rb +0 -117
@@ -1,419 +0,0 @@
|
|
1
|
-
# advanced_billing
|
2
|
-
#
|
3
|
-
# This file was automatically generated by APIMATIC v2.0
|
4
|
-
# ( https://apimatic.io ).
|
5
|
-
|
6
|
-
module AdvancedBilling
|
7
|
-
# CreditNote1 Model.
|
8
|
-
class CreditNote1 < BaseModel
|
9
|
-
SKIP = Object.new
|
10
|
-
private_constant :SKIP
|
11
|
-
|
12
|
-
# Unique identifier for the credit note. It is generated automatically by
|
13
|
-
# Chargify and has the prefix "cn_" followed by alphanumeric characters.
|
14
|
-
# @return [String]
|
15
|
-
attr_accessor :uid
|
16
|
-
|
17
|
-
# ID of the site to which the credit note belongs.
|
18
|
-
# @return [Integer]
|
19
|
-
attr_accessor :site_id
|
20
|
-
|
21
|
-
# ID of the customer to which the credit note belongs.
|
22
|
-
# @return [Integer]
|
23
|
-
attr_accessor :customer_id
|
24
|
-
|
25
|
-
# ID of the subscription that generated the credit note.
|
26
|
-
# @return [Integer]
|
27
|
-
attr_accessor :subscription_id
|
28
|
-
|
29
|
-
# A unique, identifying string that appears on the credit note and in places
|
30
|
-
# it is referenced.
|
31
|
-
# While the UID is long and not appropriate to show to customers, the number
|
32
|
-
# is usually shorter and consumable by the customer and the merchant alike.
|
33
|
-
# @return [String]
|
34
|
-
attr_accessor :number
|
35
|
-
|
36
|
-
# A monotonically increasing number assigned to credit notes as they are
|
37
|
-
# created. This number is unique within a site and can be used to sort and
|
38
|
-
# order credit notes.
|
39
|
-
# @return [Integer]
|
40
|
-
attr_accessor :sequence_number
|
41
|
-
|
42
|
-
# Date the credit note was issued to the customer. This is the date that
|
43
|
-
# the credit was made available for application, and may come before it is
|
44
|
-
# fully applied.
|
45
|
-
# The format is `"YYYY-MM-DD"`.
|
46
|
-
# @return [Date]
|
47
|
-
attr_accessor :issue_date
|
48
|
-
|
49
|
-
# Credit notes are applied to invoices to offset invoiced amounts - they
|
50
|
-
# reduce the amount due. This field is the date the credit note became fully
|
51
|
-
# applied to invoices.
|
52
|
-
# If the credit note has been partially applied, this field will not have a
|
53
|
-
# value until it has been fully applied.
|
54
|
-
# The format is `"YYYY-MM-DD"`.
|
55
|
-
# @return [Date]
|
56
|
-
attr_accessor :applied_date
|
57
|
-
|
58
|
-
# Current status of the credit note.
|
59
|
-
# @return [CreditNoteStatus]
|
60
|
-
attr_accessor :status
|
61
|
-
|
62
|
-
# The ISO 4217 currency code (3 character string) representing the currency
|
63
|
-
# of the credit note amount fields.
|
64
|
-
# @return [String]
|
65
|
-
attr_accessor :currency
|
66
|
-
|
67
|
-
# The memo printed on credit note, which is a description of the reason for
|
68
|
-
# the credit.
|
69
|
-
# @return [String]
|
70
|
-
attr_accessor :memo
|
71
|
-
|
72
|
-
# The memo printed on credit note, which is a description of the reason for
|
73
|
-
# the credit.
|
74
|
-
# @return [Seller]
|
75
|
-
attr_accessor :seller
|
76
|
-
|
77
|
-
# The memo printed on credit note, which is a description of the reason for
|
78
|
-
# the credit.
|
79
|
-
# @return [Customer1]
|
80
|
-
attr_accessor :customer
|
81
|
-
|
82
|
-
# The memo printed on credit note, which is a description of the reason for
|
83
|
-
# the credit.
|
84
|
-
# @return [BillingAddress]
|
85
|
-
attr_accessor :billing_address
|
86
|
-
|
87
|
-
# The memo printed on credit note, which is a description of the reason for
|
88
|
-
# the credit.
|
89
|
-
# @return [ShippingAddress]
|
90
|
-
attr_accessor :shipping_address
|
91
|
-
|
92
|
-
# Subtotal of the credit note, which is the sum of all line items before
|
93
|
-
# discounts or taxes. Note that this is a positive amount representing the
|
94
|
-
# credit back to the customer.
|
95
|
-
# @return [String]
|
96
|
-
attr_accessor :subtotal_amount
|
97
|
-
|
98
|
-
# Total discount applied to the credit note. Note that this is a positive
|
99
|
-
# amount representing the discount amount being credited back to the
|
100
|
-
# customer (i.e. a credit on an earlier discount). For example, if the
|
101
|
-
# original purchase was $1.00 and the original discount was $0.10, a credit
|
102
|
-
# of $0.50 of the original purchase (half) would have a discount credit of
|
103
|
-
# $0.05 (also half).
|
104
|
-
# @return [String]
|
105
|
-
attr_accessor :discount_amount
|
106
|
-
|
107
|
-
# Total tax of the credit note. Note that this is a positive amount
|
108
|
-
# representing a previously taxex amount being credited back to the customer
|
109
|
-
# (i.e. a credit of an earlier tax). For example, if the original purchase
|
110
|
-
# was $1.00 and the original tax was $0.10, a credit of $0.50 of the
|
111
|
-
# original purchase (half) would also have a tax credit of $0.05 (also
|
112
|
-
# half).
|
113
|
-
# @return [String]
|
114
|
-
attr_accessor :tax_amount
|
115
|
-
|
116
|
-
# The credit note total, which is `subtotal_amount - discount_amount +
|
117
|
-
# tax_amount`.'
|
118
|
-
# @return [String]
|
119
|
-
attr_accessor :total_amount
|
120
|
-
|
121
|
-
# The amount of the credit note that has already been applied to invoices.
|
122
|
-
# @return [String]
|
123
|
-
attr_accessor :applied_amount
|
124
|
-
|
125
|
-
# The amount of the credit note remaining to be applied to invoices, which
|
126
|
-
# is `total_amount - applied_amount`.
|
127
|
-
# @return [String]
|
128
|
-
attr_accessor :remaining_amount
|
129
|
-
|
130
|
-
# Line items on the credit note.
|
131
|
-
# @return [Array[CreditNoteLineItem]]
|
132
|
-
attr_accessor :line_items
|
133
|
-
|
134
|
-
# Line items on the credit note.
|
135
|
-
# @return [Array[InvoiceDiscount]]
|
136
|
-
attr_accessor :discounts
|
137
|
-
|
138
|
-
# Line items on the credit note.
|
139
|
-
# @return [Array[InvoiceTax]]
|
140
|
-
attr_accessor :taxes
|
141
|
-
|
142
|
-
# Line items on the credit note.
|
143
|
-
# @return [Array[CreditNoteApplication]]
|
144
|
-
attr_accessor :applications
|
145
|
-
|
146
|
-
# Line items on the credit note.
|
147
|
-
# @return [Array[InvoiceRefund]]
|
148
|
-
attr_accessor :refunds
|
149
|
-
|
150
|
-
# An array of origin invoices for the credit note. Learn more about [Origin
|
151
|
-
# Invoice from our
|
152
|
-
# docs](https://chargify.zendesk.com/hc/en-us/articles/4407753036699#origin-
|
153
|
-
# invoices)
|
154
|
-
# @return [Array[OriginInvoice]]
|
155
|
-
attr_accessor :origin_invoices
|
156
|
-
|
157
|
-
# A mapping from model property names to API property names.
|
158
|
-
def self.names
|
159
|
-
@_hash = {} if @_hash.nil?
|
160
|
-
@_hash['uid'] = 'uid'
|
161
|
-
@_hash['site_id'] = 'site_id'
|
162
|
-
@_hash['customer_id'] = 'customer_id'
|
163
|
-
@_hash['subscription_id'] = 'subscription_id'
|
164
|
-
@_hash['number'] = 'number'
|
165
|
-
@_hash['sequence_number'] = 'sequence_number'
|
166
|
-
@_hash['issue_date'] = 'issue_date'
|
167
|
-
@_hash['applied_date'] = 'applied_date'
|
168
|
-
@_hash['status'] = 'status'
|
169
|
-
@_hash['currency'] = 'currency'
|
170
|
-
@_hash['memo'] = 'memo'
|
171
|
-
@_hash['seller'] = 'seller'
|
172
|
-
@_hash['customer'] = 'customer'
|
173
|
-
@_hash['billing_address'] = 'billing_address'
|
174
|
-
@_hash['shipping_address'] = 'shipping_address'
|
175
|
-
@_hash['subtotal_amount'] = 'subtotal_amount'
|
176
|
-
@_hash['discount_amount'] = 'discount_amount'
|
177
|
-
@_hash['tax_amount'] = 'tax_amount'
|
178
|
-
@_hash['total_amount'] = 'total_amount'
|
179
|
-
@_hash['applied_amount'] = 'applied_amount'
|
180
|
-
@_hash['remaining_amount'] = 'remaining_amount'
|
181
|
-
@_hash['line_items'] = 'line_items'
|
182
|
-
@_hash['discounts'] = 'discounts'
|
183
|
-
@_hash['taxes'] = 'taxes'
|
184
|
-
@_hash['applications'] = 'applications'
|
185
|
-
@_hash['refunds'] = 'refunds'
|
186
|
-
@_hash['origin_invoices'] = 'origin_invoices'
|
187
|
-
@_hash
|
188
|
-
end
|
189
|
-
|
190
|
-
# An array for optional fields
|
191
|
-
def self.optionals
|
192
|
-
%w[
|
193
|
-
uid
|
194
|
-
site_id
|
195
|
-
customer_id
|
196
|
-
subscription_id
|
197
|
-
number
|
198
|
-
sequence_number
|
199
|
-
issue_date
|
200
|
-
applied_date
|
201
|
-
status
|
202
|
-
currency
|
203
|
-
memo
|
204
|
-
seller
|
205
|
-
customer
|
206
|
-
billing_address
|
207
|
-
shipping_address
|
208
|
-
subtotal_amount
|
209
|
-
discount_amount
|
210
|
-
tax_amount
|
211
|
-
total_amount
|
212
|
-
applied_amount
|
213
|
-
remaining_amount
|
214
|
-
line_items
|
215
|
-
discounts
|
216
|
-
taxes
|
217
|
-
applications
|
218
|
-
refunds
|
219
|
-
origin_invoices
|
220
|
-
]
|
221
|
-
end
|
222
|
-
|
223
|
-
# An array for nullable fields
|
224
|
-
def self.nullables
|
225
|
-
[]
|
226
|
-
end
|
227
|
-
|
228
|
-
def initialize(uid = SKIP,
|
229
|
-
site_id = SKIP,
|
230
|
-
customer_id = SKIP,
|
231
|
-
subscription_id = SKIP,
|
232
|
-
number = SKIP,
|
233
|
-
sequence_number = SKIP,
|
234
|
-
issue_date = SKIP,
|
235
|
-
applied_date = SKIP,
|
236
|
-
status = SKIP,
|
237
|
-
currency = SKIP,
|
238
|
-
memo = SKIP,
|
239
|
-
seller = SKIP,
|
240
|
-
customer = SKIP,
|
241
|
-
billing_address = SKIP,
|
242
|
-
shipping_address = SKIP,
|
243
|
-
subtotal_amount = SKIP,
|
244
|
-
discount_amount = SKIP,
|
245
|
-
tax_amount = SKIP,
|
246
|
-
total_amount = SKIP,
|
247
|
-
applied_amount = SKIP,
|
248
|
-
remaining_amount = SKIP,
|
249
|
-
line_items = SKIP,
|
250
|
-
discounts = SKIP,
|
251
|
-
taxes = SKIP,
|
252
|
-
applications = SKIP,
|
253
|
-
refunds = SKIP,
|
254
|
-
origin_invoices = SKIP,
|
255
|
-
additional_properties = {})
|
256
|
-
@uid = uid unless uid == SKIP
|
257
|
-
@site_id = site_id unless site_id == SKIP
|
258
|
-
@customer_id = customer_id unless customer_id == SKIP
|
259
|
-
@subscription_id = subscription_id unless subscription_id == SKIP
|
260
|
-
@number = number unless number == SKIP
|
261
|
-
@sequence_number = sequence_number unless sequence_number == SKIP
|
262
|
-
@issue_date = issue_date unless issue_date == SKIP
|
263
|
-
@applied_date = applied_date unless applied_date == SKIP
|
264
|
-
@status = status unless status == SKIP
|
265
|
-
@currency = currency unless currency == SKIP
|
266
|
-
@memo = memo unless memo == SKIP
|
267
|
-
@seller = seller unless seller == SKIP
|
268
|
-
@customer = customer unless customer == SKIP
|
269
|
-
@billing_address = billing_address unless billing_address == SKIP
|
270
|
-
@shipping_address = shipping_address unless shipping_address == SKIP
|
271
|
-
@subtotal_amount = subtotal_amount unless subtotal_amount == SKIP
|
272
|
-
@discount_amount = discount_amount unless discount_amount == SKIP
|
273
|
-
@tax_amount = tax_amount unless tax_amount == SKIP
|
274
|
-
@total_amount = total_amount unless total_amount == SKIP
|
275
|
-
@applied_amount = applied_amount unless applied_amount == SKIP
|
276
|
-
@remaining_amount = remaining_amount unless remaining_amount == SKIP
|
277
|
-
@line_items = line_items unless line_items == SKIP
|
278
|
-
@discounts = discounts unless discounts == SKIP
|
279
|
-
@taxes = taxes unless taxes == SKIP
|
280
|
-
@applications = applications unless applications == SKIP
|
281
|
-
@refunds = refunds unless refunds == SKIP
|
282
|
-
@origin_invoices = origin_invoices unless origin_invoices == SKIP
|
283
|
-
|
284
|
-
# Add additional model properties to the instance.
|
285
|
-
additional_properties.each do |_name, _value|
|
286
|
-
instance_variable_set("@#{_name}", _value)
|
287
|
-
end
|
288
|
-
end
|
289
|
-
|
290
|
-
# Creates an instance of the object from a hash.
|
291
|
-
def self.from_hash(hash)
|
292
|
-
return nil unless hash
|
293
|
-
|
294
|
-
# Extract variables from the hash.
|
295
|
-
uid = hash.key?('uid') ? hash['uid'] : SKIP
|
296
|
-
site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
|
297
|
-
customer_id = hash.key?('customer_id') ? hash['customer_id'] : SKIP
|
298
|
-
subscription_id =
|
299
|
-
hash.key?('subscription_id') ? hash['subscription_id'] : SKIP
|
300
|
-
number = hash.key?('number') ? hash['number'] : SKIP
|
301
|
-
sequence_number =
|
302
|
-
hash.key?('sequence_number') ? hash['sequence_number'] : SKIP
|
303
|
-
issue_date = hash.key?('issue_date') ? hash['issue_date'] : SKIP
|
304
|
-
applied_date = hash.key?('applied_date') ? hash['applied_date'] : SKIP
|
305
|
-
status = hash.key?('status') ? hash['status'] : SKIP
|
306
|
-
currency = hash.key?('currency') ? hash['currency'] : SKIP
|
307
|
-
memo = hash.key?('memo') ? hash['memo'] : SKIP
|
308
|
-
seller = Seller.from_hash(hash['seller']) if hash['seller']
|
309
|
-
customer = Customer1.from_hash(hash['customer']) if hash['customer']
|
310
|
-
billing_address = BillingAddress.from_hash(hash['billing_address']) if
|
311
|
-
hash['billing_address']
|
312
|
-
shipping_address = ShippingAddress.from_hash(hash['shipping_address']) if
|
313
|
-
hash['shipping_address']
|
314
|
-
subtotal_amount =
|
315
|
-
hash.key?('subtotal_amount') ? hash['subtotal_amount'] : SKIP
|
316
|
-
discount_amount =
|
317
|
-
hash.key?('discount_amount') ? hash['discount_amount'] : SKIP
|
318
|
-
tax_amount = hash.key?('tax_amount') ? hash['tax_amount'] : SKIP
|
319
|
-
total_amount = hash.key?('total_amount') ? hash['total_amount'] : SKIP
|
320
|
-
applied_amount =
|
321
|
-
hash.key?('applied_amount') ? hash['applied_amount'] : SKIP
|
322
|
-
remaining_amount =
|
323
|
-
hash.key?('remaining_amount') ? hash['remaining_amount'] : SKIP
|
324
|
-
# Parameter is an array, so we need to iterate through it
|
325
|
-
line_items = nil
|
326
|
-
unless hash['line_items'].nil?
|
327
|
-
line_items = []
|
328
|
-
hash['line_items'].each do |structure|
|
329
|
-
line_items << (CreditNoteLineItem.from_hash(structure) if structure)
|
330
|
-
end
|
331
|
-
end
|
332
|
-
|
333
|
-
line_items = SKIP unless hash.key?('line_items')
|
334
|
-
# Parameter is an array, so we need to iterate through it
|
335
|
-
discounts = nil
|
336
|
-
unless hash['discounts'].nil?
|
337
|
-
discounts = []
|
338
|
-
hash['discounts'].each do |structure|
|
339
|
-
discounts << (InvoiceDiscount.from_hash(structure) if structure)
|
340
|
-
end
|
341
|
-
end
|
342
|
-
|
343
|
-
discounts = SKIP unless hash.key?('discounts')
|
344
|
-
# Parameter is an array, so we need to iterate through it
|
345
|
-
taxes = nil
|
346
|
-
unless hash['taxes'].nil?
|
347
|
-
taxes = []
|
348
|
-
hash['taxes'].each do |structure|
|
349
|
-
taxes << (InvoiceTax.from_hash(structure) if structure)
|
350
|
-
end
|
351
|
-
end
|
352
|
-
|
353
|
-
taxes = SKIP unless hash.key?('taxes')
|
354
|
-
# Parameter is an array, so we need to iterate through it
|
355
|
-
applications = nil
|
356
|
-
unless hash['applications'].nil?
|
357
|
-
applications = []
|
358
|
-
hash['applications'].each do |structure|
|
359
|
-
applications << (CreditNoteApplication.from_hash(structure) if structure)
|
360
|
-
end
|
361
|
-
end
|
362
|
-
|
363
|
-
applications = SKIP unless hash.key?('applications')
|
364
|
-
# Parameter is an array, so we need to iterate through it
|
365
|
-
refunds = nil
|
366
|
-
unless hash['refunds'].nil?
|
367
|
-
refunds = []
|
368
|
-
hash['refunds'].each do |structure|
|
369
|
-
refunds << (InvoiceRefund.from_hash(structure) if structure)
|
370
|
-
end
|
371
|
-
end
|
372
|
-
|
373
|
-
refunds = SKIP unless hash.key?('refunds')
|
374
|
-
# Parameter is an array, so we need to iterate through it
|
375
|
-
origin_invoices = nil
|
376
|
-
unless hash['origin_invoices'].nil?
|
377
|
-
origin_invoices = []
|
378
|
-
hash['origin_invoices'].each do |structure|
|
379
|
-
origin_invoices << (OriginInvoice.from_hash(structure) if structure)
|
380
|
-
end
|
381
|
-
end
|
382
|
-
|
383
|
-
origin_invoices = SKIP unless hash.key?('origin_invoices')
|
384
|
-
|
385
|
-
# Clean out expected properties from Hash.
|
386
|
-
names.each_value { |k| hash.delete(k) }
|
387
|
-
|
388
|
-
# Create object from extracted values.
|
389
|
-
CreditNote1.new(uid,
|
390
|
-
site_id,
|
391
|
-
customer_id,
|
392
|
-
subscription_id,
|
393
|
-
number,
|
394
|
-
sequence_number,
|
395
|
-
issue_date,
|
396
|
-
applied_date,
|
397
|
-
status,
|
398
|
-
currency,
|
399
|
-
memo,
|
400
|
-
seller,
|
401
|
-
customer,
|
402
|
-
billing_address,
|
403
|
-
shipping_address,
|
404
|
-
subtotal_amount,
|
405
|
-
discount_amount,
|
406
|
-
tax_amount,
|
407
|
-
total_amount,
|
408
|
-
applied_amount,
|
409
|
-
remaining_amount,
|
410
|
-
line_items,
|
411
|
-
discounts,
|
412
|
-
taxes,
|
413
|
-
applications,
|
414
|
-
refunds,
|
415
|
-
origin_invoices,
|
416
|
-
hash)
|
417
|
-
end
|
418
|
-
end
|
419
|
-
end
|
@@ -1,125 +0,0 @@
|
|
1
|
-
# advanced_billing
|
2
|
-
#
|
3
|
-
# This file was automatically generated by APIMATIC v2.0
|
4
|
-
# ( https://apimatic.io ).
|
5
|
-
|
6
|
-
module AdvancedBilling
|
7
|
-
# Customer1 Model.
|
8
|
-
class Customer1 < BaseModel
|
9
|
-
SKIP = Object.new
|
10
|
-
private_constant :SKIP
|
11
|
-
|
12
|
-
# TODO: Write general description for this method
|
13
|
-
# @return [Integer]
|
14
|
-
attr_accessor :chargify_id
|
15
|
-
|
16
|
-
# TODO: Write general description for this method
|
17
|
-
# @return [String]
|
18
|
-
attr_accessor :first_name
|
19
|
-
|
20
|
-
# TODO: Write general description for this method
|
21
|
-
# @return [String]
|
22
|
-
attr_accessor :last_name
|
23
|
-
|
24
|
-
# TODO: Write general description for this method
|
25
|
-
# @return [String]
|
26
|
-
attr_accessor :organization
|
27
|
-
|
28
|
-
# TODO: Write general description for this method
|
29
|
-
# @return [String]
|
30
|
-
attr_accessor :email
|
31
|
-
|
32
|
-
# TODO: Write general description for this method
|
33
|
-
# @return [String]
|
34
|
-
attr_accessor :vat_number
|
35
|
-
|
36
|
-
# TODO: Write general description for this method
|
37
|
-
# @return [String]
|
38
|
-
attr_accessor :reference
|
39
|
-
|
40
|
-
# A mapping from model property names to API property names.
|
41
|
-
def self.names
|
42
|
-
@_hash = {} if @_hash.nil?
|
43
|
-
@_hash['chargify_id'] = 'chargify_id'
|
44
|
-
@_hash['first_name'] = 'first_name'
|
45
|
-
@_hash['last_name'] = 'last_name'
|
46
|
-
@_hash['organization'] = 'organization'
|
47
|
-
@_hash['email'] = 'email'
|
48
|
-
@_hash['vat_number'] = 'vat_number'
|
49
|
-
@_hash['reference'] = 'reference'
|
50
|
-
@_hash
|
51
|
-
end
|
52
|
-
|
53
|
-
# An array for optional fields
|
54
|
-
def self.optionals
|
55
|
-
%w[
|
56
|
-
chargify_id
|
57
|
-
first_name
|
58
|
-
last_name
|
59
|
-
organization
|
60
|
-
email
|
61
|
-
vat_number
|
62
|
-
reference
|
63
|
-
]
|
64
|
-
end
|
65
|
-
|
66
|
-
# An array for nullable fields
|
67
|
-
def self.nullables
|
68
|
-
%w[
|
69
|
-
chargify_id
|
70
|
-
organization
|
71
|
-
vat_number
|
72
|
-
reference
|
73
|
-
]
|
74
|
-
end
|
75
|
-
|
76
|
-
def initialize(chargify_id = SKIP,
|
77
|
-
first_name = SKIP,
|
78
|
-
last_name = SKIP,
|
79
|
-
organization = SKIP,
|
80
|
-
email = SKIP,
|
81
|
-
vat_number = SKIP,
|
82
|
-
reference = SKIP,
|
83
|
-
additional_properties = {})
|
84
|
-
@chargify_id = chargify_id unless chargify_id == SKIP
|
85
|
-
@first_name = first_name unless first_name == SKIP
|
86
|
-
@last_name = last_name unless last_name == SKIP
|
87
|
-
@organization = organization unless organization == SKIP
|
88
|
-
@email = email unless email == SKIP
|
89
|
-
@vat_number = vat_number unless vat_number == SKIP
|
90
|
-
@reference = reference unless reference == SKIP
|
91
|
-
|
92
|
-
# Add additional model properties to the instance.
|
93
|
-
additional_properties.each do |_name, _value|
|
94
|
-
instance_variable_set("@#{_name}", _value)
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
# Creates an instance of the object from a hash.
|
99
|
-
def self.from_hash(hash)
|
100
|
-
return nil unless hash
|
101
|
-
|
102
|
-
# Extract variables from the hash.
|
103
|
-
chargify_id = hash.key?('chargify_id') ? hash['chargify_id'] : SKIP
|
104
|
-
first_name = hash.key?('first_name') ? hash['first_name'] : SKIP
|
105
|
-
last_name = hash.key?('last_name') ? hash['last_name'] : SKIP
|
106
|
-
organization = hash.key?('organization') ? hash['organization'] : SKIP
|
107
|
-
email = hash.key?('email') ? hash['email'] : SKIP
|
108
|
-
vat_number = hash.key?('vat_number') ? hash['vat_number'] : SKIP
|
109
|
-
reference = hash.key?('reference') ? hash['reference'] : SKIP
|
110
|
-
|
111
|
-
# Clean out expected properties from Hash.
|
112
|
-
names.each_value { |k| hash.delete(k) }
|
113
|
-
|
114
|
-
# Create object from extracted values.
|
115
|
-
Customer1.new(chargify_id,
|
116
|
-
first_name,
|
117
|
-
last_name,
|
118
|
-
organization,
|
119
|
-
email,
|
120
|
-
vat_number,
|
121
|
-
reference,
|
122
|
-
hash)
|
123
|
-
end
|
124
|
-
end
|
125
|
-
end
|
@@ -1,124 +0,0 @@
|
|
1
|
-
# advanced_billing
|
2
|
-
#
|
3
|
-
# This file was automatically generated by APIMATIC v2.0
|
4
|
-
# ( https://apimatic.io ).
|
5
|
-
|
6
|
-
require 'date'
|
7
|
-
module AdvancedBilling
|
8
|
-
# InvoiceEvent Model.
|
9
|
-
class InvoiceEvent < BaseModel
|
10
|
-
SKIP = Object.new
|
11
|
-
private_constant :SKIP
|
12
|
-
|
13
|
-
# TODO: Write general description for this method
|
14
|
-
# @return [Integer]
|
15
|
-
attr_accessor :id
|
16
|
-
|
17
|
-
# Invoice Event Type
|
18
|
-
# @return [InvoiceEventType]
|
19
|
-
attr_accessor :event_type
|
20
|
-
|
21
|
-
# The event data is the data that, when combined with the command, results
|
22
|
-
# in the output invoice found in the invoice field.
|
23
|
-
# @return [InvoiceEventData]
|
24
|
-
attr_accessor :event_data
|
25
|
-
|
26
|
-
# The event data is the data that, when combined with the command, results
|
27
|
-
# in the output invoice found in the invoice field.
|
28
|
-
# @return [DateTime]
|
29
|
-
attr_accessor :timestamp
|
30
|
-
|
31
|
-
# The event data is the data that, when combined with the command, results
|
32
|
-
# in the output invoice found in the invoice field.
|
33
|
-
# @return [Invoice]
|
34
|
-
attr_accessor :invoice
|
35
|
-
|
36
|
-
# A mapping from model property names to API property names.
|
37
|
-
def self.names
|
38
|
-
@_hash = {} if @_hash.nil?
|
39
|
-
@_hash['id'] = 'id'
|
40
|
-
@_hash['event_type'] = 'event_type'
|
41
|
-
@_hash['event_data'] = 'event_data'
|
42
|
-
@_hash['timestamp'] = 'timestamp'
|
43
|
-
@_hash['invoice'] = 'invoice'
|
44
|
-
@_hash
|
45
|
-
end
|
46
|
-
|
47
|
-
# An array for optional fields
|
48
|
-
def self.optionals
|
49
|
-
%w[
|
50
|
-
id
|
51
|
-
event_type
|
52
|
-
event_data
|
53
|
-
timestamp
|
54
|
-
invoice
|
55
|
-
]
|
56
|
-
end
|
57
|
-
|
58
|
-
# An array for nullable fields
|
59
|
-
def self.nullables
|
60
|
-
[]
|
61
|
-
end
|
62
|
-
|
63
|
-
def initialize(id = SKIP,
|
64
|
-
event_type = SKIP,
|
65
|
-
event_data = SKIP,
|
66
|
-
timestamp = SKIP,
|
67
|
-
invoice = SKIP,
|
68
|
-
additional_properties = {})
|
69
|
-
@id = id unless id == SKIP
|
70
|
-
@event_type = event_type unless event_type == SKIP
|
71
|
-
@event_data = event_data unless event_data == SKIP
|
72
|
-
@timestamp = timestamp unless timestamp == SKIP
|
73
|
-
@invoice = invoice unless invoice == SKIP
|
74
|
-
|
75
|
-
# Add additional model properties to the instance.
|
76
|
-
additional_properties.each do |_name, _value|
|
77
|
-
instance_variable_set("@#{_name}", _value)
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
# Creates an instance of the object from a hash.
|
82
|
-
def self.from_hash(hash)
|
83
|
-
return nil unless hash
|
84
|
-
|
85
|
-
# Extract variables from the hash.
|
86
|
-
id = hash.key?('id') ? hash['id'] : SKIP
|
87
|
-
event_type = hash.key?('event_type') ? hash['event_type'] : SKIP
|
88
|
-
event_data = hash.key?('event_data') ? APIHelper.deserialize_union_type(
|
89
|
-
UnionTypeLookUp.get(:InvoiceEventEventData), hash['event_data']
|
90
|
-
) : SKIP
|
91
|
-
timestamp = if hash.key?('timestamp')
|
92
|
-
(DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
|
93
|
-
else
|
94
|
-
SKIP
|
95
|
-
end
|
96
|
-
invoice = Invoice.from_hash(hash['invoice']) if hash['invoice']
|
97
|
-
|
98
|
-
# Clean out expected properties from Hash.
|
99
|
-
names.each_value { |k| hash.delete(k) }
|
100
|
-
|
101
|
-
# Create object from extracted values.
|
102
|
-
InvoiceEvent.new(id,
|
103
|
-
event_type,
|
104
|
-
event_data,
|
105
|
-
timestamp,
|
106
|
-
invoice,
|
107
|
-
hash)
|
108
|
-
end
|
109
|
-
|
110
|
-
def to_custom_timestamp
|
111
|
-
DateTimeHelper.to_rfc3339(timestamp)
|
112
|
-
end
|
113
|
-
|
114
|
-
# Validates an instance of the object from a given value.
|
115
|
-
# @param [InvoiceEvent | Hash] The value against the validation is performed.
|
116
|
-
def self.validate(value)
|
117
|
-
return true if value.instance_of? self
|
118
|
-
|
119
|
-
return false unless value.instance_of? Hash
|
120
|
-
|
121
|
-
true
|
122
|
-
end
|
123
|
-
end
|
124
|
-
end
|