maxio-advanced-billing-sdk 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -0,0 +1,139 @@
|
|
|
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
|
+
# BackportInvoiceEvent Model.
|
|
9
|
+
class BackportInvoiceEvent < 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
|
+
# TODO: Write general description for this method
|
|
18
|
+
# @return [DateTime]
|
|
19
|
+
attr_accessor :timestamp
|
|
20
|
+
|
|
21
|
+
# TODO: Write general description for this method
|
|
22
|
+
# @return [Invoice]
|
|
23
|
+
attr_accessor :invoice
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for this method
|
|
26
|
+
# @return [InvoiceEventType]
|
|
27
|
+
attr_accessor :event_type
|
|
28
|
+
|
|
29
|
+
# Example schema for an `backport_invoice` event
|
|
30
|
+
# @return [Invoice]
|
|
31
|
+
attr_accessor :event_data
|
|
32
|
+
|
|
33
|
+
# A mapping from model property names to API property names.
|
|
34
|
+
def self.names
|
|
35
|
+
@_hash = {} if @_hash.nil?
|
|
36
|
+
@_hash['id'] = 'id'
|
|
37
|
+
@_hash['timestamp'] = 'timestamp'
|
|
38
|
+
@_hash['invoice'] = 'invoice'
|
|
39
|
+
@_hash['event_type'] = 'event_type'
|
|
40
|
+
@_hash['event_data'] = 'event_data'
|
|
41
|
+
@_hash
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# An array for optional fields
|
|
45
|
+
def self.optionals
|
|
46
|
+
[]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# An array for nullable fields
|
|
50
|
+
def self.nullables
|
|
51
|
+
[]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def initialize(id = nil,
|
|
55
|
+
timestamp = nil,
|
|
56
|
+
invoice = nil,
|
|
57
|
+
event_type = InvoiceEventType::BACKPORT_INVOICE,
|
|
58
|
+
event_data = nil,
|
|
59
|
+
additional_properties = {})
|
|
60
|
+
@id = id
|
|
61
|
+
@timestamp = timestamp
|
|
62
|
+
@invoice = invoice
|
|
63
|
+
@event_type = event_type
|
|
64
|
+
@event_data = event_data
|
|
65
|
+
|
|
66
|
+
# Add additional model properties to the instance.
|
|
67
|
+
additional_properties.each do |_name, _value|
|
|
68
|
+
instance_variable_set("@#{_name}", _value)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Creates an instance of the object from a hash.
|
|
73
|
+
def self.from_hash(hash)
|
|
74
|
+
return nil unless hash
|
|
75
|
+
|
|
76
|
+
# Extract variables from the hash.
|
|
77
|
+
id = hash.key?('id') ? hash['id'] : nil
|
|
78
|
+
timestamp = if hash.key?('timestamp')
|
|
79
|
+
(DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
|
|
80
|
+
end
|
|
81
|
+
invoice = Invoice.from_hash(hash['invoice']) if hash['invoice']
|
|
82
|
+
event_type = hash['event_type'] ||= InvoiceEventType::BACKPORT_INVOICE
|
|
83
|
+
event_data = Invoice.from_hash(hash['event_data']) if hash['event_data']
|
|
84
|
+
|
|
85
|
+
# Clean out expected properties from Hash.
|
|
86
|
+
names.each_value { |k| hash.delete(k) }
|
|
87
|
+
|
|
88
|
+
# Create object from extracted values.
|
|
89
|
+
BackportInvoiceEvent.new(id,
|
|
90
|
+
timestamp,
|
|
91
|
+
invoice,
|
|
92
|
+
event_type,
|
|
93
|
+
event_data,
|
|
94
|
+
hash)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def to_custom_timestamp
|
|
98
|
+
DateTimeHelper.to_rfc3339(timestamp)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Validates an instance of the object from a given value.
|
|
102
|
+
# @param [BackportInvoiceEvent | Hash] The value against the validation is performed.
|
|
103
|
+
def self.validate(value)
|
|
104
|
+
if value.instance_of? self
|
|
105
|
+
return (
|
|
106
|
+
APIHelper.valid_type?(value.id,
|
|
107
|
+
->(val) { val.instance_of? Integer }) and
|
|
108
|
+
APIHelper.valid_type?(value.timestamp,
|
|
109
|
+
->(val) { val.instance_of? DateTime }) and
|
|
110
|
+
APIHelper.valid_type?(value.invoice,
|
|
111
|
+
->(val) { Invoice.validate(val) },
|
|
112
|
+
is_model_hash: true) and
|
|
113
|
+
APIHelper.valid_type?(value.event_type,
|
|
114
|
+
->(val) { InvoiceEventType.validate(val) }) and
|
|
115
|
+
APIHelper.valid_type?(value.event_data,
|
|
116
|
+
->(val) { Invoice.validate(val) },
|
|
117
|
+
is_model_hash: true)
|
|
118
|
+
)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
return false unless value.instance_of? Hash
|
|
122
|
+
|
|
123
|
+
(
|
|
124
|
+
APIHelper.valid_type?(value['id'],
|
|
125
|
+
->(val) { val.instance_of? Integer }) and
|
|
126
|
+
APIHelper.valid_type?(value['timestamp'],
|
|
127
|
+
->(val) { val.instance_of? String }) and
|
|
128
|
+
APIHelper.valid_type?(value['invoice'],
|
|
129
|
+
->(val) { Invoice.validate(val) },
|
|
130
|
+
is_model_hash: true) and
|
|
131
|
+
APIHelper.valid_type?(value['event_type'],
|
|
132
|
+
->(val) { InvoiceEventType.validate(val) }) and
|
|
133
|
+
APIHelper.valid_type?(value['event_data'],
|
|
134
|
+
->(val) { Invoice.validate(val) },
|
|
135
|
+
is_model_hash: true)
|
|
136
|
+
)
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
end
|
|
@@ -181,5 +181,15 @@ module AdvancedBilling
|
|
|
181
181
|
customer_vault_token,
|
|
182
182
|
hash)
|
|
183
183
|
end
|
|
184
|
+
|
|
185
|
+
# Validates an instance of the object from a given value.
|
|
186
|
+
# @param [BankAccountAttributes | Hash] The value against the validation is performed.
|
|
187
|
+
def self.validate(value)
|
|
188
|
+
return true if value.instance_of? self
|
|
189
|
+
|
|
190
|
+
return false unless value.instance_of? Hash
|
|
191
|
+
|
|
192
|
+
true
|
|
193
|
+
end
|
|
184
194
|
end
|
|
185
195
|
end
|
|
@@ -61,5 +61,15 @@ module AdvancedBilling
|
|
|
61
61
|
BillingSchedule.new(initial_billing_at,
|
|
62
62
|
hash)
|
|
63
63
|
end
|
|
64
|
+
|
|
65
|
+
# Validates an instance of the object from a given value.
|
|
66
|
+
# @param [BillingSchedule | Hash] The value against the validation is performed.
|
|
67
|
+
def self.validate(value)
|
|
68
|
+
return true if value.instance_of? self
|
|
69
|
+
|
|
70
|
+
return false unless value.instance_of? Hash
|
|
71
|
+
|
|
72
|
+
true
|
|
73
|
+
end
|
|
64
74
|
end
|
|
65
75
|
end
|
|
@@ -0,0 +1,141 @@
|
|
|
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
|
+
# ChangeChargebackStatusEvent Model.
|
|
9
|
+
class ChangeChargebackStatusEvent < 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
|
+
# TODO: Write general description for this method
|
|
18
|
+
# @return [DateTime]
|
|
19
|
+
attr_accessor :timestamp
|
|
20
|
+
|
|
21
|
+
# TODO: Write general description for this method
|
|
22
|
+
# @return [Invoice]
|
|
23
|
+
attr_accessor :invoice
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for this method
|
|
26
|
+
# @return [InvoiceEventType]
|
|
27
|
+
attr_accessor :event_type
|
|
28
|
+
|
|
29
|
+
# Example schema for an `change_chargeback_status` event
|
|
30
|
+
# @return [ChangeChargebackStatusEventData]
|
|
31
|
+
attr_accessor :event_data
|
|
32
|
+
|
|
33
|
+
# A mapping from model property names to API property names.
|
|
34
|
+
def self.names
|
|
35
|
+
@_hash = {} if @_hash.nil?
|
|
36
|
+
@_hash['id'] = 'id'
|
|
37
|
+
@_hash['timestamp'] = 'timestamp'
|
|
38
|
+
@_hash['invoice'] = 'invoice'
|
|
39
|
+
@_hash['event_type'] = 'event_type'
|
|
40
|
+
@_hash['event_data'] = 'event_data'
|
|
41
|
+
@_hash
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# An array for optional fields
|
|
45
|
+
def self.optionals
|
|
46
|
+
[]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# An array for nullable fields
|
|
50
|
+
def self.nullables
|
|
51
|
+
[]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def initialize(id = nil,
|
|
55
|
+
timestamp = nil,
|
|
56
|
+
invoice = nil,
|
|
57
|
+
event_type = InvoiceEventType::CHANGE_CHARGEBACK_STATUS,
|
|
58
|
+
event_data = nil,
|
|
59
|
+
additional_properties = {})
|
|
60
|
+
@id = id
|
|
61
|
+
@timestamp = timestamp
|
|
62
|
+
@invoice = invoice
|
|
63
|
+
@event_type = event_type
|
|
64
|
+
@event_data = event_data
|
|
65
|
+
|
|
66
|
+
# Add additional model properties to the instance.
|
|
67
|
+
additional_properties.each do |_name, _value|
|
|
68
|
+
instance_variable_set("@#{_name}", _value)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Creates an instance of the object from a hash.
|
|
73
|
+
def self.from_hash(hash)
|
|
74
|
+
return nil unless hash
|
|
75
|
+
|
|
76
|
+
# Extract variables from the hash.
|
|
77
|
+
id = hash.key?('id') ? hash['id'] : nil
|
|
78
|
+
timestamp = if hash.key?('timestamp')
|
|
79
|
+
(DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
|
|
80
|
+
end
|
|
81
|
+
invoice = Invoice.from_hash(hash['invoice']) if hash['invoice']
|
|
82
|
+
event_type =
|
|
83
|
+
hash['event_type'] ||= InvoiceEventType::CHANGE_CHARGEBACK_STATUS
|
|
84
|
+
event_data = ChangeChargebackStatusEventData.from_hash(hash['event_data']) if
|
|
85
|
+
hash['event_data']
|
|
86
|
+
|
|
87
|
+
# Clean out expected properties from Hash.
|
|
88
|
+
names.each_value { |k| hash.delete(k) }
|
|
89
|
+
|
|
90
|
+
# Create object from extracted values.
|
|
91
|
+
ChangeChargebackStatusEvent.new(id,
|
|
92
|
+
timestamp,
|
|
93
|
+
invoice,
|
|
94
|
+
event_type,
|
|
95
|
+
event_data,
|
|
96
|
+
hash)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def to_custom_timestamp
|
|
100
|
+
DateTimeHelper.to_rfc3339(timestamp)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Validates an instance of the object from a given value.
|
|
104
|
+
# @param [ChangeChargebackStatusEvent | Hash] The value against the validation is performed.
|
|
105
|
+
def self.validate(value)
|
|
106
|
+
if value.instance_of? self
|
|
107
|
+
return (
|
|
108
|
+
APIHelper.valid_type?(value.id,
|
|
109
|
+
->(val) { val.instance_of? Integer }) and
|
|
110
|
+
APIHelper.valid_type?(value.timestamp,
|
|
111
|
+
->(val) { val.instance_of? DateTime }) and
|
|
112
|
+
APIHelper.valid_type?(value.invoice,
|
|
113
|
+
->(val) { Invoice.validate(val) },
|
|
114
|
+
is_model_hash: true) and
|
|
115
|
+
APIHelper.valid_type?(value.event_type,
|
|
116
|
+
->(val) { InvoiceEventType.validate(val) }) and
|
|
117
|
+
APIHelper.valid_type?(value.event_data,
|
|
118
|
+
->(val) { ChangeChargebackStatusEventData.validate(val) },
|
|
119
|
+
is_model_hash: true)
|
|
120
|
+
)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
return false unless value.instance_of? Hash
|
|
124
|
+
|
|
125
|
+
(
|
|
126
|
+
APIHelper.valid_type?(value['id'],
|
|
127
|
+
->(val) { val.instance_of? Integer }) and
|
|
128
|
+
APIHelper.valid_type?(value['timestamp'],
|
|
129
|
+
->(val) { val.instance_of? String }) and
|
|
130
|
+
APIHelper.valid_type?(value['invoice'],
|
|
131
|
+
->(val) { Invoice.validate(val) },
|
|
132
|
+
is_model_hash: true) and
|
|
133
|
+
APIHelper.valid_type?(value['event_type'],
|
|
134
|
+
->(val) { InvoiceEventType.validate(val) }) and
|
|
135
|
+
APIHelper.valid_type?(value['event_data'],
|
|
136
|
+
->(val) { ChangeChargebackStatusEventData.validate(val) },
|
|
137
|
+
is_model_hash: true)
|
|
138
|
+
)
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# advanced_billing
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
|
4
|
+
# ( https://apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module AdvancedBilling
|
|
7
|
+
# Example schema for an `change_chargeback_status` event
|
|
8
|
+
class ChangeChargebackStatusEventData < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [ChargebackStatus]
|
|
14
|
+
attr_accessor :chargeback_status
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['chargeback_status'] = 'chargeback_status'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
[]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for nullable fields
|
|
29
|
+
def self.nullables
|
|
30
|
+
[]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def initialize(chargeback_status = nil,
|
|
34
|
+
additional_properties = {})
|
|
35
|
+
@chargeback_status = chargeback_status
|
|
36
|
+
|
|
37
|
+
# Add additional model properties to the instance.
|
|
38
|
+
additional_properties.each do |_name, _value|
|
|
39
|
+
instance_variable_set("@#{_name}", _value)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Creates an instance of the object from a hash.
|
|
44
|
+
def self.from_hash(hash)
|
|
45
|
+
return nil unless hash
|
|
46
|
+
|
|
47
|
+
# Extract variables from the hash.
|
|
48
|
+
chargeback_status =
|
|
49
|
+
hash.key?('chargeback_status') ? hash['chargeback_status'] : nil
|
|
50
|
+
|
|
51
|
+
# Clean out expected properties from Hash.
|
|
52
|
+
names.each_value { |k| hash.delete(k) }
|
|
53
|
+
|
|
54
|
+
# Create object from extracted values.
|
|
55
|
+
ChangeChargebackStatusEventData.new(chargeback_status,
|
|
56
|
+
hash)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Validates an instance of the object from a given value.
|
|
60
|
+
# @param [ChangeChargebackStatusEventData | Hash] The value against the validation is performed.
|
|
61
|
+
def self.validate(value)
|
|
62
|
+
if value.instance_of? self
|
|
63
|
+
return APIHelper.valid_type?(value.chargeback_status,
|
|
64
|
+
->(val) { ChargebackStatus.validate(val) })
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
return false unless value.instance_of? Hash
|
|
68
|
+
|
|
69
|
+
APIHelper.valid_type?(value['chargeback_status'],
|
|
70
|
+
->(val) { ChargebackStatus.validate(val) })
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -0,0 +1,141 @@
|
|
|
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
|
+
# ChangeInvoiceCollectionMethodEvent Model.
|
|
9
|
+
class ChangeInvoiceCollectionMethodEvent < 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
|
+
# TODO: Write general description for this method
|
|
18
|
+
# @return [DateTime]
|
|
19
|
+
attr_accessor :timestamp
|
|
20
|
+
|
|
21
|
+
# TODO: Write general description for this method
|
|
22
|
+
# @return [Invoice]
|
|
23
|
+
attr_accessor :invoice
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for this method
|
|
26
|
+
# @return [InvoiceEventType]
|
|
27
|
+
attr_accessor :event_type
|
|
28
|
+
|
|
29
|
+
# Example schema for an `change_invoice_collection_method` event
|
|
30
|
+
# @return [ChangeInvoiceCollectionMethodEventData]
|
|
31
|
+
attr_accessor :event_data
|
|
32
|
+
|
|
33
|
+
# A mapping from model property names to API property names.
|
|
34
|
+
def self.names
|
|
35
|
+
@_hash = {} if @_hash.nil?
|
|
36
|
+
@_hash['id'] = 'id'
|
|
37
|
+
@_hash['timestamp'] = 'timestamp'
|
|
38
|
+
@_hash['invoice'] = 'invoice'
|
|
39
|
+
@_hash['event_type'] = 'event_type'
|
|
40
|
+
@_hash['event_data'] = 'event_data'
|
|
41
|
+
@_hash
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# An array for optional fields
|
|
45
|
+
def self.optionals
|
|
46
|
+
[]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# An array for nullable fields
|
|
50
|
+
def self.nullables
|
|
51
|
+
[]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def initialize(id = nil,
|
|
55
|
+
timestamp = nil,
|
|
56
|
+
invoice = nil,
|
|
57
|
+
event_type = InvoiceEventType::CHANGE_INVOICE_COLLECTION_METHOD,
|
|
58
|
+
event_data = nil,
|
|
59
|
+
additional_properties = {})
|
|
60
|
+
@id = id
|
|
61
|
+
@timestamp = timestamp
|
|
62
|
+
@invoice = invoice
|
|
63
|
+
@event_type = event_type
|
|
64
|
+
@event_data = event_data
|
|
65
|
+
|
|
66
|
+
# Add additional model properties to the instance.
|
|
67
|
+
additional_properties.each do |_name, _value|
|
|
68
|
+
instance_variable_set("@#{_name}", _value)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Creates an instance of the object from a hash.
|
|
73
|
+
def self.from_hash(hash)
|
|
74
|
+
return nil unless hash
|
|
75
|
+
|
|
76
|
+
# Extract variables from the hash.
|
|
77
|
+
id = hash.key?('id') ? hash['id'] : nil
|
|
78
|
+
timestamp = if hash.key?('timestamp')
|
|
79
|
+
(DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
|
|
80
|
+
end
|
|
81
|
+
invoice = Invoice.from_hash(hash['invoice']) if hash['invoice']
|
|
82
|
+
event_type =
|
|
83
|
+
hash['event_type'] ||= InvoiceEventType::CHANGE_INVOICE_COLLECTION_METHOD
|
|
84
|
+
event_data = ChangeInvoiceCollectionMethodEventData.from_hash(hash['event_data']) if
|
|
85
|
+
hash['event_data']
|
|
86
|
+
|
|
87
|
+
# Clean out expected properties from Hash.
|
|
88
|
+
names.each_value { |k| hash.delete(k) }
|
|
89
|
+
|
|
90
|
+
# Create object from extracted values.
|
|
91
|
+
ChangeInvoiceCollectionMethodEvent.new(id,
|
|
92
|
+
timestamp,
|
|
93
|
+
invoice,
|
|
94
|
+
event_type,
|
|
95
|
+
event_data,
|
|
96
|
+
hash)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def to_custom_timestamp
|
|
100
|
+
DateTimeHelper.to_rfc3339(timestamp)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Validates an instance of the object from a given value.
|
|
104
|
+
# @param [ChangeInvoiceCollectionMethodEvent | Hash] The value against the validation is performed.
|
|
105
|
+
def self.validate(value)
|
|
106
|
+
if value.instance_of? self
|
|
107
|
+
return (
|
|
108
|
+
APIHelper.valid_type?(value.id,
|
|
109
|
+
->(val) { val.instance_of? Integer }) and
|
|
110
|
+
APIHelper.valid_type?(value.timestamp,
|
|
111
|
+
->(val) { val.instance_of? DateTime }) and
|
|
112
|
+
APIHelper.valid_type?(value.invoice,
|
|
113
|
+
->(val) { Invoice.validate(val) },
|
|
114
|
+
is_model_hash: true) and
|
|
115
|
+
APIHelper.valid_type?(value.event_type,
|
|
116
|
+
->(val) { InvoiceEventType.validate(val) }) and
|
|
117
|
+
APIHelper.valid_type?(value.event_data,
|
|
118
|
+
->(val) { ChangeInvoiceCollectionMethodEventData.validate(val) },
|
|
119
|
+
is_model_hash: true)
|
|
120
|
+
)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
return false unless value.instance_of? Hash
|
|
124
|
+
|
|
125
|
+
(
|
|
126
|
+
APIHelper.valid_type?(value['id'],
|
|
127
|
+
->(val) { val.instance_of? Integer }) and
|
|
128
|
+
APIHelper.valid_type?(value['timestamp'],
|
|
129
|
+
->(val) { val.instance_of? String }) and
|
|
130
|
+
APIHelper.valid_type?(value['invoice'],
|
|
131
|
+
->(val) { Invoice.validate(val) },
|
|
132
|
+
is_model_hash: true) and
|
|
133
|
+
APIHelper.valid_type?(value['event_type'],
|
|
134
|
+
->(val) { InvoiceEventType.validate(val) }) and
|
|
135
|
+
APIHelper.valid_type?(value['event_data'],
|
|
136
|
+
->(val) { ChangeInvoiceCollectionMethodEventData.validate(val) },
|
|
137
|
+
is_model_hash: true)
|
|
138
|
+
)
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
end
|
|
@@ -0,0 +1,141 @@
|
|
|
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
|
+
# ChangeInvoiceStatusEvent Model.
|
|
9
|
+
class ChangeInvoiceStatusEvent < 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
|
+
# TODO: Write general description for this method
|
|
18
|
+
# @return [DateTime]
|
|
19
|
+
attr_accessor :timestamp
|
|
20
|
+
|
|
21
|
+
# TODO: Write general description for this method
|
|
22
|
+
# @return [Invoice]
|
|
23
|
+
attr_accessor :invoice
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for this method
|
|
26
|
+
# @return [InvoiceEventType]
|
|
27
|
+
attr_accessor :event_type
|
|
28
|
+
|
|
29
|
+
# Example schema for an `change_invoice_status` event
|
|
30
|
+
# @return [ChangeInvoiceStatusEventData]
|
|
31
|
+
attr_accessor :event_data
|
|
32
|
+
|
|
33
|
+
# A mapping from model property names to API property names.
|
|
34
|
+
def self.names
|
|
35
|
+
@_hash = {} if @_hash.nil?
|
|
36
|
+
@_hash['id'] = 'id'
|
|
37
|
+
@_hash['timestamp'] = 'timestamp'
|
|
38
|
+
@_hash['invoice'] = 'invoice'
|
|
39
|
+
@_hash['event_type'] = 'event_type'
|
|
40
|
+
@_hash['event_data'] = 'event_data'
|
|
41
|
+
@_hash
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# An array for optional fields
|
|
45
|
+
def self.optionals
|
|
46
|
+
[]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# An array for nullable fields
|
|
50
|
+
def self.nullables
|
|
51
|
+
[]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def initialize(id = nil,
|
|
55
|
+
timestamp = nil,
|
|
56
|
+
invoice = nil,
|
|
57
|
+
event_type = InvoiceEventType::CHANGE_INVOICE_STATUS,
|
|
58
|
+
event_data = nil,
|
|
59
|
+
additional_properties = {})
|
|
60
|
+
@id = id
|
|
61
|
+
@timestamp = timestamp
|
|
62
|
+
@invoice = invoice
|
|
63
|
+
@event_type = event_type
|
|
64
|
+
@event_data = event_data
|
|
65
|
+
|
|
66
|
+
# Add additional model properties to the instance.
|
|
67
|
+
additional_properties.each do |_name, _value|
|
|
68
|
+
instance_variable_set("@#{_name}", _value)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Creates an instance of the object from a hash.
|
|
73
|
+
def self.from_hash(hash)
|
|
74
|
+
return nil unless hash
|
|
75
|
+
|
|
76
|
+
# Extract variables from the hash.
|
|
77
|
+
id = hash.key?('id') ? hash['id'] : nil
|
|
78
|
+
timestamp = if hash.key?('timestamp')
|
|
79
|
+
(DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
|
|
80
|
+
end
|
|
81
|
+
invoice = Invoice.from_hash(hash['invoice']) if hash['invoice']
|
|
82
|
+
event_type =
|
|
83
|
+
hash['event_type'] ||= InvoiceEventType::CHANGE_INVOICE_STATUS
|
|
84
|
+
event_data = ChangeInvoiceStatusEventData.from_hash(hash['event_data']) if
|
|
85
|
+
hash['event_data']
|
|
86
|
+
|
|
87
|
+
# Clean out expected properties from Hash.
|
|
88
|
+
names.each_value { |k| hash.delete(k) }
|
|
89
|
+
|
|
90
|
+
# Create object from extracted values.
|
|
91
|
+
ChangeInvoiceStatusEvent.new(id,
|
|
92
|
+
timestamp,
|
|
93
|
+
invoice,
|
|
94
|
+
event_type,
|
|
95
|
+
event_data,
|
|
96
|
+
hash)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def to_custom_timestamp
|
|
100
|
+
DateTimeHelper.to_rfc3339(timestamp)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Validates an instance of the object from a given value.
|
|
104
|
+
# @param [ChangeInvoiceStatusEvent | Hash] The value against the validation is performed.
|
|
105
|
+
def self.validate(value)
|
|
106
|
+
if value.instance_of? self
|
|
107
|
+
return (
|
|
108
|
+
APIHelper.valid_type?(value.id,
|
|
109
|
+
->(val) { val.instance_of? Integer }) and
|
|
110
|
+
APIHelper.valid_type?(value.timestamp,
|
|
111
|
+
->(val) { val.instance_of? DateTime }) and
|
|
112
|
+
APIHelper.valid_type?(value.invoice,
|
|
113
|
+
->(val) { Invoice.validate(val) },
|
|
114
|
+
is_model_hash: true) and
|
|
115
|
+
APIHelper.valid_type?(value.event_type,
|
|
116
|
+
->(val) { InvoiceEventType.validate(val) }) and
|
|
117
|
+
APIHelper.valid_type?(value.event_data,
|
|
118
|
+
->(val) { ChangeInvoiceStatusEventData.validate(val) },
|
|
119
|
+
is_model_hash: true)
|
|
120
|
+
)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
return false unless value.instance_of? Hash
|
|
124
|
+
|
|
125
|
+
(
|
|
126
|
+
APIHelper.valid_type?(value['id'],
|
|
127
|
+
->(val) { val.instance_of? Integer }) and
|
|
128
|
+
APIHelper.valid_type?(value['timestamp'],
|
|
129
|
+
->(val) { val.instance_of? String }) and
|
|
130
|
+
APIHelper.valid_type?(value['invoice'],
|
|
131
|
+
->(val) { Invoice.validate(val) },
|
|
132
|
+
is_model_hash: true) and
|
|
133
|
+
APIHelper.valid_type?(value['event_type'],
|
|
134
|
+
->(val) { InvoiceEventType.validate(val) }) and
|
|
135
|
+
APIHelper.valid_type?(value['event_data'],
|
|
136
|
+
->(val) { ChangeInvoiceStatusEventData.validate(val) },
|
|
137
|
+
is_model_hash: true)
|
|
138
|
+
)
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
end
|