devdraft 1.0.2 → 1.0.3

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 (234) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +155 -253
  3. data/Rakefile +2 -0
  4. data/devdraft-1.0.0.gem +0 -0
  5. data/{devdraft_ai_sdk.gemspec → devdraft.gemspec} +15 -11
  6. data/docs/APIHealthApi.md +82 -30
  7. data/docs/AggregatedBalanceResponse.md +19 -6
  8. data/docs/AllBalancesResponse.md +19 -6
  9. data/docs/AppBalancesApi.md +125 -65
  10. data/docs/BridgeFiatPaymentRail.md +15 -0
  11. data/docs/BridgePaymentRail.md +12 -3
  12. data/docs/CreateBankPaymentIntentDto.md +49 -21
  13. data/docs/CreateCustomerDto.md +25 -9
  14. data/docs/CreateDirectBankTransferDto.md +29 -11
  15. data/docs/CreateDirectWalletTransferDto.md +21 -7
  16. data/docs/CreateExternalBankTransferDto.md +40 -0
  17. data/docs/CreateExternalStablecoinTransferDto.md +28 -0
  18. data/docs/CreateInvoiceDto.md +45 -19
  19. data/docs/CreateLiquidationAddressDto.md +43 -18
  20. data/docs/CreatePaymentLinkDto.md +53 -28
  21. data/docs/CreateStablePaymentIntentDto.md +43 -18
  22. data/docs/CreateStablecoinConversionDto.md +23 -8
  23. data/docs/CreateTaxDto.md +26 -0
  24. data/docs/CreateWebhookDto.md +23 -8
  25. data/docs/CustomerStatus.md +12 -3
  26. data/docs/CustomerType.md +15 -0
  27. data/docs/CustomersApi.md +187 -114
  28. data/docs/DestinationCurrency.md +12 -3
  29. data/docs/ExchangeRateResponseDto.md +25 -9
  30. data/docs/ExchangeRatesApi.md +130 -72
  31. data/docs/FiatCurrency.md +12 -3
  32. data/docs/HealthResponseDto.md +25 -9
  33. data/docs/InvoiceProductDto.md +17 -5
  34. data/docs/InvoicesApi.md +177 -104
  35. data/docs/LiquidationAddressResponseDto.md +41 -17
  36. data/docs/LiquidationAddressesApi.md +115 -61
  37. data/docs/PaymentIntentsApi.md +93 -57
  38. data/docs/PaymentLinkProductDto.md +17 -5
  39. data/docs/PaymentLinksApi.md +175 -102
  40. data/docs/PaymentRequestDto.md +21 -7
  41. data/docs/PaymentResponseDto.md +23 -8
  42. data/docs/ProductsApi.md +307 -194
  43. data/docs/PublicHealthResponseDto.md +19 -6
  44. data/docs/RefundResponseDto.md +23 -8
  45. data/docs/StableCoinCurrency.md +12 -3
  46. data/docs/TaxControllerCreate201Response.md +30 -0
  47. data/docs/TaxControllerDeleteWithoutId400Response.md +22 -0
  48. data/docs/TaxControllerUpdateWithoutId400Response.md +22 -0
  49. data/docs/TaxesApi.md +374 -122
  50. data/docs/TestPaymentsApi.md +150 -60
  51. data/docs/TransfersApi.md +274 -72
  52. data/docs/UpdateCustomerDto.md +25 -9
  53. data/docs/UpdateTaxDto.md +26 -0
  54. data/docs/UpdateWebhookDto.md +23 -8
  55. data/docs/WalletsApi.md +44 -24
  56. data/docs/WebhookResponseDto.md +29 -11
  57. data/docs/WebhooksApi.md +225 -134
  58. data/git_push.sh +41 -28
  59. data/lib/devdraft/api/api_health_api.rb +32 -16
  60. data/lib/devdraft/api/app_balances_api.rb +45 -22
  61. data/lib/devdraft/api/customers_api.rb +124 -71
  62. data/lib/devdraft/api/exchange_rates_api.rb +49 -26
  63. data/lib/devdraft/api/invoices_api.rb +89 -53
  64. data/lib/devdraft/api/liquidation_addresses_api.rb +70 -44
  65. data/lib/devdraft/api/payment_intents_api.rb +62 -40
  66. data/lib/devdraft/api/payment_links_api.rb +85 -49
  67. data/lib/devdraft/api/products_api.rb +214 -216
  68. data/lib/devdraft/api/taxes_api.rb +257 -66
  69. data/lib/devdraft/api/test_payments_api.rb +70 -44
  70. data/lib/devdraft/api/transfers_api.rb +206 -46
  71. data/lib/devdraft/api/wallets_api.rb +18 -9
  72. data/lib/devdraft/api/webhooks_api.rb +109 -66
  73. data/lib/devdraft/api_client.rb +76 -71
  74. data/lib/devdraft/api_error.rb +5 -4
  75. data/lib/devdraft/api_model_base.rb +88 -0
  76. data/lib/devdraft/configuration.rb +121 -18
  77. data/lib/devdraft/models/aggregated_balance_response.rb +68 -101
  78. data/lib/devdraft/models/all_balances_response.rb +76 -99
  79. data/lib/devdraft/models/bridge_fiat_payment_rail.rb +45 -0
  80. data/lib/devdraft/models/bridge_payment_rail.rb +36 -24
  81. data/lib/devdraft/models/create_bank_payment_intent_dto.rb +191 -114
  82. data/lib/devdraft/models/create_customer_dto.rb +123 -113
  83. data/lib/devdraft/models/create_direct_bank_transfer_dto.rb +105 -104
  84. data/lib/devdraft/models/create_direct_wallet_transfer_dto.rb +89 -100
  85. data/lib/devdraft/models/create_external_bank_transfer_dto.rb +505 -0
  86. data/lib/devdraft/models/create_external_stablecoin_transfer_dto.rb +266 -0
  87. data/lib/devdraft/models/create_invoice_dto.rb +151 -121
  88. data/lib/devdraft/models/create_liquidation_address_dto.rb +195 -115
  89. data/lib/devdraft/models/create_payment_link_dto.rb +192 -214
  90. data/lib/devdraft/models/create_stable_payment_intent_dto.rb +324 -111
  91. data/lib/devdraft/models/create_stablecoin_conversion_dto.rb +102 -101
  92. data/lib/devdraft/models/create_tax_dto.rb +281 -0
  93. data/lib/devdraft/models/create_webhook_dto.rb +104 -101
  94. data/lib/devdraft/models/customer_status.rb +23 -10
  95. data/lib/devdraft/models/customer_type.rb +45 -0
  96. data/lib/devdraft/models/destination_currency.rb +27 -15
  97. data/lib/devdraft/models/exchange_rate_response_dto.rb +103 -102
  98. data/lib/devdraft/models/fiat_currency.rb +22 -10
  99. data/lib/devdraft/models/health_response_dto.rb +99 -106
  100. data/lib/devdraft/models/invoice_product_dto.rb +63 -98
  101. data/lib/devdraft/models/liquidation_address_response_dto.rb +147 -110
  102. data/lib/devdraft/models/payment_link_product_dto.rb +70 -98
  103. data/lib/devdraft/models/payment_request_dto.rb +77 -100
  104. data/lib/devdraft/models/payment_response_dto.rb +102 -101
  105. data/lib/devdraft/models/public_health_response_dto.rb +68 -101
  106. data/lib/devdraft/models/refund_response_dto.rb +102 -101
  107. data/lib/devdraft/models/stable_coin_currency.rb +21 -9
  108. data/lib/devdraft/models/tax_controller_create201_response.rb +201 -0
  109. data/lib/devdraft/models/tax_controller_delete_without_id400_response.rb +165 -0
  110. data/lib/devdraft/models/tax_controller_update_without_id400_response.rb +165 -0
  111. data/lib/devdraft/models/update_customer_dto.rb +117 -113
  112. data/lib/devdraft/models/update_tax_dto.rb +256 -0
  113. data/lib/devdraft/models/update_webhook_dto.rb +70 -101
  114. data/lib/devdraft/models/webhook_response_dto.rb +140 -103
  115. data/lib/devdraft/version.rb +6 -5
  116. data/lib/devdraft.rb +18 -27
  117. data/spec/api/api_health_api_spec.rb +10 -9
  118. data/spec/api/app_balances_api_spec.rb +11 -10
  119. data/spec/api/customers_api_spec.rb +25 -24
  120. data/spec/api/exchange_rates_api_spec.rb +11 -10
  121. data/spec/api/invoices_api_spec.rb +16 -15
  122. data/spec/api/liquidation_addresses_api_spec.rb +13 -12
  123. data/spec/api/payment_intents_api_spec.rb +12 -11
  124. data/spec/api/payment_links_api_spec.rb +14 -13
  125. data/spec/api/products_api_spec.rb +41 -40
  126. data/spec/api/taxes_api_spec.rb +51 -21
  127. data/spec/api/test_payments_api_spec.rb +14 -13
  128. data/spec/api/transfers_api_spec.rb +36 -13
  129. data/spec/api/wallets_api_spec.rb +9 -8
  130. data/spec/api/webhooks_api_spec.rb +20 -19
  131. data/spec/models/aggregated_balance_response_spec.rb +15 -19
  132. data/spec/models/all_balances_response_spec.rb +14 -18
  133. data/spec/models/bridge_fiat_payment_rail_spec.rb +30 -0
  134. data/spec/models/bridge_payment_rail_spec.rb +11 -15
  135. data/spec/models/create_bank_payment_intent_dto_spec.rb +29 -33
  136. data/spec/models/create_customer_dto_spec.rb +17 -25
  137. data/spec/models/create_direct_bank_transfer_dto_spec.rb +19 -23
  138. data/spec/models/create_direct_wallet_transfer_dto_spec.rb +15 -19
  139. data/spec/models/create_external_bank_transfer_dto_spec.rb +102 -0
  140. data/spec/models/create_external_stablecoin_transfer_dto_spec.rb +66 -0
  141. data/spec/models/create_invoice_dto_spec.rb +31 -35
  142. data/spec/models/create_liquidation_address_dto_spec.rb +28 -32
  143. data/spec/models/create_payment_link_dto_spec.rb +34 -76
  144. data/spec/models/create_stable_payment_intent_dto_spec.rb +26 -30
  145. data/spec/models/create_stablecoin_conversion_dto_spec.rb +16 -20
  146. data/spec/models/create_tax_dto_spec.rb +60 -0
  147. data/spec/models/create_webhook_dto_spec.rb +16 -20
  148. data/spec/models/customer_status_spec.rb +11 -15
  149. data/spec/models/customer_type_spec.rb +30 -0
  150. data/spec/models/destination_currency_spec.rb +11 -15
  151. data/spec/models/exchange_rate_response_dto_spec.rb +17 -21
  152. data/spec/models/fiat_currency_spec.rb +11 -15
  153. data/spec/models/health_response_dto_spec.rb +19 -23
  154. data/spec/models/invoice_product_dto_spec.rb +13 -17
  155. data/spec/models/liquidation_address_response_dto_spec.rb +25 -29
  156. data/spec/models/payment_link_product_dto_spec.rb +13 -17
  157. data/spec/models/payment_request_dto_spec.rb +15 -19
  158. data/spec/models/payment_response_dto_spec.rb +16 -20
  159. data/spec/models/public_health_response_dto_spec.rb +15 -19
  160. data/spec/models/refund_response_dto_spec.rb +16 -20
  161. data/spec/models/stable_coin_currency_spec.rb +11 -15
  162. data/spec/models/tax_controller_create201_response_spec.rb +72 -0
  163. data/spec/models/tax_controller_delete_without_id400_response_spec.rb +48 -0
  164. data/spec/models/tax_controller_update_without_id400_response_spec.rb +48 -0
  165. data/spec/models/update_customer_dto_spec.rb +17 -25
  166. data/spec/models/update_tax_dto_spec.rb +60 -0
  167. data/spec/models/update_webhook_dto_spec.rb +16 -20
  168. data/spec/models/webhook_response_dto_spec.rb +19 -23
  169. data/spec/spec_helper.rb +5 -4
  170. metadata +49 -116
  171. data/docs/AllOfAllBalancesResponseEurc.md +0 -9
  172. data/docs/AllOfAllBalancesResponseUsdc.md +0 -9
  173. data/docs/AllOfCreateBankPaymentIntentDtoDestinationCurrency.md +0 -6
  174. data/docs/AllOfCreateBankPaymentIntentDtoDestinationNetwork.md +0 -6
  175. data/docs/AllOfCreateBankPaymentIntentDtoSourceCurrency.md +0 -6
  176. data/docs/AllOfCreateBankPaymentIntentDtoSourcePaymentRail.md +0 -6
  177. data/docs/AllOfCreateCustomerDtoStatus.md +0 -6
  178. data/docs/AllOfCreateLiquidationAddressDtoDestinationCurrency.md +0 -6
  179. data/docs/AllOfCreateLiquidationAddressDtoDestinationPaymentRail.md +0 -6
  180. data/docs/AllOfCreateStablePaymentIntentDtoDestinationCurrency.md +0 -6
  181. data/docs/AllOfCreateStablePaymentIntentDtoDestinationNetwork.md +0 -6
  182. data/docs/AllOfCreateStablePaymentIntentDtoSourceCurrency.md +0 -6
  183. data/docs/AllOfCreateStablePaymentIntentDtoSourceNetwork.md +0 -6
  184. data/docs/AllOfUpdateCustomerDtoStatus.md +0 -6
  185. data/docs/CreateProductDto.md +0 -18
  186. data/docs/CreateTaxInput.md +0 -6
  187. data/docs/UpdatePaymentLinkDto.md +0 -6
  188. data/docs/UpdatePreferenceInput.md +0 -6
  189. data/docs/UpdateProductDto.md +0 -18
  190. data/docs/UpdateTaxInput.md +0 -6
  191. data/example.rb +0 -129
  192. data/lib/devdraft/models/all_of_all_balances_response_eurc.rb +0 -283
  193. data/lib/devdraft/models/all_of_all_balances_response_usdc.rb +0 -283
  194. data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_destination_currency.rb +0 -202
  195. data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_destination_network.rb +0 -202
  196. data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_source_currency.rb +0 -202
  197. data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_source_payment_rail.rb +0 -202
  198. data/lib/devdraft/models/all_of_create_customer_dto_status.rb +0 -202
  199. data/lib/devdraft/models/all_of_create_liquidation_address_dto_destination_currency.rb +0 -202
  200. data/lib/devdraft/models/all_of_create_liquidation_address_dto_destination_payment_rail.rb +0 -202
  201. data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_destination_currency.rb +0 -202
  202. data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_destination_network.rb +0 -202
  203. data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_source_currency.rb +0 -202
  204. data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_source_network.rb +0 -202
  205. data/lib/devdraft/models/all_of_update_customer_dto_status.rb +0 -202
  206. data/lib/devdraft/models/create_product_dto.rb +0 -370
  207. data/lib/devdraft/models/create_tax_input.rb +0 -197
  208. data/lib/devdraft/models/update_payment_link_dto.rb +0 -197
  209. data/lib/devdraft/models/update_preference_input.rb +0 -197
  210. data/lib/devdraft/models/update_product_dto.rb +0 -355
  211. data/lib/devdraft/models/update_tax_input.rb +0 -197
  212. data/spec/api_client_spec.rb +0 -225
  213. data/spec/base_object_spec.rb +0 -109
  214. data/spec/configuration_spec.rb +0 -41
  215. data/spec/models/all_of_all_balances_response_eurc_spec.rb +0 -56
  216. data/spec/models/all_of_all_balances_response_usdc_spec.rb +0 -56
  217. data/spec/models/all_of_create_bank_payment_intent_dto_destination_currency_spec.rb +0 -34
  218. data/spec/models/all_of_create_bank_payment_intent_dto_destination_network_spec.rb +0 -34
  219. data/spec/models/all_of_create_bank_payment_intent_dto_source_currency_spec.rb +0 -34
  220. data/spec/models/all_of_create_bank_payment_intent_dto_source_payment_rail_spec.rb +0 -34
  221. data/spec/models/all_of_create_customer_dto_status_spec.rb +0 -34
  222. data/spec/models/all_of_create_liquidation_address_dto_destination_currency_spec.rb +0 -34
  223. data/spec/models/all_of_create_liquidation_address_dto_destination_payment_rail_spec.rb +0 -34
  224. data/spec/models/all_of_create_stable_payment_intent_dto_destination_currency_spec.rb +0 -34
  225. data/spec/models/all_of_create_stable_payment_intent_dto_destination_network_spec.rb +0 -34
  226. data/spec/models/all_of_create_stable_payment_intent_dto_source_currency_spec.rb +0 -34
  227. data/spec/models/all_of_create_stable_payment_intent_dto_source_network_spec.rb +0 -34
  228. data/spec/models/all_of_update_customer_dto_status_spec.rb +0 -34
  229. data/spec/models/create_product_dto_spec.rb +0 -110
  230. data/spec/models/create_tax_input_spec.rb +0 -34
  231. data/spec/models/update_payment_link_dto_spec.rb +0 -34
  232. data/spec/models/update_preference_input_spec.rb +0 -34
  233. data/spec/models/update_product_dto_spec.rb +0 -110
  234. data/spec/models/update_tax_input_spec.rb +0 -34
@@ -3,16 +3,18 @@
3
3
 
4
4
  # A comprehensive payment processing and business management API that enables seamless integration of cryptocurrency and traditional payment methods.
5
5
 
6
- OpenAPI spec version: 1.0.0
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.17.0
7
10
 
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.65
10
11
  =end
11
12
 
12
13
  require 'date'
14
+ require 'time'
13
15
 
14
- module DevDraftAI
15
- class CreatePaymentLinkDto
16
+ module Devdraft
17
+ class CreatePaymentLinkDto < ApiModelBase
16
18
  # Display title for the payment link. This appears on the checkout page and in customer communications.
17
19
  attr_accessor :title
18
20
 
@@ -34,9 +36,6 @@ module DevDraftAI
34
36
  # Payment for ID
35
37
  attr_accessor :payment_for_id
36
38
 
37
- # Recurring type
38
- attr_accessor :recurring_type
39
-
40
39
  # Customer ID
41
40
  attr_accessor :customer_id
42
41
 
@@ -58,9 +57,6 @@ module DevDraftAI
58
57
  # Whether to collect address
59
58
  attr_accessor :collect_address
60
59
 
61
- # Whether to require phone number
62
- attr_accessor :require_phone_number
63
-
64
60
  # Whether to limit payments
65
61
  attr_accessor :limit_payments
66
62
 
@@ -70,18 +66,9 @@ module DevDraftAI
70
66
  # Custom fields
71
67
  attr_accessor :custom_fields
72
68
 
73
- # Whether to allow business tax ID
74
- attr_accessor :allow_business_tax_id
75
-
76
69
  # Whether to allow mobile payment
77
70
  attr_accessor :allow_mobile_payment
78
71
 
79
- # Confirmation page type
80
- attr_accessor :confirmation_page
81
-
82
- # Whether to create invoice PDF
83
- attr_accessor :create_invoice_pdf
84
-
85
72
  # Currency
86
73
  attr_accessor :currency
87
74
 
@@ -120,7 +107,6 @@ module DevDraftAI
120
107
  :'link_type' => :'linkType',
121
108
  :'amount' => :'amount',
122
109
  :'payment_for_id' => :'paymentForId',
123
- :'recurring_type' => :'recurringType',
124
110
  :'customer_id' => :'customerId',
125
111
  :'payment_link_products' => :'paymentLinkProducts',
126
112
  :'is_for_all_product' => :'isForAllProduct',
@@ -128,47 +114,48 @@ module DevDraftAI
128
114
  :'collect_tax' => :'collectTax',
129
115
  :'tax_id' => :'taxId',
130
116
  :'collect_address' => :'collectAddress',
131
- :'require_phone_number' => :'requirePhoneNumber',
132
117
  :'limit_payments' => :'limitPayments',
133
118
  :'max_payments' => :'maxPayments',
134
119
  :'custom_fields' => :'customFields',
135
- :'allow_business_tax_id' => :'allowBusinessTaxId',
136
120
  :'allow_mobile_payment' => :'allowMobilePayment',
137
- :'confirmation_page' => :'confirmationPage',
138
- :'create_invoice_pdf' => :'createInvoicePdf',
139
121
  :'currency' => :'currency',
140
122
  :'expiration_date' => :'expiration_date'
141
123
  }
142
124
  end
143
125
 
126
+ # Returns attribute mapping this model knows about
127
+ def self.acceptable_attribute_map
128
+ attribute_map
129
+ end
130
+
131
+ # Returns all the JSON keys this model knows about
132
+ def self.acceptable_attributes
133
+ acceptable_attribute_map.values
134
+ end
135
+
144
136
  # Attribute type mapping.
145
137
  def self.openapi_types
146
138
  {
147
- :'title' => :'Object',
148
- :'url' => :'Object',
149
- :'description' => :'Object',
150
- :'cover_image' => :'Object',
151
- :'link_type' => :'Object',
152
- :'amount' => :'Object',
153
- :'payment_for_id' => :'Object',
154
- :'recurring_type' => :'Object',
155
- :'customer_id' => :'Object',
156
- :'payment_link_products' => :'Object',
157
- :'is_for_all_product' => :'Object',
158
- :'allow_quantity_adjustment' => :'Object',
159
- :'collect_tax' => :'Object',
160
- :'tax_id' => :'Object',
161
- :'collect_address' => :'Object',
162
- :'require_phone_number' => :'Object',
163
- :'limit_payments' => :'Object',
164
- :'max_payments' => :'Object',
139
+ :'title' => :'String',
140
+ :'url' => :'String',
141
+ :'description' => :'String',
142
+ :'cover_image' => :'String',
143
+ :'link_type' => :'String',
144
+ :'amount' => :'Float',
145
+ :'payment_for_id' => :'String',
146
+ :'customer_id' => :'String',
147
+ :'payment_link_products' => :'Array<PaymentLinkProductDto>',
148
+ :'is_for_all_product' => :'Boolean',
149
+ :'allow_quantity_adjustment' => :'Boolean',
150
+ :'collect_tax' => :'Boolean',
151
+ :'tax_id' => :'String',
152
+ :'collect_address' => :'Boolean',
153
+ :'limit_payments' => :'Boolean',
154
+ :'max_payments' => :'Float',
165
155
  :'custom_fields' => :'Object',
166
- :'allow_business_tax_id' => :'Object',
167
- :'allow_mobile_payment' => :'Object',
168
- :'confirmation_page' => :'Object',
169
- :'create_invoice_pdf' => :'Object',
170
- :'currency' => :'Object',
171
- :'expiration_date' => :'Object'
156
+ :'allow_mobile_payment' => :'Boolean',
157
+ :'currency' => :'String',
158
+ :'expiration_date' => :'Time'
172
159
  }
173
160
  end
174
161
 
@@ -177,28 +164,33 @@ module DevDraftAI
177
164
  Set.new([
178
165
  ])
179
166
  end
180
-
167
+
181
168
  # Initializes the object
182
169
  # @param [Hash] attributes Model attributes in the form of hash
183
170
  def initialize(attributes = {})
184
171
  if (!attributes.is_a?(Hash))
185
- fail ArgumentError, "The input argument (attributes) must be a hash in `DevDraftAI::CreatePaymentLinkDto` initialize method"
172
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Devdraft::CreatePaymentLinkDto` initialize method"
186
173
  end
187
174
 
188
175
  # check to see if the attribute exists and convert string to symbol for hash key
176
+ acceptable_attribute_map = self.class.acceptable_attribute_map
189
177
  attributes = attributes.each_with_object({}) { |(k, v), h|
190
- if (!self.class.attribute_map.key?(k.to_sym))
191
- fail ArgumentError, "`#{k}` is not a valid attribute in `DevDraftAI::CreatePaymentLinkDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
178
+ if (!acceptable_attribute_map.key?(k.to_sym))
179
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Devdraft::CreatePaymentLinkDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
192
180
  end
193
181
  h[k.to_sym] = v
194
182
  }
195
183
 
196
184
  if attributes.key?(:'title')
197
185
  self.title = attributes[:'title']
186
+ else
187
+ self.title = nil
198
188
  end
199
189
 
200
190
  if attributes.key?(:'url')
201
191
  self.url = attributes[:'url']
192
+ else
193
+ self.url = nil
202
194
  end
203
195
 
204
196
  if attributes.key?(:'description')
@@ -211,6 +203,8 @@ module DevDraftAI
211
203
 
212
204
  if attributes.key?(:'link_type')
213
205
  self.link_type = attributes[:'link_type']
206
+ else
207
+ self.link_type = nil
214
208
  end
215
209
 
216
210
  if attributes.key?(:'amount')
@@ -221,12 +215,6 @@ module DevDraftAI
221
215
  self.payment_for_id = attributes[:'payment_for_id']
222
216
  end
223
217
 
224
- if attributes.key?(:'recurring_type')
225
- self.recurring_type = attributes[:'recurring_type']
226
- else
227
- self.recurring_type = 'ONE_TIME'
228
- end
229
-
230
218
  if attributes.key?(:'customer_id')
231
219
  self.customer_id = attributes[:'customer_id']
232
220
  end
@@ -265,12 +253,6 @@ module DevDraftAI
265
253
  self.collect_address = false
266
254
  end
267
255
 
268
- if attributes.key?(:'require_phone_number')
269
- self.require_phone_number = attributes[:'require_phone_number']
270
- else
271
- self.require_phone_number = false
272
- end
273
-
274
256
  if attributes.key?(:'limit_payments')
275
257
  self.limit_payments = attributes[:'limit_payments']
276
258
  else
@@ -285,30 +267,12 @@ module DevDraftAI
285
267
  self.custom_fields = attributes[:'custom_fields']
286
268
  end
287
269
 
288
- if attributes.key?(:'allow_business_tax_id')
289
- self.allow_business_tax_id = attributes[:'allow_business_tax_id']
290
- else
291
- self.allow_business_tax_id = false
292
- end
293
-
294
270
  if attributes.key?(:'allow_mobile_payment')
295
271
  self.allow_mobile_payment = attributes[:'allow_mobile_payment']
296
272
  else
297
273
  self.allow_mobile_payment = false
298
274
  end
299
275
 
300
- if attributes.key?(:'confirmation_page')
301
- self.confirmation_page = attributes[:'confirmation_page']
302
- else
303
- self.confirmation_page = 'SHOW'
304
- end
305
-
306
- if attributes.key?(:'create_invoice_pdf')
307
- self.create_invoice_pdf = attributes[:'create_invoice_pdf']
308
- else
309
- self.create_invoice_pdf = false
310
- end
311
-
312
276
  if attributes.key?(:'currency')
313
277
  self.currency = attributes[:'currency']
314
278
  else
@@ -323,21 +287,34 @@ module DevDraftAI
323
287
  # Show invalid properties with the reasons. Usually used together with valid?
324
288
  # @return Array for valid properties with the reasons
325
289
  def list_invalid_properties
290
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
326
291
  invalid_properties = Array.new
327
292
  if @title.nil?
328
293
  invalid_properties.push('invalid value for "title", title cannot be nil.')
329
294
  end
330
295
 
296
+ if @title.to_s.length > 100
297
+ invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 100.')
298
+ end
299
+
300
+ if @title.to_s.length < 3
301
+ invalid_properties.push('invalid value for "title", the character length must be greater than or equal to 3.')
302
+ end
303
+
331
304
  if @url.nil?
332
305
  invalid_properties.push('invalid value for "url", url cannot be nil.')
333
306
  end
334
307
 
308
+ if !@description.nil? && @description.to_s.length > 500
309
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 500.')
310
+ end
311
+
335
312
  if @link_type.nil?
336
313
  invalid_properties.push('invalid value for "link_type", link_type cannot be nil.')
337
314
  end
338
315
 
339
- if @recurring_type.nil?
340
- invalid_properties.push('invalid value for "recurring_type", recurring_type cannot be nil.')
316
+ if !@amount.nil? && @amount < 0.01
317
+ invalid_properties.push('invalid value for "amount", must be greater than or equal to 0.01.')
341
318
  end
342
319
 
343
320
  if @allow_quantity_adjustment.nil?
@@ -352,22 +329,14 @@ module DevDraftAI
352
329
  invalid_properties.push('invalid value for "collect_address", collect_address cannot be nil.')
353
330
  end
354
331
 
355
- if @require_phone_number.nil?
356
- invalid_properties.push('invalid value for "require_phone_number", require_phone_number cannot be nil.')
332
+ if !@max_payments.nil? && @max_payments < 1
333
+ invalid_properties.push('invalid value for "max_payments", must be greater than or equal to 1.')
357
334
  end
358
335
 
359
336
  if @allow_mobile_payment.nil?
360
337
  invalid_properties.push('invalid value for "allow_mobile_payment", allow_mobile_payment cannot be nil.')
361
338
  end
362
339
 
363
- if @confirmation_page.nil?
364
- invalid_properties.push('invalid value for "confirmation_page", confirmation_page cannot be nil.')
365
- end
366
-
367
- if @create_invoice_pdf.nil?
368
- invalid_properties.push('invalid value for "create_invoice_pdf", create_invoice_pdf cannot be nil.')
369
- end
370
-
371
340
  if @currency.nil?
372
341
  invalid_properties.push('invalid value for "currency", currency cannot be nil.')
373
342
  end
@@ -378,63 +347,151 @@ module DevDraftAI
378
347
  # Check to see if the all the properties in the model are valid
379
348
  # @return true if the model is valid
380
349
  def valid?
350
+ warn '[DEPRECATED] the `valid?` method is obsolete'
381
351
  return false if @title.nil?
352
+ return false if @title.to_s.length > 100
353
+ return false if @title.to_s.length < 3
382
354
  return false if @url.nil?
355
+ return false if !@description.nil? && @description.to_s.length > 500
383
356
  return false if @link_type.nil?
384
- link_type_validator = EnumAttributeValidator.new('Object', ['INVOICE', 'PRODUCT', 'COLLECTION', 'SUBSCRIPTION', 'DONATION'])
357
+ link_type_validator = EnumAttributeValidator.new('String', ["INVOICE", "PRODUCT", "COLLECTION", "DONATION"])
385
358
  return false unless link_type_validator.valid?(@link_type)
386
- return false if @recurring_type.nil?
387
- recurring_type_validator = EnumAttributeValidator.new('Object', ['ONE_TIME', 'WEEKLY', 'BI_WEEKLY', 'MONTHLY', 'BI_MONTHLY', 'QUARTERLY', 'ANNUALLY'])
388
- return false unless recurring_type_validator.valid?(@recurring_type)
359
+ return false if !@amount.nil? && @amount < 0.01
389
360
  return false if @allow_quantity_adjustment.nil?
390
361
  return false if @collect_tax.nil?
391
362
  return false if @collect_address.nil?
392
- return false if @require_phone_number.nil?
363
+ return false if !@max_payments.nil? && @max_payments < 1
393
364
  return false if @allow_mobile_payment.nil?
394
- return false if @confirmation_page.nil?
395
- confirmation_page_validator = EnumAttributeValidator.new('Object', ['SHOW', 'REDIRECT'])
396
- return false unless confirmation_page_validator.valid?(@confirmation_page)
397
- return false if @create_invoice_pdf.nil?
398
365
  return false if @currency.nil?
399
- currency_validator = EnumAttributeValidator.new('Object', ['usdc', 'eurc'])
366
+ currency_validator = EnumAttributeValidator.new('String', ["usdc", "eurc"])
400
367
  return false unless currency_validator.valid?(@currency)
401
368
  true
402
369
  end
403
370
 
371
+ # Custom attribute writer method with validation
372
+ # @param [Object] title Value to be assigned
373
+ def title=(title)
374
+ if title.nil?
375
+ fail ArgumentError, 'title cannot be nil'
376
+ end
377
+
378
+ if title.to_s.length > 100
379
+ fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 100.'
380
+ end
381
+
382
+ if title.to_s.length < 3
383
+ fail ArgumentError, 'invalid value for "title", the character length must be greater than or equal to 3.'
384
+ end
385
+
386
+ @title = title
387
+ end
388
+
389
+ # Custom attribute writer method with validation
390
+ # @param [Object] url Value to be assigned
391
+ def url=(url)
392
+ if url.nil?
393
+ fail ArgumentError, 'url cannot be nil'
394
+ end
395
+
396
+ @url = url
397
+ end
398
+
399
+ # Custom attribute writer method with validation
400
+ # @param [Object] description Value to be assigned
401
+ def description=(description)
402
+ if description.nil?
403
+ fail ArgumentError, 'description cannot be nil'
404
+ end
405
+
406
+ if description.to_s.length > 500
407
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 500.'
408
+ end
409
+
410
+ @description = description
411
+ end
412
+
404
413
  # Custom attribute writer method checking allowed values (enum).
405
414
  # @param [Object] link_type Object to be assigned
406
415
  def link_type=(link_type)
407
- validator = EnumAttributeValidator.new('Object', ['INVOICE', 'PRODUCT', 'COLLECTION', 'SUBSCRIPTION', 'DONATION'])
416
+ validator = EnumAttributeValidator.new('String', ["INVOICE", "PRODUCT", "COLLECTION", "DONATION"])
408
417
  unless validator.valid?(link_type)
409
418
  fail ArgumentError, "invalid value for \"link_type\", must be one of #{validator.allowable_values}."
410
419
  end
411
420
  @link_type = link_type
412
421
  end
413
422
 
414
- # Custom attribute writer method checking allowed values (enum).
415
- # @param [Object] recurring_type Object to be assigned
416
- def recurring_type=(recurring_type)
417
- validator = EnumAttributeValidator.new('Object', ['ONE_TIME', 'WEEKLY', 'BI_WEEKLY', 'MONTHLY', 'BI_MONTHLY', 'QUARTERLY', 'ANNUALLY'])
418
- unless validator.valid?(recurring_type)
419
- fail ArgumentError, "invalid value for \"recurring_type\", must be one of #{validator.allowable_values}."
423
+ # Custom attribute writer method with validation
424
+ # @param [Object] amount Value to be assigned
425
+ def amount=(amount)
426
+ if amount.nil?
427
+ fail ArgumentError, 'amount cannot be nil'
420
428
  end
421
- @recurring_type = recurring_type
429
+
430
+ if amount < 0.01
431
+ fail ArgumentError, 'invalid value for "amount", must be greater than or equal to 0.01.'
432
+ end
433
+
434
+ @amount = amount
422
435
  end
423
436
 
424
- # Custom attribute writer method checking allowed values (enum).
425
- # @param [Object] confirmation_page Object to be assigned
426
- def confirmation_page=(confirmation_page)
427
- validator = EnumAttributeValidator.new('Object', ['SHOW', 'REDIRECT'])
428
- unless validator.valid?(confirmation_page)
429
- fail ArgumentError, "invalid value for \"confirmation_page\", must be one of #{validator.allowable_values}."
437
+ # Custom attribute writer method with validation
438
+ # @param [Object] allow_quantity_adjustment Value to be assigned
439
+ def allow_quantity_adjustment=(allow_quantity_adjustment)
440
+ if allow_quantity_adjustment.nil?
441
+ fail ArgumentError, 'allow_quantity_adjustment cannot be nil'
442
+ end
443
+
444
+ @allow_quantity_adjustment = allow_quantity_adjustment
445
+ end
446
+
447
+ # Custom attribute writer method with validation
448
+ # @param [Object] collect_tax Value to be assigned
449
+ def collect_tax=(collect_tax)
450
+ if collect_tax.nil?
451
+ fail ArgumentError, 'collect_tax cannot be nil'
430
452
  end
431
- @confirmation_page = confirmation_page
453
+
454
+ @collect_tax = collect_tax
455
+ end
456
+
457
+ # Custom attribute writer method with validation
458
+ # @param [Object] collect_address Value to be assigned
459
+ def collect_address=(collect_address)
460
+ if collect_address.nil?
461
+ fail ArgumentError, 'collect_address cannot be nil'
462
+ end
463
+
464
+ @collect_address = collect_address
465
+ end
466
+
467
+ # Custom attribute writer method with validation
468
+ # @param [Object] max_payments Value to be assigned
469
+ def max_payments=(max_payments)
470
+ if max_payments.nil?
471
+ fail ArgumentError, 'max_payments cannot be nil'
472
+ end
473
+
474
+ if max_payments < 1
475
+ fail ArgumentError, 'invalid value for "max_payments", must be greater than or equal to 1.'
476
+ end
477
+
478
+ @max_payments = max_payments
479
+ end
480
+
481
+ # Custom attribute writer method with validation
482
+ # @param [Object] allow_mobile_payment Value to be assigned
483
+ def allow_mobile_payment=(allow_mobile_payment)
484
+ if allow_mobile_payment.nil?
485
+ fail ArgumentError, 'allow_mobile_payment cannot be nil'
486
+ end
487
+
488
+ @allow_mobile_payment = allow_mobile_payment
432
489
  end
433
490
 
434
491
  # Custom attribute writer method checking allowed values (enum).
435
492
  # @param [Object] currency Object to be assigned
436
493
  def currency=(currency)
437
- validator = EnumAttributeValidator.new('Object', ['usdc', 'eurc'])
494
+ validator = EnumAttributeValidator.new('String', ["usdc", "eurc"])
438
495
  unless validator.valid?(currency)
439
496
  fail ArgumentError, "invalid value for \"currency\", must be one of #{validator.allowable_values}."
440
497
  end
@@ -453,7 +510,6 @@ module DevDraftAI
453
510
  link_type == o.link_type &&
454
511
  amount == o.amount &&
455
512
  payment_for_id == o.payment_for_id &&
456
- recurring_type == o.recurring_type &&
457
513
  customer_id == o.customer_id &&
458
514
  payment_link_products == o.payment_link_products &&
459
515
  is_for_all_product == o.is_for_all_product &&
@@ -461,14 +517,10 @@ module DevDraftAI
461
517
  collect_tax == o.collect_tax &&
462
518
  tax_id == o.tax_id &&
463
519
  collect_address == o.collect_address &&
464
- require_phone_number == o.require_phone_number &&
465
520
  limit_payments == o.limit_payments &&
466
521
  max_payments == o.max_payments &&
467
522
  custom_fields == o.custom_fields &&
468
- allow_business_tax_id == o.allow_business_tax_id &&
469
523
  allow_mobile_payment == o.allow_mobile_payment &&
470
- confirmation_page == o.confirmation_page &&
471
- create_invoice_pdf == o.create_invoice_pdf &&
472
524
  currency == o.currency &&
473
525
  expiration_date == o.expiration_date
474
526
  end
@@ -482,89 +534,30 @@ module DevDraftAI
482
534
  # Calculates hash code according to all attributes.
483
535
  # @return [Integer] Hash code
484
536
  def hash
485
- [title, url, description, cover_image, link_type, amount, payment_for_id, recurring_type, customer_id, payment_link_products, is_for_all_product, allow_quantity_adjustment, collect_tax, tax_id, collect_address, require_phone_number, limit_payments, max_payments, custom_fields, allow_business_tax_id, allow_mobile_payment, confirmation_page, create_invoice_pdf, currency, expiration_date].hash
537
+ [title, url, description, cover_image, link_type, amount, payment_for_id, customer_id, payment_link_products, is_for_all_product, allow_quantity_adjustment, collect_tax, tax_id, collect_address, limit_payments, max_payments, custom_fields, allow_mobile_payment, currency, expiration_date].hash
486
538
  end
487
539
 
488
540
  # Builds the object from hash
489
541
  # @param [Hash] attributes Model attributes in the form of hash
490
542
  # @return [Object] Returns the model itself
491
543
  def self.build_from_hash(attributes)
492
- new.build_from_hash(attributes)
493
- end
494
-
495
- # Builds the object from hash
496
- # @param [Hash] attributes Model attributes in the form of hash
497
- # @return [Object] Returns the model itself
498
- def build_from_hash(attributes)
499
544
  return nil unless attributes.is_a?(Hash)
500
- self.class.openapi_types.each_pair do |key, type|
501
- if type =~ /\AArray<(.*)>/i
545
+ attributes = attributes.transform_keys(&:to_sym)
546
+ transformed_hash = {}
547
+ openapi_types.each_pair do |key, type|
548
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
549
+ transformed_hash["#{key}"] = nil
550
+ elsif type =~ /\AArray<(.*)>/i
502
551
  # check to ensure the input is an array given that the attribute
503
552
  # is documented as an array but the input is not
504
- if attributes[self.class.attribute_map[key]].is_a?(Array)
505
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
553
+ if attributes[attribute_map[key]].is_a?(Array)
554
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
506
555
  end
507
- elsif !attributes[self.class.attribute_map[key]].nil?
508
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
509
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
510
- self.send("#{key}=", nil)
556
+ elsif !attributes[attribute_map[key]].nil?
557
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
511
558
  end
512
559
  end
513
-
514
- self
515
- end
516
-
517
- # Deserializes the data based on type
518
- # @param string type Data type
519
- # @param string value Value to be deserialized
520
- # @return [Object] Deserialized data
521
- def _deserialize(type, value)
522
- case type.to_sym
523
- when :DateTime
524
- DateTime.parse(value)
525
- when :Date
526
- Date.parse(value)
527
- when :String
528
- value.to_s
529
- when :Integer
530
- value.to_i
531
- when :Float
532
- value.to_f
533
- when :Boolean
534
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
535
- true
536
- else
537
- false
538
- end
539
- when :Object
540
- # generic object (usually a Hash), return directly
541
- value
542
- when /\AArray<(?<inner_type>.+)>\z/
543
- inner_type = Regexp.last_match[:inner_type]
544
- value.map { |v| _deserialize(inner_type, v) }
545
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
546
- k_type = Regexp.last_match[:k_type]
547
- v_type = Regexp.last_match[:v_type]
548
- {}.tap do |hash|
549
- value.each do |k, v|
550
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
551
- end
552
- end
553
- else # model
554
- DevDraftAI.const_get(type).build_from_hash(value)
555
- end
556
- end
557
-
558
- # Returns the string representation of the object
559
- # @return [String] String presentation of the object
560
- def to_s
561
- to_hash.to_s
562
- end
563
-
564
- # to_body is an alias to to_hash (backward compatibility)
565
- # @return [Hash] Returns the object in the form of hash
566
- def to_body
567
- to_hash
560
+ new(transformed_hash)
568
561
  end
569
562
 
570
563
  # Returns the object in the form of hash
@@ -583,21 +576,6 @@ module DevDraftAI
583
576
  hash
584
577
  end
585
578
 
586
- # Outputs non-array value in the form of hash
587
- # For object, use to_hash. Otherwise, just return the value
588
- # @param [Object] value Any valid value
589
- # @return [Hash] Returns the value in the form of hash
590
- def _to_hash(value)
591
- if value.is_a?(Array)
592
- value.compact.map { |v| _to_hash(v) }
593
- elsif value.is_a?(Hash)
594
- {}.tap do |hash|
595
- value.each { |k, v| hash[k] = _to_hash(v) }
596
- end
597
- elsif value.respond_to? :to_hash
598
- value.to_hash
599
- else
600
- value
601
- end
602
- end end
579
+ end
580
+
603
581
  end