devdraft 1.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 (205) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +1246 -0
  4. data/Rakefile +8 -0
  5. data/devdraft_ai_sdk.gemspec +38 -0
  6. data/docs/APIHealthApi.md +87 -0
  7. data/docs/AggregatedBalanceResponse.md +9 -0
  8. data/docs/AllBalancesResponse.md +9 -0
  9. data/docs/AllOfAllBalancesResponseEurc.md +9 -0
  10. data/docs/AllOfAllBalancesResponseUsdc.md +9 -0
  11. data/docs/AllOfCreateBankPaymentIntentDtoDestinationCurrency.md +6 -0
  12. data/docs/AllOfCreateBankPaymentIntentDtoDestinationNetwork.md +6 -0
  13. data/docs/AllOfCreateBankPaymentIntentDtoSourceCurrency.md +6 -0
  14. data/docs/AllOfCreateBankPaymentIntentDtoSourcePaymentRail.md +6 -0
  15. data/docs/AllOfCreateCustomerDtoStatus.md +6 -0
  16. data/docs/AllOfCreateLiquidationAddressDtoDestinationCurrency.md +6 -0
  17. data/docs/AllOfCreateLiquidationAddressDtoDestinationPaymentRail.md +6 -0
  18. data/docs/AllOfCreateStablePaymentIntentDtoDestinationCurrency.md +6 -0
  19. data/docs/AllOfCreateStablePaymentIntentDtoDestinationNetwork.md +6 -0
  20. data/docs/AllOfCreateStablePaymentIntentDtoSourceCurrency.md +6 -0
  21. data/docs/AllOfCreateStablePaymentIntentDtoSourceNetwork.md +6 -0
  22. data/docs/AllOfUpdateCustomerDtoStatus.md +6 -0
  23. data/docs/AppBalancesApi.md +169 -0
  24. data/docs/BridgePaymentRail.md +6 -0
  25. data/docs/CreateBankPaymentIntentDto.md +24 -0
  26. data/docs/CreateCustomerDto.md +12 -0
  27. data/docs/CreateDirectBankTransferDto.md +14 -0
  28. data/docs/CreateDirectWalletTransferDto.md +10 -0
  29. data/docs/CreateInvoiceDto.md +22 -0
  30. data/docs/CreateLiquidationAddressDto.md +21 -0
  31. data/docs/CreatePaymentLinkDto.md +31 -0
  32. data/docs/CreateProductDto.md +18 -0
  33. data/docs/CreateStablePaymentIntentDto.md +21 -0
  34. data/docs/CreateStablecoinConversionDto.md +11 -0
  35. data/docs/CreateTaxInput.md +6 -0
  36. data/docs/CreateWebhookDto.md +11 -0
  37. data/docs/CustomerStatus.md +6 -0
  38. data/docs/CustomersApi.md +250 -0
  39. data/docs/DestinationCurrency.md +6 -0
  40. data/docs/ExchangeRateResponseDto.md +12 -0
  41. data/docs/ExchangeRatesApi.md +176 -0
  42. data/docs/FiatCurrency.md +6 -0
  43. data/docs/HealthResponseDto.md +12 -0
  44. data/docs/InvoiceProductDto.md +8 -0
  45. data/docs/InvoicesApi.md +236 -0
  46. data/docs/LiquidationAddressResponseDto.md +20 -0
  47. data/docs/LiquidationAddressesApi.md +152 -0
  48. data/docs/PaymentIntentsApi.md +127 -0
  49. data/docs/PaymentLinkProductDto.md +8 -0
  50. data/docs/PaymentLinksApi.md +238 -0
  51. data/docs/PaymentRequestDto.md +10 -0
  52. data/docs/PaymentResponseDto.md +11 -0
  53. data/docs/ProductsApi.md +404 -0
  54. data/docs/PublicHealthResponseDto.md +9 -0
  55. data/docs/RefundResponseDto.md +11 -0
  56. data/docs/StableCoinCurrency.md +6 -0
  57. data/docs/TaxesApi.md +292 -0
  58. data/docs/TestPaymentsApi.md +150 -0
  59. data/docs/TransfersApi.md +175 -0
  60. data/docs/UpdateCustomerDto.md +12 -0
  61. data/docs/UpdatePaymentLinkDto.md +6 -0
  62. data/docs/UpdatePreferenceInput.md +6 -0
  63. data/docs/UpdateProductDto.md +18 -0
  64. data/docs/UpdateTaxInput.md +6 -0
  65. data/docs/UpdateWebhookDto.md +11 -0
  66. data/docs/WalletsApi.md +58 -0
  67. data/docs/WebhookResponseDto.md +14 -0
  68. data/docs/WebhooksApi.md +307 -0
  69. data/git_push.sh +44 -0
  70. data/lib/devdraft/api/api_health_api.rb +116 -0
  71. data/lib/devdraft/api/app_balances_api.rb +170 -0
  72. data/lib/devdraft/api/customers_api.rb +258 -0
  73. data/lib/devdraft/api/exchange_rates_api.rb +184 -0
  74. data/lib/devdraft/api/invoices_api.rb +238 -0
  75. data/lib/devdraft/api/liquidation_addresses_api.rb +202 -0
  76. data/lib/devdraft/api/payment_intents_api.rb +150 -0
  77. data/lib/devdraft/api/payment_links_api.rb +240 -0
  78. data/lib/devdraft/api/products_api.rb +518 -0
  79. data/lib/devdraft/api/taxes_api.rb +290 -0
  80. data/lib/devdraft/api/test_payments_api.rb +202 -0
  81. data/lib/devdraft/api/transfers_api.rb +182 -0
  82. data/lib/devdraft/api/wallets_api.rb +66 -0
  83. data/lib/devdraft/api/webhooks_api.rb +310 -0
  84. data/lib/devdraft/api_client.rb +388 -0
  85. data/lib/devdraft/api_error.rb +57 -0
  86. data/lib/devdraft/configuration.rb +219 -0
  87. data/lib/devdraft/models/aggregated_balance_response.rb +278 -0
  88. data/lib/devdraft/models/all_balances_response.rb +242 -0
  89. data/lib/devdraft/models/all_of_all_balances_response_eurc.rb +283 -0
  90. data/lib/devdraft/models/all_of_all_balances_response_usdc.rb +283 -0
  91. data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_destination_currency.rb +202 -0
  92. data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_destination_network.rb +202 -0
  93. data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_source_currency.rb +202 -0
  94. data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_source_payment_rail.rb +202 -0
  95. data/lib/devdraft/models/all_of_create_customer_dto_status.rb +202 -0
  96. data/lib/devdraft/models/all_of_create_liquidation_address_dto_destination_currency.rb +202 -0
  97. data/lib/devdraft/models/all_of_create_liquidation_address_dto_destination_payment_rail.rb +202 -0
  98. data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_destination_currency.rb +202 -0
  99. data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_destination_network.rb +202 -0
  100. data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_source_currency.rb +202 -0
  101. data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_source_network.rb +202 -0
  102. data/lib/devdraft/models/all_of_update_customer_dto_status.rb +202 -0
  103. data/lib/devdraft/models/bridge_payment_rail.rb +43 -0
  104. data/lib/devdraft/models/create_bank_payment_intent_dto.rb +397 -0
  105. data/lib/devdraft/models/create_customer_dto.rb +308 -0
  106. data/lib/devdraft/models/create_direct_bank_transfer_dto.rb +302 -0
  107. data/lib/devdraft/models/create_direct_wallet_transfer_dto.rb +257 -0
  108. data/lib/devdraft/models/create_invoice_dto.rb +474 -0
  109. data/lib/devdraft/models/create_liquidation_address_dto.rb +408 -0
  110. data/lib/devdraft/models/create_payment_link_dto.rb +603 -0
  111. data/lib/devdraft/models/create_product_dto.rb +370 -0
  112. data/lib/devdraft/models/create_stable_payment_intent_dto.rb +362 -0
  113. data/lib/devdraft/models/create_stablecoin_conversion_dto.rb +272 -0
  114. data/lib/devdraft/models/create_tax_input.rb +197 -0
  115. data/lib/devdraft/models/create_webhook_dto.rb +271 -0
  116. data/lib/devdraft/models/customer_status.rb +29 -0
  117. data/lib/devdraft/models/destination_currency.rb +34 -0
  118. data/lib/devdraft/models/exchange_rate_response_dto.rb +282 -0
  119. data/lib/devdraft/models/fiat_currency.rb +29 -0
  120. data/lib/devdraft/models/health_response_dto.rb +333 -0
  121. data/lib/devdraft/models/invoice_product_dto.rb +227 -0
  122. data/lib/devdraft/models/liquidation_address_response_dto.rb +377 -0
  123. data/lib/devdraft/models/payment_link_product_dto.rb +229 -0
  124. data/lib/devdraft/models/payment_request_dto.rb +252 -0
  125. data/lib/devdraft/models/payment_response_dto.rb +272 -0
  126. data/lib/devdraft/models/public_health_response_dto.rb +276 -0
  127. data/lib/devdraft/models/refund_response_dto.rb +272 -0
  128. data/lib/devdraft/models/stable_coin_currency.rb +28 -0
  129. data/lib/devdraft/models/update_customer_dto.rb +293 -0
  130. data/lib/devdraft/models/update_payment_link_dto.rb +197 -0
  131. data/lib/devdraft/models/update_preference_input.rb +197 -0
  132. data/lib/devdraft/models/update_product_dto.rb +355 -0
  133. data/lib/devdraft/models/update_tax_input.rb +197 -0
  134. data/lib/devdraft/models/update_webhook_dto.rb +251 -0
  135. data/lib/devdraft/models/webhook_response_dto.rb +317 -0
  136. data/lib/devdraft/version.rb +14 -0
  137. data/lib/devdraft.rb +101 -0
  138. data/spec/api/api_health_api_spec.rb +54 -0
  139. data/spec/api/app_balances_api_spec.rb +67 -0
  140. data/spec/api/customers_api_spec.rb +87 -0
  141. data/spec/api/exchange_rates_api_spec.rb +69 -0
  142. data/spec/api/invoices_api_spec.rb +80 -0
  143. data/spec/api/liquidation_addresses_api_spec.rb +72 -0
  144. data/spec/api/payment_intents_api_spec.rb +60 -0
  145. data/spec/api/payment_links_api_spec.rb +81 -0
  146. data/spec/api/products_api_spec.rb +130 -0
  147. data/spec/api/taxes_api_spec.rb +91 -0
  148. data/spec/api/test_payments_api_spec.rb +71 -0
  149. data/spec/api/transfers_api_spec.rb +67 -0
  150. data/spec/api/wallets_api_spec.rb +44 -0
  151. data/spec/api/webhooks_api_spec.rb +96 -0
  152. data/spec/api_client_spec.rb +225 -0
  153. data/spec/base_object_spec.rb +109 -0
  154. data/spec/configuration_spec.rb +41 -0
  155. data/spec/models/aggregated_balance_response_spec.rb +56 -0
  156. data/spec/models/all_balances_response_spec.rb +52 -0
  157. data/spec/models/all_of_all_balances_response_eurc_spec.rb +56 -0
  158. data/spec/models/all_of_all_balances_response_usdc_spec.rb +56 -0
  159. data/spec/models/all_of_create_bank_payment_intent_dto_destination_currency_spec.rb +34 -0
  160. data/spec/models/all_of_create_bank_payment_intent_dto_destination_network_spec.rb +34 -0
  161. data/spec/models/all_of_create_bank_payment_intent_dto_source_currency_spec.rb +34 -0
  162. data/spec/models/all_of_create_bank_payment_intent_dto_source_payment_rail_spec.rb +34 -0
  163. data/spec/models/all_of_create_customer_dto_status_spec.rb +34 -0
  164. data/spec/models/all_of_create_liquidation_address_dto_destination_currency_spec.rb +34 -0
  165. data/spec/models/all_of_create_liquidation_address_dto_destination_payment_rail_spec.rb +34 -0
  166. data/spec/models/all_of_create_stable_payment_intent_dto_destination_currency_spec.rb +34 -0
  167. data/spec/models/all_of_create_stable_payment_intent_dto_destination_network_spec.rb +34 -0
  168. data/spec/models/all_of_create_stable_payment_intent_dto_source_currency_spec.rb +34 -0
  169. data/spec/models/all_of_create_stable_payment_intent_dto_source_network_spec.rb +34 -0
  170. data/spec/models/all_of_update_customer_dto_status_spec.rb +34 -0
  171. data/spec/models/bridge_payment_rail_spec.rb +34 -0
  172. data/spec/models/create_bank_payment_intent_dto_spec.rb +142 -0
  173. data/spec/models/create_customer_dto_spec.rb +74 -0
  174. data/spec/models/create_direct_bank_transfer_dto_spec.rb +82 -0
  175. data/spec/models/create_direct_wallet_transfer_dto_spec.rb +58 -0
  176. data/spec/models/create_invoice_dto_spec.rb +146 -0
  177. data/spec/models/create_liquidation_address_dto_spec.rb +132 -0
  178. data/spec/models/create_payment_link_dto_spec.rb +200 -0
  179. data/spec/models/create_product_dto_spec.rb +110 -0
  180. data/spec/models/create_stable_payment_intent_dto_spec.rb +124 -0
  181. data/spec/models/create_stablecoin_conversion_dto_spec.rb +64 -0
  182. data/spec/models/create_tax_input_spec.rb +34 -0
  183. data/spec/models/create_webhook_dto_spec.rb +64 -0
  184. data/spec/models/customer_status_spec.rb +34 -0
  185. data/spec/models/destination_currency_spec.rb +34 -0
  186. data/spec/models/exchange_rate_response_dto_spec.rb +70 -0
  187. data/spec/models/fiat_currency_spec.rb +34 -0
  188. data/spec/models/health_response_dto_spec.rb +78 -0
  189. data/spec/models/invoice_product_dto_spec.rb +46 -0
  190. data/spec/models/liquidation_address_response_dto_spec.rb +118 -0
  191. data/spec/models/payment_link_product_dto_spec.rb +46 -0
  192. data/spec/models/payment_request_dto_spec.rb +58 -0
  193. data/spec/models/payment_response_dto_spec.rb +64 -0
  194. data/spec/models/public_health_response_dto_spec.rb +56 -0
  195. data/spec/models/refund_response_dto_spec.rb +64 -0
  196. data/spec/models/stable_coin_currency_spec.rb +34 -0
  197. data/spec/models/update_customer_dto_spec.rb +74 -0
  198. data/spec/models/update_payment_link_dto_spec.rb +34 -0
  199. data/spec/models/update_preference_input_spec.rb +34 -0
  200. data/spec/models/update_product_dto_spec.rb +110 -0
  201. data/spec/models/update_tax_input_spec.rb +34 -0
  202. data/spec/models/update_webhook_dto_spec.rb +64 -0
  203. data/spec/models/webhook_response_dto_spec.rb +82 -0
  204. data/spec/spec_helper.rb +110 -0
  205. metadata +375 -0
@@ -0,0 +1,603 @@
1
+ =begin
2
+ #Devdraft AI Payment & Business Management API
3
+
4
+ # A comprehensive payment processing and business management API that enables seamless integration of cryptocurrency and traditional payment methods.
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 3.0.65
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module DevDraftAI
15
+ class CreatePaymentLinkDto
16
+ # Display title for the payment link. This appears on the checkout page and in customer communications.
17
+ attr_accessor :title
18
+
19
+ # Unique URL slug for the payment link. Can be a full URL or just the path segment. Must be unique within your account.
20
+ attr_accessor :url
21
+
22
+ # Detailed description of what the customer is purchasing. Supports markdown formatting.
23
+ attr_accessor :description
24
+
25
+ # Cover image URL
26
+ attr_accessor :cover_image
27
+
28
+ # Type of the payment link
29
+ attr_accessor :link_type
30
+
31
+ # Amount for the payment link
32
+ attr_accessor :amount
33
+
34
+ # Payment for ID
35
+ attr_accessor :payment_for_id
36
+
37
+ # Recurring type
38
+ attr_accessor :recurring_type
39
+
40
+ # Customer ID
41
+ attr_accessor :customer_id
42
+
43
+ # Array of products in the payment link
44
+ attr_accessor :payment_link_products
45
+
46
+ # Whether the payment link is for all products
47
+ attr_accessor :is_for_all_product
48
+
49
+ # Whether to allow quantity adjustment
50
+ attr_accessor :allow_quantity_adjustment
51
+
52
+ # Whether to collect tax
53
+ attr_accessor :collect_tax
54
+
55
+ # Tax ID
56
+ attr_accessor :tax_id
57
+
58
+ # Whether to collect address
59
+ attr_accessor :collect_address
60
+
61
+ # Whether to require phone number
62
+ attr_accessor :require_phone_number
63
+
64
+ # Whether to limit payments
65
+ attr_accessor :limit_payments
66
+
67
+ # Maximum number of payments
68
+ attr_accessor :max_payments
69
+
70
+ # Custom fields
71
+ attr_accessor :custom_fields
72
+
73
+ # Whether to allow business tax ID
74
+ attr_accessor :allow_business_tax_id
75
+
76
+ # Whether to allow mobile payment
77
+ attr_accessor :allow_mobile_payment
78
+
79
+ # Confirmation page type
80
+ attr_accessor :confirmation_page
81
+
82
+ # Whether to create invoice PDF
83
+ attr_accessor :create_invoice_pdf
84
+
85
+ # Currency
86
+ attr_accessor :currency
87
+
88
+ # Expiration date
89
+ attr_accessor :expiration_date
90
+
91
+ class EnumAttributeValidator
92
+ attr_reader :datatype
93
+ attr_reader :allowable_values
94
+
95
+ def initialize(datatype, allowable_values)
96
+ @allowable_values = allowable_values.map do |value|
97
+ case datatype.to_s
98
+ when /Integer/i
99
+ value.to_i
100
+ when /Float/i
101
+ value.to_f
102
+ else
103
+ value
104
+ end
105
+ end
106
+ end
107
+
108
+ def valid?(value)
109
+ !value || allowable_values.include?(value)
110
+ end
111
+ end
112
+
113
+ # Attribute mapping from ruby-style variable name to JSON key.
114
+ def self.attribute_map
115
+ {
116
+ :'title' => :'title',
117
+ :'url' => :'url',
118
+ :'description' => :'description',
119
+ :'cover_image' => :'coverImage',
120
+ :'link_type' => :'linkType',
121
+ :'amount' => :'amount',
122
+ :'payment_for_id' => :'paymentForId',
123
+ :'recurring_type' => :'recurringType',
124
+ :'customer_id' => :'customerId',
125
+ :'payment_link_products' => :'paymentLinkProducts',
126
+ :'is_for_all_product' => :'isForAllProduct',
127
+ :'allow_quantity_adjustment' => :'allowQuantityAdjustment',
128
+ :'collect_tax' => :'collectTax',
129
+ :'tax_id' => :'taxId',
130
+ :'collect_address' => :'collectAddress',
131
+ :'require_phone_number' => :'requirePhoneNumber',
132
+ :'limit_payments' => :'limitPayments',
133
+ :'max_payments' => :'maxPayments',
134
+ :'custom_fields' => :'customFields',
135
+ :'allow_business_tax_id' => :'allowBusinessTaxId',
136
+ :'allow_mobile_payment' => :'allowMobilePayment',
137
+ :'confirmation_page' => :'confirmationPage',
138
+ :'create_invoice_pdf' => :'createInvoicePdf',
139
+ :'currency' => :'currency',
140
+ :'expiration_date' => :'expiration_date'
141
+ }
142
+ end
143
+
144
+ # Attribute type mapping.
145
+ def self.openapi_types
146
+ {
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',
165
+ :'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'
172
+ }
173
+ end
174
+
175
+ # List of attributes with nullable: true
176
+ def self.openapi_nullable
177
+ Set.new([
178
+ ])
179
+ end
180
+
181
+ # Initializes the object
182
+ # @param [Hash] attributes Model attributes in the form of hash
183
+ def initialize(attributes = {})
184
+ if (!attributes.is_a?(Hash))
185
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DevDraftAI::CreatePaymentLinkDto` initialize method"
186
+ end
187
+
188
+ # check to see if the attribute exists and convert string to symbol for hash key
189
+ 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
192
+ end
193
+ h[k.to_sym] = v
194
+ }
195
+
196
+ if attributes.key?(:'title')
197
+ self.title = attributes[:'title']
198
+ end
199
+
200
+ if attributes.key?(:'url')
201
+ self.url = attributes[:'url']
202
+ end
203
+
204
+ if attributes.key?(:'description')
205
+ self.description = attributes[:'description']
206
+ end
207
+
208
+ if attributes.key?(:'cover_image')
209
+ self.cover_image = attributes[:'cover_image']
210
+ end
211
+
212
+ if attributes.key?(:'link_type')
213
+ self.link_type = attributes[:'link_type']
214
+ end
215
+
216
+ if attributes.key?(:'amount')
217
+ self.amount = attributes[:'amount']
218
+ end
219
+
220
+ if attributes.key?(:'payment_for_id')
221
+ self.payment_for_id = attributes[:'payment_for_id']
222
+ end
223
+
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
+ if attributes.key?(:'customer_id')
231
+ self.customer_id = attributes[:'customer_id']
232
+ end
233
+
234
+ if attributes.key?(:'payment_link_products')
235
+ if (value = attributes[:'payment_link_products']).is_a?(Array)
236
+ self.payment_link_products = value
237
+ end
238
+ end
239
+
240
+ if attributes.key?(:'is_for_all_product')
241
+ self.is_for_all_product = attributes[:'is_for_all_product']
242
+ else
243
+ self.is_for_all_product = false
244
+ end
245
+
246
+ if attributes.key?(:'allow_quantity_adjustment')
247
+ self.allow_quantity_adjustment = attributes[:'allow_quantity_adjustment']
248
+ else
249
+ self.allow_quantity_adjustment = true
250
+ end
251
+
252
+ if attributes.key?(:'collect_tax')
253
+ self.collect_tax = attributes[:'collect_tax']
254
+ else
255
+ self.collect_tax = false
256
+ end
257
+
258
+ if attributes.key?(:'tax_id')
259
+ self.tax_id = attributes[:'tax_id']
260
+ end
261
+
262
+ if attributes.key?(:'collect_address')
263
+ self.collect_address = attributes[:'collect_address']
264
+ else
265
+ self.collect_address = false
266
+ end
267
+
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
+ if attributes.key?(:'limit_payments')
275
+ self.limit_payments = attributes[:'limit_payments']
276
+ else
277
+ self.limit_payments = false
278
+ end
279
+
280
+ if attributes.key?(:'max_payments')
281
+ self.max_payments = attributes[:'max_payments']
282
+ end
283
+
284
+ if attributes.key?(:'custom_fields')
285
+ self.custom_fields = attributes[:'custom_fields']
286
+ end
287
+
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
+ if attributes.key?(:'allow_mobile_payment')
295
+ self.allow_mobile_payment = attributes[:'allow_mobile_payment']
296
+ else
297
+ self.allow_mobile_payment = false
298
+ end
299
+
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
+ if attributes.key?(:'currency')
313
+ self.currency = attributes[:'currency']
314
+ else
315
+ self.currency = 'usdc'
316
+ end
317
+
318
+ if attributes.key?(:'expiration_date')
319
+ self.expiration_date = attributes[:'expiration_date']
320
+ end
321
+ end
322
+
323
+ # Show invalid properties with the reasons. Usually used together with valid?
324
+ # @return Array for valid properties with the reasons
325
+ def list_invalid_properties
326
+ invalid_properties = Array.new
327
+ if @title.nil?
328
+ invalid_properties.push('invalid value for "title", title cannot be nil.')
329
+ end
330
+
331
+ if @url.nil?
332
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
333
+ end
334
+
335
+ if @link_type.nil?
336
+ invalid_properties.push('invalid value for "link_type", link_type cannot be nil.')
337
+ end
338
+
339
+ if @recurring_type.nil?
340
+ invalid_properties.push('invalid value for "recurring_type", recurring_type cannot be nil.')
341
+ end
342
+
343
+ if @allow_quantity_adjustment.nil?
344
+ invalid_properties.push('invalid value for "allow_quantity_adjustment", allow_quantity_adjustment cannot be nil.')
345
+ end
346
+
347
+ if @collect_tax.nil?
348
+ invalid_properties.push('invalid value for "collect_tax", collect_tax cannot be nil.')
349
+ end
350
+
351
+ if @collect_address.nil?
352
+ invalid_properties.push('invalid value for "collect_address", collect_address cannot be nil.')
353
+ end
354
+
355
+ if @require_phone_number.nil?
356
+ invalid_properties.push('invalid value for "require_phone_number", require_phone_number cannot be nil.')
357
+ end
358
+
359
+ if @allow_mobile_payment.nil?
360
+ invalid_properties.push('invalid value for "allow_mobile_payment", allow_mobile_payment cannot be nil.')
361
+ end
362
+
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
+ if @currency.nil?
372
+ invalid_properties.push('invalid value for "currency", currency cannot be nil.')
373
+ end
374
+
375
+ invalid_properties
376
+ end
377
+
378
+ # Check to see if the all the properties in the model are valid
379
+ # @return true if the model is valid
380
+ def valid?
381
+ return false if @title.nil?
382
+ return false if @url.nil?
383
+ return false if @link_type.nil?
384
+ link_type_validator = EnumAttributeValidator.new('Object', ['INVOICE', 'PRODUCT', 'COLLECTION', 'SUBSCRIPTION', 'DONATION'])
385
+ 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)
389
+ return false if @allow_quantity_adjustment.nil?
390
+ return false if @collect_tax.nil?
391
+ return false if @collect_address.nil?
392
+ return false if @require_phone_number.nil?
393
+ 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
+ return false if @currency.nil?
399
+ currency_validator = EnumAttributeValidator.new('Object', ['usdc', 'eurc'])
400
+ return false unless currency_validator.valid?(@currency)
401
+ true
402
+ end
403
+
404
+ # Custom attribute writer method checking allowed values (enum).
405
+ # @param [Object] link_type Object to be assigned
406
+ def link_type=(link_type)
407
+ validator = EnumAttributeValidator.new('Object', ['INVOICE', 'PRODUCT', 'COLLECTION', 'SUBSCRIPTION', 'DONATION'])
408
+ unless validator.valid?(link_type)
409
+ fail ArgumentError, "invalid value for \"link_type\", must be one of #{validator.allowable_values}."
410
+ end
411
+ @link_type = link_type
412
+ end
413
+
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}."
420
+ end
421
+ @recurring_type = recurring_type
422
+ end
423
+
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}."
430
+ end
431
+ @confirmation_page = confirmation_page
432
+ end
433
+
434
+ # Custom attribute writer method checking allowed values (enum).
435
+ # @param [Object] currency Object to be assigned
436
+ def currency=(currency)
437
+ validator = EnumAttributeValidator.new('Object', ['usdc', 'eurc'])
438
+ unless validator.valid?(currency)
439
+ fail ArgumentError, "invalid value for \"currency\", must be one of #{validator.allowable_values}."
440
+ end
441
+ @currency = currency
442
+ end
443
+
444
+ # Checks equality by comparing each attribute.
445
+ # @param [Object] Object to be compared
446
+ def ==(o)
447
+ return true if self.equal?(o)
448
+ self.class == o.class &&
449
+ title == o.title &&
450
+ url == o.url &&
451
+ description == o.description &&
452
+ cover_image == o.cover_image &&
453
+ link_type == o.link_type &&
454
+ amount == o.amount &&
455
+ payment_for_id == o.payment_for_id &&
456
+ recurring_type == o.recurring_type &&
457
+ customer_id == o.customer_id &&
458
+ payment_link_products == o.payment_link_products &&
459
+ is_for_all_product == o.is_for_all_product &&
460
+ allow_quantity_adjustment == o.allow_quantity_adjustment &&
461
+ collect_tax == o.collect_tax &&
462
+ tax_id == o.tax_id &&
463
+ collect_address == o.collect_address &&
464
+ require_phone_number == o.require_phone_number &&
465
+ limit_payments == o.limit_payments &&
466
+ max_payments == o.max_payments &&
467
+ custom_fields == o.custom_fields &&
468
+ allow_business_tax_id == o.allow_business_tax_id &&
469
+ allow_mobile_payment == o.allow_mobile_payment &&
470
+ confirmation_page == o.confirmation_page &&
471
+ create_invoice_pdf == o.create_invoice_pdf &&
472
+ currency == o.currency &&
473
+ expiration_date == o.expiration_date
474
+ end
475
+
476
+ # @see the `==` method
477
+ # @param [Object] Object to be compared
478
+ def eql?(o)
479
+ self == o
480
+ end
481
+
482
+ # Calculates hash code according to all attributes.
483
+ # @return [Integer] Hash code
484
+ 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
486
+ end
487
+
488
+ # Builds the object from hash
489
+ # @param [Hash] attributes Model attributes in the form of hash
490
+ # @return [Object] Returns the model itself
491
+ 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
+ return nil unless attributes.is_a?(Hash)
500
+ self.class.openapi_types.each_pair do |key, type|
501
+ if type =~ /\AArray<(.*)>/i
502
+ # check to ensure the input is an array given that the attribute
503
+ # 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) })
506
+ 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)
511
+ end
512
+ 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
568
+ end
569
+
570
+ # Returns the object in the form of hash
571
+ # @return [Hash] Returns the object in the form of hash
572
+ def to_hash
573
+ hash = {}
574
+ self.class.attribute_map.each_pair do |attr, param|
575
+ value = self.send(attr)
576
+ if value.nil?
577
+ is_nullable = self.class.openapi_nullable.include?(attr)
578
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
579
+ end
580
+
581
+ hash[param] = _to_hash(value)
582
+ end
583
+ hash
584
+ end
585
+
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
603
+ end