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.
Files changed (185) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +40 -40
  3. data/lib/advanced_billing/controllers/advance_invoice_controller.rb +6 -4
  4. data/lib/advanced_billing/controllers/base_controller.rb +1 -1
  5. data/lib/advanced_billing/controllers/components_controller.rb +9 -58
  6. data/lib/advanced_billing/controllers/coupons_controller.rb +6 -115
  7. data/lib/advanced_billing/controllers/custom_fields_controller.rb +4 -4
  8. data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +5 -22
  9. data/lib/advanced_billing/controllers/insights_controller.rb +3 -4
  10. data/lib/advanced_billing/controllers/invoices_controller.rb +11 -0
  11. data/lib/advanced_billing/controllers/payment_profiles_controller.rb +26 -0
  12. data/lib/advanced_billing/controllers/product_families_controller.rb +5 -14
  13. data/lib/advanced_billing/controllers/product_price_points_controller.rb +3 -40
  14. data/lib/advanced_billing/controllers/products_controller.rb +5 -14
  15. data/lib/advanced_billing/controllers/subscription_components_controller.rb +16 -66
  16. data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +5 -15
  17. data/lib/advanced_billing/controllers/subscription_groups_controller.rb +6 -6
  18. data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +13 -20
  19. data/lib/advanced_billing/controllers/subscriptions_controller.rb +49 -14
  20. data/lib/advanced_billing/models/ach_agreement.rb +10 -0
  21. data/lib/advanced_billing/models/address_change.rb +0 -22
  22. data/lib/advanced_billing/models/agreement_acceptance.rb +10 -0
  23. data/lib/advanced_billing/models/allocation.rb +1 -3
  24. data/lib/advanced_billing/models/applied_credit_note_data.rb +10 -0
  25. data/lib/advanced_billing/models/apply_credit_note_event.rb +139 -0
  26. data/lib/advanced_billing/models/apply_credit_note_event_data.rb +3 -1
  27. data/lib/advanced_billing/models/apply_debit_note_event.rb +139 -0
  28. data/lib/advanced_billing/models/apply_debit_note_event_data.rb +36 -2
  29. data/lib/advanced_billing/models/apply_payment_event.rb +139 -0
  30. data/lib/advanced_billing/models/apply_payment_event_data.rb +21 -7
  31. data/lib/advanced_billing/models/backport_invoice_event.rb +139 -0
  32. data/lib/advanced_billing/models/bank_account_attributes.rb +10 -0
  33. data/lib/advanced_billing/models/billing_manifest.rb +5 -1
  34. data/lib/advanced_billing/models/billing_schedule.rb +10 -0
  35. data/lib/advanced_billing/models/change_chargeback_status_event.rb +141 -0
  36. data/lib/advanced_billing/models/change_chargeback_status_event_data.rb +73 -0
  37. data/lib/advanced_billing/models/change_invoice_collection_method_event.rb +141 -0
  38. data/lib/advanced_billing/models/change_invoice_status_event.rb +141 -0
  39. data/lib/advanced_billing/models/change_invoice_status_event_data.rb +131 -0
  40. data/lib/advanced_billing/models/chargeback_status.rb +29 -0
  41. data/lib/advanced_billing/models/component.rb +3 -13
  42. data/lib/advanced_billing/models/component_cost_data.rb +10 -0
  43. data/lib/advanced_billing/models/component_cost_data_rate_tier.rb +10 -0
  44. data/lib/advanced_billing/models/component_custom_price.rb +10 -0
  45. data/lib/advanced_billing/models/component_price_point.rb +2 -13
  46. data/lib/advanced_billing/models/component_price_point_item.rb +10 -0
  47. data/lib/advanced_billing/models/coupon.rb +4 -14
  48. data/lib/advanced_billing/models/create_component_price_point.rb +6 -2
  49. data/lib/advanced_billing/models/create_component_price_point_request.rb +1 -1
  50. data/lib/advanced_billing/models/create_component_price_points_request.rb +1 -1
  51. data/lib/advanced_billing/models/create_credit_note_event.rb +139 -0
  52. data/lib/advanced_billing/models/create_debit_note_event.rb +139 -0
  53. data/lib/advanced_billing/models/create_invoice_payment_application.rb +22 -0
  54. data/lib/advanced_billing/models/create_multi_invoice_payment.rb +6 -2
  55. data/lib/advanced_billing/models/create_offer_component.rb +11 -0
  56. data/lib/advanced_billing/models/create_payment_profile.rb +4 -4
  57. data/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +10 -4
  58. data/lib/advanced_billing/models/create_product_family.rb +14 -4
  59. data/lib/advanced_billing/models/create_subscription.rb +2 -2
  60. data/lib/advanced_billing/models/credit_card_attributes.rb +10 -0
  61. data/lib/advanced_billing/models/credit_note_application.rb +10 -0
  62. data/lib/advanced_billing/models/credit_note_line_item.rb +10 -0
  63. data/lib/advanced_billing/models/customer.rb +13 -1
  64. data/lib/advanced_billing/models/customer_attributes.rb +10 -0
  65. data/lib/advanced_billing/models/customer_change.rb +7 -22
  66. data/lib/advanced_billing/models/customer_custom_fields_change.rb +0 -22
  67. data/lib/advanced_billing/models/customer_payer_change.rb +0 -22
  68. data/lib/advanced_billing/models/debit_note.rb +351 -0
  69. data/lib/advanced_billing/models/debit_note_role.rb +23 -0
  70. data/lib/advanced_billing/models/debit_note_status.rb +29 -0
  71. data/lib/advanced_billing/models/deduct_service_credit.rb +10 -16
  72. data/lib/advanced_billing/models/dunner_data.rb +38 -0
  73. data/lib/advanced_billing/models/dunning_step_data.rb +34 -0
  74. data/lib/advanced_billing/models/dunning_step_reached.rb +12 -6
  75. data/lib/advanced_billing/models/failed_payment_event.rb +139 -0
  76. data/lib/advanced_billing/models/failed_payment_event_data.rb +132 -0
  77. data/lib/advanced_billing/models/group_billing.rb +10 -0
  78. data/lib/advanced_billing/models/group_settings.rb +4 -2
  79. data/lib/advanced_billing/models/group_target.rb +14 -0
  80. data/lib/advanced_billing/models/historic_usage.rb +109 -0
  81. data/lib/advanced_billing/models/include_null_or_not_null.rb +23 -0
  82. data/lib/advanced_billing/models/invoice.rb +18 -8
  83. data/lib/advanced_billing/models/invoice_address.rb +10 -0
  84. data/lib/advanced_billing/models/invoice_balance_item.rb +10 -0
  85. data/lib/advanced_billing/models/invoice_credit.rb +10 -0
  86. data/lib/advanced_billing/models/invoice_custom_field.rb +10 -0
  87. data/lib/advanced_billing/models/invoice_customer.rb +10 -0
  88. data/lib/advanced_billing/models/invoice_discount.rb +10 -0
  89. data/lib/advanced_billing/models/invoice_discount_breakout.rb +10 -0
  90. data/lib/advanced_billing/models/invoice_display_settings.rb +10 -0
  91. data/lib/advanced_billing/models/invoice_event_type.rb +3 -0
  92. data/lib/advanced_billing/models/invoice_issued.rb +6 -2
  93. data/lib/advanced_billing/models/invoice_line_item.rb +3 -3
  94. data/lib/advanced_billing/models/invoice_line_item_event_data.rb +10 -0
  95. data/lib/advanced_billing/models/invoice_line_item_pricing_detail.rb +10 -0
  96. data/lib/advanced_billing/models/invoice_payer.rb +10 -0
  97. data/lib/advanced_billing/models/invoice_payment.rb +10 -0
  98. data/lib/advanced_billing/models/invoice_payment_method.rb +10 -0
  99. data/lib/advanced_billing/models/invoice_pre_payment.rb +0 -10
  100. data/lib/advanced_billing/models/invoice_previous_balance.rb +10 -0
  101. data/lib/advanced_billing/models/invoice_refund.rb +10 -0
  102. data/lib/advanced_billing/models/invoice_seller.rb +10 -0
  103. data/lib/advanced_billing/models/invoice_status.rb +2 -2
  104. data/lib/advanced_billing/models/invoice_tax.rb +10 -0
  105. data/lib/advanced_billing/models/invoice_tax_breakout.rb +10 -0
  106. data/lib/advanced_billing/models/invoice_tax_component_breakout.rb +10 -0
  107. data/lib/advanced_billing/models/issue_invoice_event.rb +139 -0
  108. data/lib/advanced_billing/models/issue_invoice_event_data.rb +6 -6
  109. data/lib/advanced_billing/models/issue_service_credit.rb +10 -16
  110. data/lib/advanced_billing/models/item_price_point_changed.rb +8 -4
  111. data/lib/advanced_billing/models/item_price_point_data.rb +10 -0
  112. data/lib/advanced_billing/models/list_components_filter.rb +74 -0
  113. data/lib/advanced_billing/models/list_coupons_filter.rb +168 -0
  114. data/lib/advanced_billing/models/list_invoice_events_response.rb +14 -11
  115. data/lib/advanced_billing/models/{refund_prepayment_aggregated_error.rb → list_mrr_filter.rb} +14 -12
  116. data/lib/advanced_billing/models/{list_subscription_group_prepayment_date_field.rb → list_prepayment_date_field.rb} +4 -4
  117. data/lib/advanced_billing/models/list_prepayments_filter.rb +88 -0
  118. data/lib/advanced_billing/models/list_price_points_filter.rb +163 -0
  119. data/lib/advanced_billing/models/list_products_filter.rb +81 -0
  120. data/lib/advanced_billing/models/list_segments_filter.rb +103 -0
  121. data/lib/advanced_billing/models/list_subscription_components_filter.rb +74 -0
  122. data/lib/advanced_billing/models/list_subscription_components_for_site_filter.rb +84 -0
  123. data/lib/advanced_billing/models/list_subscription_components_include.rb +4 -1
  124. data/lib/advanced_billing/models/metafield_scope.rb +10 -0
  125. data/lib/advanced_billing/models/nested_subscription_group.rb +0 -10
  126. data/lib/advanced_billing/models/origin_invoice.rb +10 -0
  127. data/lib/advanced_billing/models/overage_pricing.rb +14 -0
  128. data/lib/advanced_billing/models/paid_invoice.rb +2 -2
  129. data/lib/advanced_billing/models/payer_attributes.rb +10 -0
  130. data/lib/advanced_billing/models/prepaid_component_price_point.rb +10 -0
  131. data/lib/advanced_billing/models/prepaid_product_price_point_filter.rb +56 -0
  132. data/lib/advanced_billing/models/prepaid_usage.rb +6 -2
  133. data/lib/advanced_billing/models/prepaid_usage_allocation_detail.rb +10 -0
  134. data/lib/advanced_billing/models/product.rb +5 -16
  135. data/lib/advanced_billing/models/product_price_point.rb +9 -0
  136. data/lib/advanced_billing/models/proforma_invoice.rb +2 -2
  137. data/lib/advanced_billing/models/proforma_invoice_issued.rb +6 -2
  138. data/lib/advanced_billing/models/reactivation_billing.rb +10 -0
  139. data/lib/advanced_billing/models/record_payment_response.rb +1 -13
  140. data/lib/advanced_billing/models/refund_invoice_event.rb +139 -0
  141. data/lib/advanced_billing/models/refund_invoice_event_data.rb +4 -2
  142. data/lib/advanced_billing/models/refund_invoice_request.rb +1 -1
  143. data/lib/advanced_billing/models/refund_prepayment.rb +3 -1
  144. data/lib/advanced_billing/models/remove_payment_event.rb +139 -0
  145. data/lib/advanced_billing/models/remove_payment_event_data.rb +1 -1
  146. data/lib/advanced_billing/models/segment_price.rb +10 -0
  147. data/lib/advanced_billing/models/subscription.rb +10 -16
  148. data/lib/advanced_billing/models/subscription_component.rb +26 -7
  149. data/lib/advanced_billing/models/subscription_component_subscription.rb +10 -0
  150. data/lib/advanced_billing/models/subscription_filter.rb +153 -0
  151. data/lib/advanced_billing/models/subscription_group.rb +2 -2
  152. data/lib/advanced_billing/models/subscription_group_bank_account.rb +10 -0
  153. data/lib/advanced_billing/models/subscription_group_component_custom_price.rb +10 -0
  154. data/lib/advanced_billing/models/subscription_group_prepayment_response.rb +3 -1
  155. data/lib/advanced_billing/models/subscription_group_signup.rb +2 -2
  156. data/lib/advanced_billing/models/subscription_group_signup_failure.rb +4 -2
  157. data/lib/advanced_billing/models/subscription_group_signup_failure_data.rb +10 -0
  158. data/lib/advanced_billing/models/subscription_group_signup_item.rb +10 -0
  159. data/lib/advanced_billing/models/subscription_group_signup_response.rb +2 -2
  160. data/lib/advanced_billing/models/subscription_group_signup_success.rb +8 -4
  161. data/lib/advanced_billing/models/subscription_group_signup_success_data.rb +50 -0
  162. data/lib/advanced_billing/models/update_customer.rb +12 -0
  163. data/lib/advanced_billing/models/update_subscription_component.rb +10 -0
  164. data/lib/advanced_billing/models/upsert_prepaid_configuration.rb +10 -0
  165. data/lib/advanced_billing/models/usage.rb +3 -1
  166. data/lib/advanced_billing/models/void_invoice_event.rb +139 -0
  167. data/lib/advanced_billing/models/void_invoice_event_data.rb +8 -7
  168. data/lib/advanced_billing/models/void_remainder_event.rb +139 -0
  169. data/lib/advanced_billing/models/void_remainder_event_data.rb +4 -2
  170. data/lib/advanced_billing/utilities/union_type_lookup.rb +69 -199
  171. data/lib/advanced_billing.rb +42 -18
  172. metadata +38 -17
  173. data/lib/advanced_billing/exceptions/refund_prepayment_aggregated_errors_response_exception.rb +0 -33
  174. data/lib/advanced_billing/models/billing_address.rb +0 -117
  175. data/lib/advanced_billing/models/credit_note1.rb +0 -419
  176. data/lib/advanced_billing/models/customer1.rb +0 -125
  177. data/lib/advanced_billing/models/invoice_event.rb +0 -124
  178. data/lib/advanced_billing/models/invoice_event_data.rb +0 -447
  179. data/lib/advanced_billing/models/invoice_event_payment.rb +0 -168
  180. data/lib/advanced_billing/models/invoice_event_payment1.rb +0 -160
  181. data/lib/advanced_billing/models/prepayment_aggregated_error.rb +0 -81
  182. data/lib/advanced_billing/models/price_point.rb +0 -216
  183. data/lib/advanced_billing/models/refund.rb +0 -138
  184. data/lib/advanced_billing/models/seller.rb +0 -92
  185. data/lib/advanced_billing/models/shipping_address.rb +0 -117
@@ -1,160 +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
- # A nested data structure detailing the method of payment
8
- class InvoiceEventPayment1 < BaseModel
9
- SKIP = Object.new
10
- private_constant :SKIP
11
-
12
- # TODO: Write general description for this method
13
- # @return [String]
14
- attr_accessor :type
15
-
16
- # TODO: Write general description for this method
17
- # @return [String]
18
- attr_accessor :masked_account_number
19
-
20
- # TODO: Write general description for this method
21
- # @return [String]
22
- attr_accessor :masked_routing_number
23
-
24
- # TODO: Write general description for this method
25
- # @return [String]
26
- attr_accessor :card_brand
27
-
28
- # TODO: Write general description for this method
29
- # @return [String]
30
- attr_accessor :card_expiration
31
-
32
- # TODO: Write general description for this method
33
- # @return [String]
34
- attr_accessor :last_four
35
-
36
- # TODO: Write general description for this method
37
- # @return [String]
38
- attr_accessor :masked_card_number
39
-
40
- # TODO: Write general description for this method
41
- # @return [String]
42
- attr_accessor :details
43
-
44
- # TODO: Write general description for this method
45
- # @return [String]
46
- attr_accessor :kind
47
-
48
- # TODO: Write general description for this method
49
- # @return [String]
50
- attr_accessor :memo
51
-
52
- # TODO: Write general description for this method
53
- # @return [String]
54
- attr_accessor :email
55
-
56
- # A mapping from model property names to API property names.
57
- def self.names
58
- @_hash = {} if @_hash.nil?
59
- @_hash['type'] = 'type'
60
- @_hash['masked_account_number'] = 'masked_account_number'
61
- @_hash['masked_routing_number'] = 'masked_routing_number'
62
- @_hash['card_brand'] = 'card_brand'
63
- @_hash['card_expiration'] = 'card_expiration'
64
- @_hash['last_four'] = 'last_four'
65
- @_hash['masked_card_number'] = 'masked_card_number'
66
- @_hash['details'] = 'details'
67
- @_hash['kind'] = 'kind'
68
- @_hash['memo'] = 'memo'
69
- @_hash['email'] = 'email'
70
- @_hash
71
- end
72
-
73
- # An array for optional fields
74
- def self.optionals
75
- %w[
76
- type
77
- card_expiration
78
- last_four
79
- ]
80
- end
81
-
82
- # An array for nullable fields
83
- def self.nullables
84
- %w[
85
- last_four
86
- details
87
- memo
88
- ]
89
- end
90
-
91
- def initialize(masked_account_number = nil,
92
- masked_routing_number = nil,
93
- card_brand = nil,
94
- masked_card_number = nil,
95
- details = nil,
96
- kind = nil,
97
- memo = nil,
98
- email = nil,
99
- type = 'Invoice Event Payment1',
100
- card_expiration = SKIP,
101
- last_four = SKIP,
102
- additional_properties = {})
103
- @type = type unless type == SKIP
104
- @masked_account_number = masked_account_number
105
- @masked_routing_number = masked_routing_number
106
- @card_brand = card_brand
107
- @card_expiration = card_expiration unless card_expiration == SKIP
108
- @last_four = last_four unless last_four == SKIP
109
- @masked_card_number = masked_card_number
110
- @details = details
111
- @kind = kind
112
- @memo = memo
113
- @email = email
114
-
115
- # Add additional model properties to the instance.
116
- additional_properties.each do |_name, _value|
117
- instance_variable_set("@#{_name}", _value)
118
- end
119
- end
120
-
121
- # Creates an instance of the object from a hash.
122
- def self.from_hash(hash)
123
- return nil unless hash
124
-
125
- # Extract variables from the hash.
126
- masked_account_number =
127
- hash.key?('masked_account_number') ? hash['masked_account_number'] : nil
128
- masked_routing_number =
129
- hash.key?('masked_routing_number') ? hash['masked_routing_number'] : nil
130
- card_brand = hash.key?('card_brand') ? hash['card_brand'] : nil
131
- masked_card_number =
132
- hash.key?('masked_card_number') ? hash['masked_card_number'] : nil
133
- details = hash.key?('details') ? hash['details'] : nil
134
- kind = hash.key?('kind') ? hash['kind'] : nil
135
- memo = hash.key?('memo') ? hash['memo'] : nil
136
- email = hash.key?('email') ? hash['email'] : nil
137
- type = hash['type'] ||= 'Invoice Event Payment1'
138
- card_expiration =
139
- hash.key?('card_expiration') ? hash['card_expiration'] : SKIP
140
- last_four = hash.key?('last_four') ? hash['last_four'] : SKIP
141
-
142
- # Clean out expected properties from Hash.
143
- names.each_value { |k| hash.delete(k) }
144
-
145
- # Create object from extracted values.
146
- InvoiceEventPayment1.new(masked_account_number,
147
- masked_routing_number,
148
- card_brand,
149
- masked_card_number,
150
- details,
151
- kind,
152
- memo,
153
- email,
154
- type,
155
- card_expiration,
156
- last_four,
157
- hash)
158
- end
159
- end
160
- end
@@ -1,81 +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
- # PrepaymentAggregatedError Model.
8
- class PrepaymentAggregatedError < BaseModel
9
- SKIP = Object.new
10
- private_constant :SKIP
11
-
12
- # TODO: Write general description for this method
13
- # @return [Array[String]]
14
- attr_accessor :amount_in_cents
15
-
16
- # TODO: Write general description for this method
17
- # @return [Array[String]]
18
- attr_accessor :base
19
-
20
- # TODO: Write general description for this method
21
- # @return [Array[String]]
22
- attr_accessor :external
23
-
24
- # A mapping from model property names to API property names.
25
- def self.names
26
- @_hash = {} if @_hash.nil?
27
- @_hash['amount_in_cents'] = 'amount_in_cents'
28
- @_hash['base'] = 'base'
29
- @_hash['external'] = 'external'
30
- @_hash
31
- end
32
-
33
- # An array for optional fields
34
- def self.optionals
35
- %w[
36
- amount_in_cents
37
- base
38
- external
39
- ]
40
- end
41
-
42
- # An array for nullable fields
43
- def self.nullables
44
- []
45
- end
46
-
47
- def initialize(amount_in_cents = SKIP,
48
- base = SKIP,
49
- external = SKIP,
50
- additional_properties = {})
51
- @amount_in_cents = amount_in_cents unless amount_in_cents == SKIP
52
- @base = base unless base == SKIP
53
- @external = external unless external == SKIP
54
-
55
- # Add additional model properties to the instance.
56
- additional_properties.each do |_name, _value|
57
- instance_variable_set("@#{_name}", _value)
58
- end
59
- end
60
-
61
- # Creates an instance of the object from a hash.
62
- def self.from_hash(hash)
63
- return nil unless hash
64
-
65
- # Extract variables from the hash.
66
- amount_in_cents =
67
- hash.key?('amount_in_cents') ? hash['amount_in_cents'] : SKIP
68
- base = hash.key?('base') ? hash['base'] : SKIP
69
- external = hash.key?('external') ? hash['external'] : SKIP
70
-
71
- # Clean out expected properties from Hash.
72
- names.each_value { |k| hash.delete(k) }
73
-
74
- # Create object from extracted values.
75
- PrepaymentAggregatedError.new(amount_in_cents,
76
- base,
77
- external,
78
- hash)
79
- end
80
- end
81
- end
@@ -1,216 +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
- # PricePoint Model.
8
- class PricePoint < BaseModel
9
- SKIP = Object.new
10
- private_constant :SKIP
11
-
12
- # TODO: Write general description for this method
13
- # @return [String]
14
- attr_accessor :name
15
-
16
- # TODO: Write general description for this method
17
- # @return [String]
18
- attr_accessor :handle
19
-
20
- # The identifier for the pricing scheme. See [Product
21
- # Components](https://help.chargify.com/products/product-components.html)
22
- # for an overview of pricing schemes.
23
- # @return [PricingScheme]
24
- attr_accessor :pricing_scheme
25
-
26
- # The identifier for the pricing scheme. See [Product
27
- # Components](https://help.chargify.com/products/product-components.html)
28
- # for an overview of pricing schemes.
29
- # @return [Array[Price]]
30
- attr_accessor :prices
31
-
32
- # Whether to use the site level exchange rate or define your own prices for
33
- # each currency if you have multiple currencies defined on the site.
34
- # @return [TrueClass | FalseClass]
35
- attr_accessor :use_site_exchange_rate
36
-
37
- # Whether or not the price point includes tax
38
- # @return [TrueClass | FalseClass]
39
- attr_accessor :tax_included
40
-
41
- # The numerical interval. i.e. an interval of ‘30’ coupled with an
42
- # interval_unit of day would mean this price point would renew every 30
43
- # days. This property is only available for sites with Multifrequency
44
- # enabled.
45
- # @return [Integer]
46
- attr_accessor :interval
47
-
48
- # A string representing the interval unit for this price point, either month
49
- # or day. This property is only available for sites with Multifrequency
50
- # enabled.
51
- # @return [IntervalUnit]
52
- attr_accessor :interval_unit
53
-
54
- # A string representing the interval unit for this price point, either month
55
- # or day. This property is only available for sites with Multifrequency
56
- # enabled.
57
- # @return [OveragePricing]
58
- attr_accessor :overage_pricing
59
-
60
- # Boolean which controls whether or not remaining units should be rolled
61
- # over to the next period
62
- # @return [TrueClass | FalseClass]
63
- attr_accessor :rollover_prepaid_remainder
64
-
65
- # Boolean which controls whether or not the allocated quantity should be
66
- # renewed at the beginning of each period
67
- # @return [TrueClass | FalseClass]
68
- attr_accessor :renew_prepaid_allocation
69
-
70
- # (only for prepaid usage components where rollover_prepaid_remainder is
71
- # true) The number of `expiration_interval_unit`s after which rollover
72
- # amounts should expire
73
- # @return [Float]
74
- attr_accessor :expiration_interval
75
-
76
- # (only for prepaid usage components where rollover_prepaid_remainder is
77
- # true) The number of `expiration_interval_unit`s after which rollover
78
- # amounts should expire
79
- # @return [IntervalUnit]
80
- attr_accessor :expiration_interval_unit
81
-
82
- # A mapping from model property names to API property names.
83
- def self.names
84
- @_hash = {} if @_hash.nil?
85
- @_hash['name'] = 'name'
86
- @_hash['handle'] = 'handle'
87
- @_hash['pricing_scheme'] = 'pricing_scheme'
88
- @_hash['prices'] = 'prices'
89
- @_hash['use_site_exchange_rate'] = 'use_site_exchange_rate'
90
- @_hash['tax_included'] = 'tax_included'
91
- @_hash['interval'] = 'interval'
92
- @_hash['interval_unit'] = 'interval_unit'
93
- @_hash['overage_pricing'] = 'overage_pricing'
94
- @_hash['rollover_prepaid_remainder'] = 'rollover_prepaid_remainder'
95
- @_hash['renew_prepaid_allocation'] = 'renew_prepaid_allocation'
96
- @_hash['expiration_interval'] = 'expiration_interval'
97
- @_hash['expiration_interval_unit'] = 'expiration_interval_unit'
98
- @_hash
99
- end
100
-
101
- # An array for optional fields
102
- def self.optionals
103
- %w[
104
- name
105
- handle
106
- pricing_scheme
107
- prices
108
- use_site_exchange_rate
109
- tax_included
110
- interval
111
- interval_unit
112
- overage_pricing
113
- rollover_prepaid_remainder
114
- renew_prepaid_allocation
115
- expiration_interval
116
- expiration_interval_unit
117
- ]
118
- end
119
-
120
- # An array for nullable fields
121
- def self.nullables
122
- []
123
- end
124
-
125
- def initialize(name = SKIP,
126
- handle = SKIP,
127
- pricing_scheme = SKIP,
128
- prices = SKIP,
129
- use_site_exchange_rate = true,
130
- tax_included = SKIP,
131
- interval = SKIP,
132
- interval_unit = SKIP,
133
- overage_pricing = SKIP,
134
- rollover_prepaid_remainder = SKIP,
135
- renew_prepaid_allocation = SKIP,
136
- expiration_interval = SKIP,
137
- expiration_interval_unit = SKIP,
138
- additional_properties = {})
139
- @name = name unless name == SKIP
140
- @handle = handle unless handle == SKIP
141
- @pricing_scheme = pricing_scheme unless pricing_scheme == SKIP
142
- @prices = prices unless prices == SKIP
143
- @use_site_exchange_rate = use_site_exchange_rate unless use_site_exchange_rate == SKIP
144
- @tax_included = tax_included unless tax_included == SKIP
145
- @interval = interval unless interval == SKIP
146
- @interval_unit = interval_unit unless interval_unit == SKIP
147
- @overage_pricing = overage_pricing unless overage_pricing == SKIP
148
- unless rollover_prepaid_remainder == SKIP
149
- @rollover_prepaid_remainder =
150
- rollover_prepaid_remainder
151
- end
152
- @renew_prepaid_allocation = renew_prepaid_allocation unless renew_prepaid_allocation == SKIP
153
- @expiration_interval = expiration_interval unless expiration_interval == SKIP
154
- @expiration_interval_unit = expiration_interval_unit unless expiration_interval_unit == SKIP
155
-
156
- # Add additional model properties to the instance.
157
- additional_properties.each do |_name, _value|
158
- instance_variable_set("@#{_name}", _value)
159
- end
160
- end
161
-
162
- # Creates an instance of the object from a hash.
163
- def self.from_hash(hash)
164
- return nil unless hash
165
-
166
- # Extract variables from the hash.
167
- name = hash.key?('name') ? hash['name'] : SKIP
168
- handle = hash.key?('handle') ? hash['handle'] : SKIP
169
- pricing_scheme =
170
- hash.key?('pricing_scheme') ? hash['pricing_scheme'] : SKIP
171
- # Parameter is an array, so we need to iterate through it
172
- prices = nil
173
- unless hash['prices'].nil?
174
- prices = []
175
- hash['prices'].each do |structure|
176
- prices << (Price.from_hash(structure) if structure)
177
- end
178
- end
179
-
180
- prices = SKIP unless hash.key?('prices')
181
- use_site_exchange_rate = hash['use_site_exchange_rate'] ||= true
182
- tax_included = hash.key?('tax_included') ? hash['tax_included'] : SKIP
183
- interval = hash.key?('interval') ? hash['interval'] : SKIP
184
- interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : SKIP
185
- overage_pricing = OveragePricing.from_hash(hash['overage_pricing']) if
186
- hash['overage_pricing']
187
- rollover_prepaid_remainder =
188
- hash.key?('rollover_prepaid_remainder') ? hash['rollover_prepaid_remainder'] : SKIP
189
- renew_prepaid_allocation =
190
- hash.key?('renew_prepaid_allocation') ? hash['renew_prepaid_allocation'] : SKIP
191
- expiration_interval =
192
- hash.key?('expiration_interval') ? hash['expiration_interval'] : SKIP
193
- expiration_interval_unit =
194
- hash.key?('expiration_interval_unit') ? hash['expiration_interval_unit'] : SKIP
195
-
196
- # Clean out expected properties from Hash.
197
- names.each_value { |k| hash.delete(k) }
198
-
199
- # Create object from extracted values.
200
- PricePoint.new(name,
201
- handle,
202
- pricing_scheme,
203
- prices,
204
- use_site_exchange_rate,
205
- tax_included,
206
- interval,
207
- interval_unit,
208
- overage_pricing,
209
- rollover_prepaid_remainder,
210
- renew_prepaid_allocation,
211
- expiration_interval,
212
- expiration_interval_unit,
213
- hash)
214
- end
215
- end
216
- end
@@ -1,138 +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
- # Refund Model.
8
- class Refund < BaseModel
9
- SKIP = Object.new
10
- private_constant :SKIP
11
-
12
- # The amount to be refunded in decimal format as a string. Example: "10.50".
13
- # Must not exceed the remaining refundable balance of the payment.
14
- # @return [String]
15
- attr_accessor :amount
16
-
17
- # A description that will be attached to the refund
18
- # @return [String]
19
- attr_accessor :memo
20
-
21
- # The ID of the payment to be refunded
22
- # @return [Integer]
23
- attr_accessor :payment_id
24
-
25
- # Flag that marks refund as external (no money is returned to the customer).
26
- # Defaults to `false`.
27
- # @return [TrueClass | FalseClass]
28
- attr_accessor :external
29
-
30
- # If set to true, creates credit and applies it to an invoice. Defaults to
31
- # `false`.
32
- # @return [TrueClass | FalseClass]
33
- attr_accessor :apply_credit
34
-
35
- # If `apply_credit` set to false and refunding full amount, if
36
- # `void_invoice` set to true, invoice will be voided after refund. Defaults
37
- # to `false`.
38
- # @return [TrueClass | FalseClass]
39
- attr_accessor :void_invoice
40
-
41
- # An array of segment uids to refund or the string 'all' to indicate that
42
- # all segments should be refunded
43
- # @return [Object]
44
- attr_accessor :segment_uids
45
-
46
- # A mapping from model property names to API property names.
47
- def self.names
48
- @_hash = {} if @_hash.nil?
49
- @_hash['amount'] = 'amount'
50
- @_hash['memo'] = 'memo'
51
- @_hash['payment_id'] = 'payment_id'
52
- @_hash['external'] = 'external'
53
- @_hash['apply_credit'] = 'apply_credit'
54
- @_hash['void_invoice'] = 'void_invoice'
55
- @_hash['segment_uids'] = 'segment_uids'
56
- @_hash
57
- end
58
-
59
- # An array for optional fields
60
- def self.optionals
61
- %w[
62
- amount
63
- memo
64
- payment_id
65
- external
66
- apply_credit
67
- void_invoice
68
- segment_uids
69
- ]
70
- end
71
-
72
- # An array for nullable fields
73
- def self.nullables
74
- []
75
- end
76
-
77
- def initialize(amount = SKIP,
78
- memo = SKIP,
79
- payment_id = SKIP,
80
- external = SKIP,
81
- apply_credit = SKIP,
82
- void_invoice = SKIP,
83
- segment_uids = SKIP,
84
- additional_properties = {})
85
- @amount = amount unless amount == SKIP
86
- @memo = memo unless memo == SKIP
87
- @payment_id = payment_id unless payment_id == SKIP
88
- @external = external unless external == SKIP
89
- @apply_credit = apply_credit unless apply_credit == SKIP
90
- @void_invoice = void_invoice unless void_invoice == SKIP
91
- @segment_uids = segment_uids unless segment_uids == SKIP
92
-
93
- # Add additional model properties to the instance.
94
- additional_properties.each do |_name, _value|
95
- instance_variable_set("@#{_name}", _value)
96
- end
97
- end
98
-
99
- # Creates an instance of the object from a hash.
100
- def self.from_hash(hash)
101
- return nil unless hash
102
-
103
- # Extract variables from the hash.
104
- amount = hash.key?('amount') ? hash['amount'] : SKIP
105
- memo = hash.key?('memo') ? hash['memo'] : SKIP
106
- payment_id = hash.key?('payment_id') ? hash['payment_id'] : SKIP
107
- external = hash.key?('external') ? hash['external'] : SKIP
108
- apply_credit = hash.key?('apply_credit') ? hash['apply_credit'] : SKIP
109
- void_invoice = hash.key?('void_invoice') ? hash['void_invoice'] : SKIP
110
- segment_uids = hash.key?('segment_uids') ? APIHelper.deserialize_union_type(
111
- UnionTypeLookUp.get(:RefundSegmentUids), hash['segment_uids']
112
- ) : SKIP
113
-
114
- # Clean out expected properties from Hash.
115
- names.each_value { |k| hash.delete(k) }
116
-
117
- # Create object from extracted values.
118
- Refund.new(amount,
119
- memo,
120
- payment_id,
121
- external,
122
- apply_credit,
123
- void_invoice,
124
- segment_uids,
125
- hash)
126
- end
127
-
128
- # Validates an instance of the object from a given value.
129
- # @param [Refund | Hash] The value against the validation is performed.
130
- def self.validate(value)
131
- return true if value.instance_of? self
132
-
133
- return false unless value.instance_of? Hash
134
-
135
- true
136
- end
137
- end
138
- end
@@ -1,92 +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
- # Seller Model.
8
- class Seller < BaseModel
9
- SKIP = Object.new
10
- private_constant :SKIP
11
-
12
- # TODO: Write general description for this method
13
- # @return [String]
14
- attr_accessor :name
15
-
16
- # TODO: Write general description for this method
17
- # @return [InvoiceAddress]
18
- attr_accessor :address
19
-
20
- # TODO: Write general description for this method
21
- # @return [String]
22
- attr_accessor :phone
23
-
24
- # TODO: Write general description for this method
25
- # @return [String]
26
- attr_accessor :logo_url
27
-
28
- # A mapping from model property names to API property names.
29
- def self.names
30
- @_hash = {} if @_hash.nil?
31
- @_hash['name'] = 'name'
32
- @_hash['address'] = 'address'
33
- @_hash['phone'] = 'phone'
34
- @_hash['logo_url'] = 'logo_url'
35
- @_hash
36
- end
37
-
38
- # An array for optional fields
39
- def self.optionals
40
- %w[
41
- name
42
- address
43
- phone
44
- logo_url
45
- ]
46
- end
47
-
48
- # An array for nullable fields
49
- def self.nullables
50
- %w[
51
- logo_url
52
- ]
53
- end
54
-
55
- def initialize(name = SKIP,
56
- address = SKIP,
57
- phone = SKIP,
58
- logo_url = SKIP,
59
- additional_properties = {})
60
- @name = name unless name == SKIP
61
- @address = address unless address == SKIP
62
- @phone = phone unless phone == SKIP
63
- @logo_url = logo_url unless logo_url == SKIP
64
-
65
- # Add additional model properties to the instance.
66
- additional_properties.each do |_name, _value|
67
- instance_variable_set("@#{_name}", _value)
68
- end
69
- end
70
-
71
- # Creates an instance of the object from a hash.
72
- def self.from_hash(hash)
73
- return nil unless hash
74
-
75
- # Extract variables from the hash.
76
- name = hash.key?('name') ? hash['name'] : SKIP
77
- address = InvoiceAddress.from_hash(hash['address']) if hash['address']
78
- phone = hash.key?('phone') ? hash['phone'] : SKIP
79
- logo_url = hash.key?('logo_url') ? hash['logo_url'] : SKIP
80
-
81
- # Clean out expected properties from Hash.
82
- names.each_value { |k| hash.delete(k) }
83
-
84
- # Create object from extracted values.
85
- Seller.new(name,
86
- address,
87
- phone,
88
- logo_url,
89
- hash)
90
- end
91
- end
92
- end