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.
- checksums.yaml +4 -4
- data/README.md +155 -253
- data/Rakefile +2 -0
- data/devdraft-1.0.0.gem +0 -0
- data/{devdraft_ai_sdk.gemspec → devdraft.gemspec} +15 -11
- data/docs/APIHealthApi.md +82 -30
- data/docs/AggregatedBalanceResponse.md +19 -6
- data/docs/AllBalancesResponse.md +19 -6
- data/docs/AppBalancesApi.md +125 -65
- data/docs/BridgeFiatPaymentRail.md +15 -0
- data/docs/BridgePaymentRail.md +12 -3
- data/docs/CreateBankPaymentIntentDto.md +49 -21
- data/docs/CreateCustomerDto.md +25 -9
- data/docs/CreateDirectBankTransferDto.md +29 -11
- data/docs/CreateDirectWalletTransferDto.md +21 -7
- data/docs/CreateExternalBankTransferDto.md +40 -0
- data/docs/CreateExternalStablecoinTransferDto.md +28 -0
- data/docs/CreateInvoiceDto.md +45 -19
- data/docs/CreateLiquidationAddressDto.md +43 -18
- data/docs/CreatePaymentLinkDto.md +53 -28
- data/docs/CreateStablePaymentIntentDto.md +43 -18
- data/docs/CreateStablecoinConversionDto.md +23 -8
- data/docs/CreateTaxDto.md +26 -0
- data/docs/CreateWebhookDto.md +23 -8
- data/docs/CustomerStatus.md +12 -3
- data/docs/CustomerType.md +15 -0
- data/docs/CustomersApi.md +187 -114
- data/docs/DestinationCurrency.md +12 -3
- data/docs/ExchangeRateResponseDto.md +25 -9
- data/docs/ExchangeRatesApi.md +130 -72
- data/docs/FiatCurrency.md +12 -3
- data/docs/HealthResponseDto.md +25 -9
- data/docs/InvoiceProductDto.md +17 -5
- data/docs/InvoicesApi.md +177 -104
- data/docs/LiquidationAddressResponseDto.md +41 -17
- data/docs/LiquidationAddressesApi.md +115 -61
- data/docs/PaymentIntentsApi.md +93 -57
- data/docs/PaymentLinkProductDto.md +17 -5
- data/docs/PaymentLinksApi.md +175 -102
- data/docs/PaymentRequestDto.md +21 -7
- data/docs/PaymentResponseDto.md +23 -8
- data/docs/ProductsApi.md +307 -194
- data/docs/PublicHealthResponseDto.md +19 -6
- data/docs/RefundResponseDto.md +23 -8
- data/docs/StableCoinCurrency.md +12 -3
- data/docs/TaxControllerCreate201Response.md +30 -0
- data/docs/TaxControllerDeleteWithoutId400Response.md +22 -0
- data/docs/TaxControllerUpdateWithoutId400Response.md +22 -0
- data/docs/TaxesApi.md +374 -122
- data/docs/TestPaymentsApi.md +150 -60
- data/docs/TransfersApi.md +274 -72
- data/docs/UpdateCustomerDto.md +25 -9
- data/docs/UpdateTaxDto.md +26 -0
- data/docs/UpdateWebhookDto.md +23 -8
- data/docs/WalletsApi.md +44 -24
- data/docs/WebhookResponseDto.md +29 -11
- data/docs/WebhooksApi.md +225 -134
- data/git_push.sh +41 -28
- data/lib/devdraft/api/api_health_api.rb +32 -16
- data/lib/devdraft/api/app_balances_api.rb +45 -22
- data/lib/devdraft/api/customers_api.rb +124 -71
- data/lib/devdraft/api/exchange_rates_api.rb +49 -26
- data/lib/devdraft/api/invoices_api.rb +89 -53
- data/lib/devdraft/api/liquidation_addresses_api.rb +70 -44
- data/lib/devdraft/api/payment_intents_api.rb +62 -40
- data/lib/devdraft/api/payment_links_api.rb +85 -49
- data/lib/devdraft/api/products_api.rb +214 -216
- data/lib/devdraft/api/taxes_api.rb +257 -66
- data/lib/devdraft/api/test_payments_api.rb +70 -44
- data/lib/devdraft/api/transfers_api.rb +206 -46
- data/lib/devdraft/api/wallets_api.rb +18 -9
- data/lib/devdraft/api/webhooks_api.rb +109 -66
- data/lib/devdraft/api_client.rb +76 -71
- data/lib/devdraft/api_error.rb +5 -4
- data/lib/devdraft/api_model_base.rb +88 -0
- data/lib/devdraft/configuration.rb +121 -18
- data/lib/devdraft/models/aggregated_balance_response.rb +68 -101
- data/lib/devdraft/models/all_balances_response.rb +76 -99
- data/lib/devdraft/models/bridge_fiat_payment_rail.rb +45 -0
- data/lib/devdraft/models/bridge_payment_rail.rb +36 -24
- data/lib/devdraft/models/create_bank_payment_intent_dto.rb +191 -114
- data/lib/devdraft/models/create_customer_dto.rb +123 -113
- data/lib/devdraft/models/create_direct_bank_transfer_dto.rb +105 -104
- data/lib/devdraft/models/create_direct_wallet_transfer_dto.rb +89 -100
- data/lib/devdraft/models/create_external_bank_transfer_dto.rb +505 -0
- data/lib/devdraft/models/create_external_stablecoin_transfer_dto.rb +266 -0
- data/lib/devdraft/models/create_invoice_dto.rb +151 -121
- data/lib/devdraft/models/create_liquidation_address_dto.rb +195 -115
- data/lib/devdraft/models/create_payment_link_dto.rb +192 -214
- data/lib/devdraft/models/create_stable_payment_intent_dto.rb +324 -111
- data/lib/devdraft/models/create_stablecoin_conversion_dto.rb +102 -101
- data/lib/devdraft/models/create_tax_dto.rb +281 -0
- data/lib/devdraft/models/create_webhook_dto.rb +104 -101
- data/lib/devdraft/models/customer_status.rb +23 -10
- data/lib/devdraft/models/customer_type.rb +45 -0
- data/lib/devdraft/models/destination_currency.rb +27 -15
- data/lib/devdraft/models/exchange_rate_response_dto.rb +103 -102
- data/lib/devdraft/models/fiat_currency.rb +22 -10
- data/lib/devdraft/models/health_response_dto.rb +99 -106
- data/lib/devdraft/models/invoice_product_dto.rb +63 -98
- data/lib/devdraft/models/liquidation_address_response_dto.rb +147 -110
- data/lib/devdraft/models/payment_link_product_dto.rb +70 -98
- data/lib/devdraft/models/payment_request_dto.rb +77 -100
- data/lib/devdraft/models/payment_response_dto.rb +102 -101
- data/lib/devdraft/models/public_health_response_dto.rb +68 -101
- data/lib/devdraft/models/refund_response_dto.rb +102 -101
- data/lib/devdraft/models/stable_coin_currency.rb +21 -9
- data/lib/devdraft/models/tax_controller_create201_response.rb +201 -0
- data/lib/devdraft/models/tax_controller_delete_without_id400_response.rb +165 -0
- data/lib/devdraft/models/tax_controller_update_without_id400_response.rb +165 -0
- data/lib/devdraft/models/update_customer_dto.rb +117 -113
- data/lib/devdraft/models/update_tax_dto.rb +256 -0
- data/lib/devdraft/models/update_webhook_dto.rb +70 -101
- data/lib/devdraft/models/webhook_response_dto.rb +140 -103
- data/lib/devdraft/version.rb +6 -5
- data/lib/devdraft.rb +18 -27
- data/spec/api/api_health_api_spec.rb +10 -9
- data/spec/api/app_balances_api_spec.rb +11 -10
- data/spec/api/customers_api_spec.rb +25 -24
- data/spec/api/exchange_rates_api_spec.rb +11 -10
- data/spec/api/invoices_api_spec.rb +16 -15
- data/spec/api/liquidation_addresses_api_spec.rb +13 -12
- data/spec/api/payment_intents_api_spec.rb +12 -11
- data/spec/api/payment_links_api_spec.rb +14 -13
- data/spec/api/products_api_spec.rb +41 -40
- data/spec/api/taxes_api_spec.rb +51 -21
- data/spec/api/test_payments_api_spec.rb +14 -13
- data/spec/api/transfers_api_spec.rb +36 -13
- data/spec/api/wallets_api_spec.rb +9 -8
- data/spec/api/webhooks_api_spec.rb +20 -19
- data/spec/models/aggregated_balance_response_spec.rb +15 -19
- data/spec/models/all_balances_response_spec.rb +14 -18
- data/spec/models/bridge_fiat_payment_rail_spec.rb +30 -0
- data/spec/models/bridge_payment_rail_spec.rb +11 -15
- data/spec/models/create_bank_payment_intent_dto_spec.rb +29 -33
- data/spec/models/create_customer_dto_spec.rb +17 -25
- data/spec/models/create_direct_bank_transfer_dto_spec.rb +19 -23
- data/spec/models/create_direct_wallet_transfer_dto_spec.rb +15 -19
- data/spec/models/create_external_bank_transfer_dto_spec.rb +102 -0
- data/spec/models/create_external_stablecoin_transfer_dto_spec.rb +66 -0
- data/spec/models/create_invoice_dto_spec.rb +31 -35
- data/spec/models/create_liquidation_address_dto_spec.rb +28 -32
- data/spec/models/create_payment_link_dto_spec.rb +34 -76
- data/spec/models/create_stable_payment_intent_dto_spec.rb +26 -30
- data/spec/models/create_stablecoin_conversion_dto_spec.rb +16 -20
- data/spec/models/create_tax_dto_spec.rb +60 -0
- data/spec/models/create_webhook_dto_spec.rb +16 -20
- data/spec/models/customer_status_spec.rb +11 -15
- data/spec/models/customer_type_spec.rb +30 -0
- data/spec/models/destination_currency_spec.rb +11 -15
- data/spec/models/exchange_rate_response_dto_spec.rb +17 -21
- data/spec/models/fiat_currency_spec.rb +11 -15
- data/spec/models/health_response_dto_spec.rb +19 -23
- data/spec/models/invoice_product_dto_spec.rb +13 -17
- data/spec/models/liquidation_address_response_dto_spec.rb +25 -29
- data/spec/models/payment_link_product_dto_spec.rb +13 -17
- data/spec/models/payment_request_dto_spec.rb +15 -19
- data/spec/models/payment_response_dto_spec.rb +16 -20
- data/spec/models/public_health_response_dto_spec.rb +15 -19
- data/spec/models/refund_response_dto_spec.rb +16 -20
- data/spec/models/stable_coin_currency_spec.rb +11 -15
- data/spec/models/tax_controller_create201_response_spec.rb +72 -0
- data/spec/models/tax_controller_delete_without_id400_response_spec.rb +48 -0
- data/spec/models/tax_controller_update_without_id400_response_spec.rb +48 -0
- data/spec/models/update_customer_dto_spec.rb +17 -25
- data/spec/models/update_tax_dto_spec.rb +60 -0
- data/spec/models/update_webhook_dto_spec.rb +16 -20
- data/spec/models/webhook_response_dto_spec.rb +19 -23
- data/spec/spec_helper.rb +5 -4
- metadata +49 -116
- data/docs/AllOfAllBalancesResponseEurc.md +0 -9
- data/docs/AllOfAllBalancesResponseUsdc.md +0 -9
- data/docs/AllOfCreateBankPaymentIntentDtoDestinationCurrency.md +0 -6
- data/docs/AllOfCreateBankPaymentIntentDtoDestinationNetwork.md +0 -6
- data/docs/AllOfCreateBankPaymentIntentDtoSourceCurrency.md +0 -6
- data/docs/AllOfCreateBankPaymentIntentDtoSourcePaymentRail.md +0 -6
- data/docs/AllOfCreateCustomerDtoStatus.md +0 -6
- data/docs/AllOfCreateLiquidationAddressDtoDestinationCurrency.md +0 -6
- data/docs/AllOfCreateLiquidationAddressDtoDestinationPaymentRail.md +0 -6
- data/docs/AllOfCreateStablePaymentIntentDtoDestinationCurrency.md +0 -6
- data/docs/AllOfCreateStablePaymentIntentDtoDestinationNetwork.md +0 -6
- data/docs/AllOfCreateStablePaymentIntentDtoSourceCurrency.md +0 -6
- data/docs/AllOfCreateStablePaymentIntentDtoSourceNetwork.md +0 -6
- data/docs/AllOfUpdateCustomerDtoStatus.md +0 -6
- data/docs/CreateProductDto.md +0 -18
- data/docs/CreateTaxInput.md +0 -6
- data/docs/UpdatePaymentLinkDto.md +0 -6
- data/docs/UpdatePreferenceInput.md +0 -6
- data/docs/UpdateProductDto.md +0 -18
- data/docs/UpdateTaxInput.md +0 -6
- data/example.rb +0 -129
- data/lib/devdraft/models/all_of_all_balances_response_eurc.rb +0 -283
- data/lib/devdraft/models/all_of_all_balances_response_usdc.rb +0 -283
- data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_destination_currency.rb +0 -202
- data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_destination_network.rb +0 -202
- data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_source_currency.rb +0 -202
- data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_source_payment_rail.rb +0 -202
- data/lib/devdraft/models/all_of_create_customer_dto_status.rb +0 -202
- data/lib/devdraft/models/all_of_create_liquidation_address_dto_destination_currency.rb +0 -202
- data/lib/devdraft/models/all_of_create_liquidation_address_dto_destination_payment_rail.rb +0 -202
- data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_destination_currency.rb +0 -202
- data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_destination_network.rb +0 -202
- data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_source_currency.rb +0 -202
- data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_source_network.rb +0 -202
- data/lib/devdraft/models/all_of_update_customer_dto_status.rb +0 -202
- data/lib/devdraft/models/create_product_dto.rb +0 -370
- data/lib/devdraft/models/create_tax_input.rb +0 -197
- data/lib/devdraft/models/update_payment_link_dto.rb +0 -197
- data/lib/devdraft/models/update_preference_input.rb +0 -197
- data/lib/devdraft/models/update_product_dto.rb +0 -355
- data/lib/devdraft/models/update_tax_input.rb +0 -197
- data/spec/api_client_spec.rb +0 -225
- data/spec/base_object_spec.rb +0 -109
- data/spec/configuration_spec.rb +0 -41
- data/spec/models/all_of_all_balances_response_eurc_spec.rb +0 -56
- data/spec/models/all_of_all_balances_response_usdc_spec.rb +0 -56
- data/spec/models/all_of_create_bank_payment_intent_dto_destination_currency_spec.rb +0 -34
- data/spec/models/all_of_create_bank_payment_intent_dto_destination_network_spec.rb +0 -34
- data/spec/models/all_of_create_bank_payment_intent_dto_source_currency_spec.rb +0 -34
- data/spec/models/all_of_create_bank_payment_intent_dto_source_payment_rail_spec.rb +0 -34
- data/spec/models/all_of_create_customer_dto_status_spec.rb +0 -34
- data/spec/models/all_of_create_liquidation_address_dto_destination_currency_spec.rb +0 -34
- data/spec/models/all_of_create_liquidation_address_dto_destination_payment_rail_spec.rb +0 -34
- data/spec/models/all_of_create_stable_payment_intent_dto_destination_currency_spec.rb +0 -34
- data/spec/models/all_of_create_stable_payment_intent_dto_destination_network_spec.rb +0 -34
- data/spec/models/all_of_create_stable_payment_intent_dto_source_currency_spec.rb +0 -34
- data/spec/models/all_of_create_stable_payment_intent_dto_source_network_spec.rb +0 -34
- data/spec/models/all_of_update_customer_dto_status_spec.rb +0 -34
- data/spec/models/create_product_dto_spec.rb +0 -110
- data/spec/models/create_tax_input_spec.rb +0 -34
- data/spec/models/update_payment_link_dto_spec.rb +0 -34
- data/spec/models/update_preference_input_spec.rb +0 -34
- data/spec/models/update_product_dto_spec.rb +0 -110
- 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
|
|
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
|
|
15
|
-
class CreateInvoiceDto
|
|
16
|
+
module Devdraft
|
|
17
|
+
class CreateInvoiceDto < ApiModelBase
|
|
16
18
|
# Name of the invoice
|
|
17
19
|
attr_accessor :name
|
|
18
20
|
|
|
@@ -25,7 +27,6 @@ module DevDraftAI
|
|
|
25
27
|
# Currency for the invoice
|
|
26
28
|
attr_accessor :currency
|
|
27
29
|
|
|
28
|
-
# Array of products in the invoice
|
|
29
30
|
attr_accessor :items
|
|
30
31
|
|
|
31
32
|
# Due date of the invoice
|
|
@@ -105,25 +106,35 @@ module DevDraftAI
|
|
|
105
106
|
}
|
|
106
107
|
end
|
|
107
108
|
|
|
109
|
+
# Returns attribute mapping this model knows about
|
|
110
|
+
def self.acceptable_attribute_map
|
|
111
|
+
attribute_map
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Returns all the JSON keys this model knows about
|
|
115
|
+
def self.acceptable_attributes
|
|
116
|
+
acceptable_attribute_map.values
|
|
117
|
+
end
|
|
118
|
+
|
|
108
119
|
# Attribute type mapping.
|
|
109
120
|
def self.openapi_types
|
|
110
121
|
{
|
|
111
|
-
:'name' => :'
|
|
112
|
-
:'email' => :'
|
|
113
|
-
:'customer_id' => :'
|
|
114
|
-
:'currency' => :'
|
|
122
|
+
:'name' => :'String',
|
|
123
|
+
:'email' => :'String',
|
|
124
|
+
:'customer_id' => :'String',
|
|
125
|
+
:'currency' => :'String',
|
|
115
126
|
:'items' => :'Object',
|
|
116
|
-
:'due_date' => :'
|
|
117
|
-
:'delivery' => :'
|
|
118
|
-
:'payment_link' => :'
|
|
119
|
-
:'payment_methods' => :'
|
|
120
|
-
:'status' => :'
|
|
121
|
-
:'address' => :'
|
|
122
|
-
:'phone_number' => :'
|
|
123
|
-
:'send_date' => :'
|
|
124
|
-
:'logo' => :'
|
|
125
|
-
:'partial_payment' => :'
|
|
126
|
-
:'tax_id' => :'
|
|
127
|
+
:'due_date' => :'Time',
|
|
128
|
+
:'delivery' => :'String',
|
|
129
|
+
:'payment_link' => :'Boolean',
|
|
130
|
+
:'payment_methods' => :'Array<String>',
|
|
131
|
+
:'status' => :'String',
|
|
132
|
+
:'address' => :'String',
|
|
133
|
+
:'phone_number' => :'String',
|
|
134
|
+
:'send_date' => :'Time',
|
|
135
|
+
:'logo' => :'String',
|
|
136
|
+
:'partial_payment' => :'Boolean',
|
|
137
|
+
:'tax_id' => :'String'
|
|
127
138
|
}
|
|
128
139
|
end
|
|
129
140
|
|
|
@@ -132,64 +143,83 @@ module DevDraftAI
|
|
|
132
143
|
Set.new([
|
|
133
144
|
])
|
|
134
145
|
end
|
|
135
|
-
|
|
146
|
+
|
|
136
147
|
# Initializes the object
|
|
137
148
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
138
149
|
def initialize(attributes = {})
|
|
139
150
|
if (!attributes.is_a?(Hash))
|
|
140
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
|
151
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Devdraft::CreateInvoiceDto` initialize method"
|
|
141
152
|
end
|
|
142
153
|
|
|
143
154
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
155
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
144
156
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
145
|
-
if (!
|
|
146
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
|
157
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
158
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Devdraft::CreateInvoiceDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
147
159
|
end
|
|
148
160
|
h[k.to_sym] = v
|
|
149
161
|
}
|
|
150
162
|
|
|
151
163
|
if attributes.key?(:'name')
|
|
152
164
|
self.name = attributes[:'name']
|
|
165
|
+
else
|
|
166
|
+
self.name = nil
|
|
153
167
|
end
|
|
154
168
|
|
|
155
169
|
if attributes.key?(:'email')
|
|
156
170
|
self.email = attributes[:'email']
|
|
171
|
+
else
|
|
172
|
+
self.email = nil
|
|
157
173
|
end
|
|
158
174
|
|
|
159
175
|
if attributes.key?(:'customer_id')
|
|
160
176
|
self.customer_id = attributes[:'customer_id']
|
|
177
|
+
else
|
|
178
|
+
self.customer_id = nil
|
|
161
179
|
end
|
|
162
180
|
|
|
163
181
|
if attributes.key?(:'currency')
|
|
164
182
|
self.currency = attributes[:'currency']
|
|
183
|
+
else
|
|
184
|
+
self.currency = nil
|
|
165
185
|
end
|
|
166
186
|
|
|
167
187
|
if attributes.key?(:'items')
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
188
|
+
self.items = attributes[:'items']
|
|
189
|
+
else
|
|
190
|
+
self.items = nil
|
|
171
191
|
end
|
|
172
192
|
|
|
173
193
|
if attributes.key?(:'due_date')
|
|
174
194
|
self.due_date = attributes[:'due_date']
|
|
195
|
+
else
|
|
196
|
+
self.due_date = nil
|
|
175
197
|
end
|
|
176
198
|
|
|
177
199
|
if attributes.key?(:'delivery')
|
|
178
200
|
self.delivery = attributes[:'delivery']
|
|
201
|
+
else
|
|
202
|
+
self.delivery = nil
|
|
179
203
|
end
|
|
180
204
|
|
|
181
205
|
if attributes.key?(:'payment_link')
|
|
182
206
|
self.payment_link = attributes[:'payment_link']
|
|
207
|
+
else
|
|
208
|
+
self.payment_link = nil
|
|
183
209
|
end
|
|
184
210
|
|
|
185
211
|
if attributes.key?(:'payment_methods')
|
|
186
212
|
if (value = attributes[:'payment_methods']).is_a?(Array)
|
|
187
213
|
self.payment_methods = value
|
|
188
214
|
end
|
|
215
|
+
else
|
|
216
|
+
self.payment_methods = nil
|
|
189
217
|
end
|
|
190
218
|
|
|
191
219
|
if attributes.key?(:'status')
|
|
192
220
|
self.status = attributes[:'status']
|
|
221
|
+
else
|
|
222
|
+
self.status = nil
|
|
193
223
|
end
|
|
194
224
|
|
|
195
225
|
if attributes.key?(:'address')
|
|
@@ -210,6 +240,8 @@ module DevDraftAI
|
|
|
210
240
|
|
|
211
241
|
if attributes.key?(:'partial_payment')
|
|
212
242
|
self.partial_payment = attributes[:'partial_payment']
|
|
243
|
+
else
|
|
244
|
+
self.partial_payment = nil
|
|
213
245
|
end
|
|
214
246
|
|
|
215
247
|
if attributes.key?(:'tax_id')
|
|
@@ -220,6 +252,7 @@ module DevDraftAI
|
|
|
220
252
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
221
253
|
# @return Array for valid properties with the reasons
|
|
222
254
|
def list_invalid_properties
|
|
255
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
223
256
|
invalid_properties = Array.new
|
|
224
257
|
if @name.nil?
|
|
225
258
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
@@ -271,56 +304,127 @@ module DevDraftAI
|
|
|
271
304
|
# Check to see if the all the properties in the model are valid
|
|
272
305
|
# @return true if the model is valid
|
|
273
306
|
def valid?
|
|
307
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
274
308
|
return false if @name.nil?
|
|
275
309
|
return false if @email.nil?
|
|
276
310
|
return false if @customer_id.nil?
|
|
277
311
|
return false if @currency.nil?
|
|
278
|
-
currency_validator = EnumAttributeValidator.new('
|
|
312
|
+
currency_validator = EnumAttributeValidator.new('String', ["usdc", "eurc"])
|
|
279
313
|
return false unless currency_validator.valid?(@currency)
|
|
280
314
|
return false if @items.nil?
|
|
281
315
|
return false if @due_date.nil?
|
|
282
316
|
return false if @delivery.nil?
|
|
283
|
-
delivery_validator = EnumAttributeValidator.new('
|
|
317
|
+
delivery_validator = EnumAttributeValidator.new('String', ["EMAIL", "MANUALLY"])
|
|
284
318
|
return false unless delivery_validator.valid?(@delivery)
|
|
285
319
|
return false if @payment_link.nil?
|
|
286
320
|
return false if @payment_methods.nil?
|
|
287
321
|
return false if @status.nil?
|
|
288
|
-
status_validator = EnumAttributeValidator.new('
|
|
322
|
+
status_validator = EnumAttributeValidator.new('String', ["DRAFT", "OPEN", "PASTDUE", "PAID", "PARTIALLYPAID"])
|
|
289
323
|
return false unless status_validator.valid?(@status)
|
|
290
324
|
return false if @partial_payment.nil?
|
|
291
325
|
true
|
|
292
326
|
end
|
|
293
327
|
|
|
328
|
+
# Custom attribute writer method with validation
|
|
329
|
+
# @param [Object] name Value to be assigned
|
|
330
|
+
def name=(name)
|
|
331
|
+
if name.nil?
|
|
332
|
+
fail ArgumentError, 'name cannot be nil'
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
@name = name
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
# Custom attribute writer method with validation
|
|
339
|
+
# @param [Object] email Value to be assigned
|
|
340
|
+
def email=(email)
|
|
341
|
+
if email.nil?
|
|
342
|
+
fail ArgumentError, 'email cannot be nil'
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
@email = email
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
# Custom attribute writer method with validation
|
|
349
|
+
# @param [Object] customer_id Value to be assigned
|
|
350
|
+
def customer_id=(customer_id)
|
|
351
|
+
if customer_id.nil?
|
|
352
|
+
fail ArgumentError, 'customer_id cannot be nil'
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
@customer_id = customer_id
|
|
356
|
+
end
|
|
357
|
+
|
|
294
358
|
# Custom attribute writer method checking allowed values (enum).
|
|
295
359
|
# @param [Object] currency Object to be assigned
|
|
296
360
|
def currency=(currency)
|
|
297
|
-
validator = EnumAttributeValidator.new('
|
|
361
|
+
validator = EnumAttributeValidator.new('String', ["usdc", "eurc"])
|
|
298
362
|
unless validator.valid?(currency)
|
|
299
363
|
fail ArgumentError, "invalid value for \"currency\", must be one of #{validator.allowable_values}."
|
|
300
364
|
end
|
|
301
365
|
@currency = currency
|
|
302
366
|
end
|
|
303
367
|
|
|
368
|
+
# Custom attribute writer method with validation
|
|
369
|
+
# @param [Object] items Value to be assigned
|
|
370
|
+
def items=(items)
|
|
371
|
+
if items.nil?
|
|
372
|
+
fail ArgumentError, 'items cannot be nil'
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
@items = items
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
# Custom attribute writer method with validation
|
|
379
|
+
# @param [Object] due_date Value to be assigned
|
|
380
|
+
def due_date=(due_date)
|
|
381
|
+
if due_date.nil?
|
|
382
|
+
fail ArgumentError, 'due_date cannot be nil'
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
@due_date = due_date
|
|
386
|
+
end
|
|
387
|
+
|
|
304
388
|
# Custom attribute writer method checking allowed values (enum).
|
|
305
389
|
# @param [Object] delivery Object to be assigned
|
|
306
390
|
def delivery=(delivery)
|
|
307
|
-
validator = EnumAttributeValidator.new('
|
|
391
|
+
validator = EnumAttributeValidator.new('String', ["EMAIL", "MANUALLY"])
|
|
308
392
|
unless validator.valid?(delivery)
|
|
309
393
|
fail ArgumentError, "invalid value for \"delivery\", must be one of #{validator.allowable_values}."
|
|
310
394
|
end
|
|
311
395
|
@delivery = delivery
|
|
312
396
|
end
|
|
313
397
|
|
|
398
|
+
# Custom attribute writer method with validation
|
|
399
|
+
# @param [Object] payment_link Value to be assigned
|
|
400
|
+
def payment_link=(payment_link)
|
|
401
|
+
if payment_link.nil?
|
|
402
|
+
fail ArgumentError, 'payment_link cannot be nil'
|
|
403
|
+
end
|
|
404
|
+
|
|
405
|
+
@payment_link = payment_link
|
|
406
|
+
end
|
|
407
|
+
|
|
314
408
|
# Custom attribute writer method checking allowed values (enum).
|
|
315
409
|
# @param [Object] status Object to be assigned
|
|
316
410
|
def status=(status)
|
|
317
|
-
validator = EnumAttributeValidator.new('
|
|
411
|
+
validator = EnumAttributeValidator.new('String', ["DRAFT", "OPEN", "PASTDUE", "PAID", "PARTIALLYPAID"])
|
|
318
412
|
unless validator.valid?(status)
|
|
319
413
|
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
320
414
|
end
|
|
321
415
|
@status = status
|
|
322
416
|
end
|
|
323
417
|
|
|
418
|
+
# Custom attribute writer method with validation
|
|
419
|
+
# @param [Object] partial_payment Value to be assigned
|
|
420
|
+
def partial_payment=(partial_payment)
|
|
421
|
+
if partial_payment.nil?
|
|
422
|
+
fail ArgumentError, 'partial_payment cannot be nil'
|
|
423
|
+
end
|
|
424
|
+
|
|
425
|
+
@partial_payment = partial_payment
|
|
426
|
+
end
|
|
427
|
+
|
|
324
428
|
# Checks equality by comparing each attribute.
|
|
325
429
|
# @param [Object] Object to be compared
|
|
326
430
|
def ==(o)
|
|
@@ -360,82 +464,23 @@ module DevDraftAI
|
|
|
360
464
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
361
465
|
# @return [Object] Returns the model itself
|
|
362
466
|
def self.build_from_hash(attributes)
|
|
363
|
-
new.build_from_hash(attributes)
|
|
364
|
-
end
|
|
365
|
-
|
|
366
|
-
# Builds the object from hash
|
|
367
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
368
|
-
# @return [Object] Returns the model itself
|
|
369
|
-
def build_from_hash(attributes)
|
|
370
467
|
return nil unless attributes.is_a?(Hash)
|
|
371
|
-
|
|
372
|
-
|
|
468
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
469
|
+
transformed_hash = {}
|
|
470
|
+
openapi_types.each_pair do |key, type|
|
|
471
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
472
|
+
transformed_hash["#{key}"] = nil
|
|
473
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
373
474
|
# check to ensure the input is an array given that the attribute
|
|
374
475
|
# is documented as an array but the input is not
|
|
375
|
-
if attributes[
|
|
376
|
-
|
|
476
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
477
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
377
478
|
end
|
|
378
|
-
elsif !attributes[
|
|
379
|
-
|
|
380
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
381
|
-
self.send("#{key}=", nil)
|
|
479
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
480
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
382
481
|
end
|
|
383
482
|
end
|
|
384
|
-
|
|
385
|
-
self
|
|
386
|
-
end
|
|
387
|
-
|
|
388
|
-
# Deserializes the data based on type
|
|
389
|
-
# @param string type Data type
|
|
390
|
-
# @param string value Value to be deserialized
|
|
391
|
-
# @return [Object] Deserialized data
|
|
392
|
-
def _deserialize(type, value)
|
|
393
|
-
case type.to_sym
|
|
394
|
-
when :DateTime
|
|
395
|
-
DateTime.parse(value)
|
|
396
|
-
when :Date
|
|
397
|
-
Date.parse(value)
|
|
398
|
-
when :String
|
|
399
|
-
value.to_s
|
|
400
|
-
when :Integer
|
|
401
|
-
value.to_i
|
|
402
|
-
when :Float
|
|
403
|
-
value.to_f
|
|
404
|
-
when :Boolean
|
|
405
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
406
|
-
true
|
|
407
|
-
else
|
|
408
|
-
false
|
|
409
|
-
end
|
|
410
|
-
when :Object
|
|
411
|
-
# generic object (usually a Hash), return directly
|
|
412
|
-
value
|
|
413
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
414
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
415
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
416
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
417
|
-
k_type = Regexp.last_match[:k_type]
|
|
418
|
-
v_type = Regexp.last_match[:v_type]
|
|
419
|
-
{}.tap do |hash|
|
|
420
|
-
value.each do |k, v|
|
|
421
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
422
|
-
end
|
|
423
|
-
end
|
|
424
|
-
else # model
|
|
425
|
-
DevDraftAI.const_get(type).build_from_hash(value)
|
|
426
|
-
end
|
|
427
|
-
end
|
|
428
|
-
|
|
429
|
-
# Returns the string representation of the object
|
|
430
|
-
# @return [String] String presentation of the object
|
|
431
|
-
def to_s
|
|
432
|
-
to_hash.to_s
|
|
433
|
-
end
|
|
434
|
-
|
|
435
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
436
|
-
# @return [Hash] Returns the object in the form of hash
|
|
437
|
-
def to_body
|
|
438
|
-
to_hash
|
|
483
|
+
new(transformed_hash)
|
|
439
484
|
end
|
|
440
485
|
|
|
441
486
|
# Returns the object in the form of hash
|
|
@@ -454,21 +499,6 @@ module DevDraftAI
|
|
|
454
499
|
hash
|
|
455
500
|
end
|
|
456
501
|
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
# @param [Object] value Any valid value
|
|
460
|
-
# @return [Hash] Returns the value in the form of hash
|
|
461
|
-
def _to_hash(value)
|
|
462
|
-
if value.is_a?(Array)
|
|
463
|
-
value.compact.map { |v| _to_hash(v) }
|
|
464
|
-
elsif value.is_a?(Hash)
|
|
465
|
-
{}.tap do |hash|
|
|
466
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
467
|
-
end
|
|
468
|
-
elsif value.respond_to? :to_hash
|
|
469
|
-
value.to_hash
|
|
470
|
-
else
|
|
471
|
-
value
|
|
472
|
-
end
|
|
473
|
-
end end
|
|
502
|
+
end
|
|
503
|
+
|
|
474
504
|
end
|