devdraft 1.0.1 → 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 +160 -191
- 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 -94
- 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 PaymentLinkProductDto
|
|
16
|
+
module Devdraft
|
|
17
|
+
class PaymentLinkProductDto < ApiModelBase
|
|
16
18
|
# UUID of the product to include in this payment link. Must be a valid product from your catalog.
|
|
17
19
|
attr_accessor :product_id
|
|
18
20
|
|
|
@@ -27,11 +29,21 @@ module DevDraftAI
|
|
|
27
29
|
}
|
|
28
30
|
end
|
|
29
31
|
|
|
32
|
+
# Returns attribute mapping this model knows about
|
|
33
|
+
def self.acceptable_attribute_map
|
|
34
|
+
attribute_map
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
|
38
|
+
def self.acceptable_attributes
|
|
39
|
+
acceptable_attribute_map.values
|
|
40
|
+
end
|
|
41
|
+
|
|
30
42
|
# Attribute type mapping.
|
|
31
43
|
def self.openapi_types
|
|
32
44
|
{
|
|
33
|
-
:'product_id' => :'
|
|
34
|
-
:'quantity' => :'
|
|
45
|
+
:'product_id' => :'String',
|
|
46
|
+
:'quantity' => :'Integer'
|
|
35
47
|
}
|
|
36
48
|
end
|
|
37
49
|
|
|
@@ -40,24 +52,27 @@ module DevDraftAI
|
|
|
40
52
|
Set.new([
|
|
41
53
|
])
|
|
42
54
|
end
|
|
43
|
-
|
|
55
|
+
|
|
44
56
|
# Initializes the object
|
|
45
57
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
46
58
|
def initialize(attributes = {})
|
|
47
59
|
if (!attributes.is_a?(Hash))
|
|
48
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Devdraft::PaymentLinkProductDto` initialize method"
|
|
49
61
|
end
|
|
50
62
|
|
|
51
63
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
52
65
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
53
|
-
if (!
|
|
54
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Devdraft::PaymentLinkProductDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
55
68
|
end
|
|
56
69
|
h[k.to_sym] = v
|
|
57
70
|
}
|
|
58
71
|
|
|
59
72
|
if attributes.key?(:'product_id')
|
|
60
73
|
self.product_id = attributes[:'product_id']
|
|
74
|
+
else
|
|
75
|
+
self.product_id = nil
|
|
61
76
|
end
|
|
62
77
|
|
|
63
78
|
if attributes.key?(:'quantity')
|
|
@@ -70,6 +85,7 @@ module DevDraftAI
|
|
|
70
85
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
71
86
|
# @return Array for valid properties with the reasons
|
|
72
87
|
def list_invalid_properties
|
|
88
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
73
89
|
invalid_properties = Array.new
|
|
74
90
|
if @product_id.nil?
|
|
75
91
|
invalid_properties.push('invalid value for "product_id", product_id cannot be nil.')
|
|
@@ -79,17 +95,47 @@ module DevDraftAI
|
|
|
79
95
|
invalid_properties.push('invalid value for "quantity", quantity cannot be nil.')
|
|
80
96
|
end
|
|
81
97
|
|
|
98
|
+
if @quantity < 1
|
|
99
|
+
invalid_properties.push('invalid value for "quantity", must be greater than or equal to 1.')
|
|
100
|
+
end
|
|
101
|
+
|
|
82
102
|
invalid_properties
|
|
83
103
|
end
|
|
84
104
|
|
|
85
105
|
# Check to see if the all the properties in the model are valid
|
|
86
106
|
# @return true if the model is valid
|
|
87
107
|
def valid?
|
|
108
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
88
109
|
return false if @product_id.nil?
|
|
89
110
|
return false if @quantity.nil?
|
|
111
|
+
return false if @quantity < 1
|
|
90
112
|
true
|
|
91
113
|
end
|
|
92
114
|
|
|
115
|
+
# Custom attribute writer method with validation
|
|
116
|
+
# @param [Object] product_id Value to be assigned
|
|
117
|
+
def product_id=(product_id)
|
|
118
|
+
if product_id.nil?
|
|
119
|
+
fail ArgumentError, 'product_id cannot be nil'
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
@product_id = product_id
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Custom attribute writer method with validation
|
|
126
|
+
# @param [Object] quantity Value to be assigned
|
|
127
|
+
def quantity=(quantity)
|
|
128
|
+
if quantity.nil?
|
|
129
|
+
fail ArgumentError, 'quantity cannot be nil'
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if quantity < 1
|
|
133
|
+
fail ArgumentError, 'invalid value for "quantity", must be greater than or equal to 1.'
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
@quantity = quantity
|
|
137
|
+
end
|
|
138
|
+
|
|
93
139
|
# Checks equality by comparing each attribute.
|
|
94
140
|
# @param [Object] Object to be compared
|
|
95
141
|
def ==(o)
|
|
@@ -115,82 +161,23 @@ module DevDraftAI
|
|
|
115
161
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
116
162
|
# @return [Object] Returns the model itself
|
|
117
163
|
def self.build_from_hash(attributes)
|
|
118
|
-
new.build_from_hash(attributes)
|
|
119
|
-
end
|
|
120
|
-
|
|
121
|
-
# Builds the object from hash
|
|
122
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
123
|
-
# @return [Object] Returns the model itself
|
|
124
|
-
def build_from_hash(attributes)
|
|
125
164
|
return nil unless attributes.is_a?(Hash)
|
|
126
|
-
|
|
127
|
-
|
|
165
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
166
|
+
transformed_hash = {}
|
|
167
|
+
openapi_types.each_pair do |key, type|
|
|
168
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
169
|
+
transformed_hash["#{key}"] = nil
|
|
170
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
128
171
|
# check to ensure the input is an array given that the attribute
|
|
129
172
|
# is documented as an array but the input is not
|
|
130
|
-
if attributes[
|
|
131
|
-
|
|
132
|
-
end
|
|
133
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
134
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
135
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
136
|
-
self.send("#{key}=", nil)
|
|
137
|
-
end
|
|
138
|
-
end
|
|
139
|
-
|
|
140
|
-
self
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
# Deserializes the data based on type
|
|
144
|
-
# @param string type Data type
|
|
145
|
-
# @param string value Value to be deserialized
|
|
146
|
-
# @return [Object] Deserialized data
|
|
147
|
-
def _deserialize(type, value)
|
|
148
|
-
case type.to_sym
|
|
149
|
-
when :DateTime
|
|
150
|
-
DateTime.parse(value)
|
|
151
|
-
when :Date
|
|
152
|
-
Date.parse(value)
|
|
153
|
-
when :String
|
|
154
|
-
value.to_s
|
|
155
|
-
when :Integer
|
|
156
|
-
value.to_i
|
|
157
|
-
when :Float
|
|
158
|
-
value.to_f
|
|
159
|
-
when :Boolean
|
|
160
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
161
|
-
true
|
|
162
|
-
else
|
|
163
|
-
false
|
|
164
|
-
end
|
|
165
|
-
when :Object
|
|
166
|
-
# generic object (usually a Hash), return directly
|
|
167
|
-
value
|
|
168
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
169
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
170
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
171
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
172
|
-
k_type = Regexp.last_match[:k_type]
|
|
173
|
-
v_type = Regexp.last_match[:v_type]
|
|
174
|
-
{}.tap do |hash|
|
|
175
|
-
value.each do |k, v|
|
|
176
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
173
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
174
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
177
175
|
end
|
|
176
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
177
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
178
178
|
end
|
|
179
|
-
else # model
|
|
180
|
-
DevDraftAI.const_get(type).build_from_hash(value)
|
|
181
179
|
end
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
# Returns the string representation of the object
|
|
185
|
-
# @return [String] String presentation of the object
|
|
186
|
-
def to_s
|
|
187
|
-
to_hash.to_s
|
|
188
|
-
end
|
|
189
|
-
|
|
190
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
191
|
-
# @return [Hash] Returns the object in the form of hash
|
|
192
|
-
def to_body
|
|
193
|
-
to_hash
|
|
180
|
+
new(transformed_hash)
|
|
194
181
|
end
|
|
195
182
|
|
|
196
183
|
# Returns the object in the form of hash
|
|
@@ -209,21 +196,6 @@ module DevDraftAI
|
|
|
209
196
|
hash
|
|
210
197
|
end
|
|
211
198
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
# @param [Object] value Any valid value
|
|
215
|
-
# @return [Hash] Returns the value in the form of hash
|
|
216
|
-
def _to_hash(value)
|
|
217
|
-
if value.is_a?(Array)
|
|
218
|
-
value.compact.map { |v| _to_hash(v) }
|
|
219
|
-
elsif value.is_a?(Hash)
|
|
220
|
-
{}.tap do |hash|
|
|
221
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
222
|
-
end
|
|
223
|
-
elsif value.respond_to? :to_hash
|
|
224
|
-
value.to_hash
|
|
225
|
-
else
|
|
226
|
-
value
|
|
227
|
-
end
|
|
228
|
-
end end
|
|
199
|
+
end
|
|
200
|
+
|
|
229
201
|
end
|
|
@@ -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 PaymentRequestDto
|
|
16
|
+
module Devdraft
|
|
17
|
+
class PaymentRequestDto < ApiModelBase
|
|
16
18
|
# The amount to charge
|
|
17
19
|
attr_accessor :amount
|
|
18
20
|
|
|
@@ -35,13 +37,23 @@ module DevDraftAI
|
|
|
35
37
|
}
|
|
36
38
|
end
|
|
37
39
|
|
|
40
|
+
# Returns attribute mapping this model knows about
|
|
41
|
+
def self.acceptable_attribute_map
|
|
42
|
+
attribute_map
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns all the JSON keys this model knows about
|
|
46
|
+
def self.acceptable_attributes
|
|
47
|
+
acceptable_attribute_map.values
|
|
48
|
+
end
|
|
49
|
+
|
|
38
50
|
# Attribute type mapping.
|
|
39
51
|
def self.openapi_types
|
|
40
52
|
{
|
|
41
|
-
:'amount' => :'
|
|
42
|
-
:'currency' => :'
|
|
43
|
-
:'description' => :'
|
|
44
|
-
:'customer_id' => :'
|
|
53
|
+
:'amount' => :'Float',
|
|
54
|
+
:'currency' => :'String',
|
|
55
|
+
:'description' => :'String',
|
|
56
|
+
:'customer_id' => :'String'
|
|
45
57
|
}
|
|
46
58
|
end
|
|
47
59
|
|
|
@@ -50,32 +62,39 @@ module DevDraftAI
|
|
|
50
62
|
Set.new([
|
|
51
63
|
])
|
|
52
64
|
end
|
|
53
|
-
|
|
65
|
+
|
|
54
66
|
# Initializes the object
|
|
55
67
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
68
|
def initialize(attributes = {})
|
|
57
69
|
if (!attributes.is_a?(Hash))
|
|
58
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
|
70
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Devdraft::PaymentRequestDto` initialize method"
|
|
59
71
|
end
|
|
60
72
|
|
|
61
73
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
74
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
62
75
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
63
|
-
if (!
|
|
64
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
|
76
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Devdraft::PaymentRequestDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
65
78
|
end
|
|
66
79
|
h[k.to_sym] = v
|
|
67
80
|
}
|
|
68
81
|
|
|
69
82
|
if attributes.key?(:'amount')
|
|
70
83
|
self.amount = attributes[:'amount']
|
|
84
|
+
else
|
|
85
|
+
self.amount = nil
|
|
71
86
|
end
|
|
72
87
|
|
|
73
88
|
if attributes.key?(:'currency')
|
|
74
89
|
self.currency = attributes[:'currency']
|
|
90
|
+
else
|
|
91
|
+
self.currency = nil
|
|
75
92
|
end
|
|
76
93
|
|
|
77
94
|
if attributes.key?(:'description')
|
|
78
95
|
self.description = attributes[:'description']
|
|
96
|
+
else
|
|
97
|
+
self.description = nil
|
|
79
98
|
end
|
|
80
99
|
|
|
81
100
|
if attributes.key?(:'customer_id')
|
|
@@ -86,6 +105,7 @@ module DevDraftAI
|
|
|
86
105
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
87
106
|
# @return Array for valid properties with the reasons
|
|
88
107
|
def list_invalid_properties
|
|
108
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
89
109
|
invalid_properties = Array.new
|
|
90
110
|
if @amount.nil?
|
|
91
111
|
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
|
@@ -105,12 +125,43 @@ module DevDraftAI
|
|
|
105
125
|
# Check to see if the all the properties in the model are valid
|
|
106
126
|
# @return true if the model is valid
|
|
107
127
|
def valid?
|
|
128
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
108
129
|
return false if @amount.nil?
|
|
109
130
|
return false if @currency.nil?
|
|
110
131
|
return false if @description.nil?
|
|
111
132
|
true
|
|
112
133
|
end
|
|
113
134
|
|
|
135
|
+
# Custom attribute writer method with validation
|
|
136
|
+
# @param [Object] amount Value to be assigned
|
|
137
|
+
def amount=(amount)
|
|
138
|
+
if amount.nil?
|
|
139
|
+
fail ArgumentError, 'amount cannot be nil'
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
@amount = amount
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Custom attribute writer method with validation
|
|
146
|
+
# @param [Object] currency Value to be assigned
|
|
147
|
+
def currency=(currency)
|
|
148
|
+
if currency.nil?
|
|
149
|
+
fail ArgumentError, 'currency cannot be nil'
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
@currency = currency
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Custom attribute writer method with validation
|
|
156
|
+
# @param [Object] description Value to be assigned
|
|
157
|
+
def description=(description)
|
|
158
|
+
if description.nil?
|
|
159
|
+
fail ArgumentError, 'description cannot be nil'
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
@description = description
|
|
163
|
+
end
|
|
164
|
+
|
|
114
165
|
# Checks equality by comparing each attribute.
|
|
115
166
|
# @param [Object] Object to be compared
|
|
116
167
|
def ==(o)
|
|
@@ -138,82 +189,23 @@ module DevDraftAI
|
|
|
138
189
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
139
190
|
# @return [Object] Returns the model itself
|
|
140
191
|
def self.build_from_hash(attributes)
|
|
141
|
-
new.build_from_hash(attributes)
|
|
142
|
-
end
|
|
143
|
-
|
|
144
|
-
# Builds the object from hash
|
|
145
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
146
|
-
# @return [Object] Returns the model itself
|
|
147
|
-
def build_from_hash(attributes)
|
|
148
192
|
return nil unless attributes.is_a?(Hash)
|
|
149
|
-
|
|
150
|
-
|
|
193
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
194
|
+
transformed_hash = {}
|
|
195
|
+
openapi_types.each_pair do |key, type|
|
|
196
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
197
|
+
transformed_hash["#{key}"] = nil
|
|
198
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
151
199
|
# check to ensure the input is an array given that the attribute
|
|
152
200
|
# is documented as an array but the input is not
|
|
153
|
-
if attributes[
|
|
154
|
-
|
|
155
|
-
end
|
|
156
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
157
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
158
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
159
|
-
self.send("#{key}=", nil)
|
|
160
|
-
end
|
|
161
|
-
end
|
|
162
|
-
|
|
163
|
-
self
|
|
164
|
-
end
|
|
165
|
-
|
|
166
|
-
# Deserializes the data based on type
|
|
167
|
-
# @param string type Data type
|
|
168
|
-
# @param string value Value to be deserialized
|
|
169
|
-
# @return [Object] Deserialized data
|
|
170
|
-
def _deserialize(type, value)
|
|
171
|
-
case type.to_sym
|
|
172
|
-
when :DateTime
|
|
173
|
-
DateTime.parse(value)
|
|
174
|
-
when :Date
|
|
175
|
-
Date.parse(value)
|
|
176
|
-
when :String
|
|
177
|
-
value.to_s
|
|
178
|
-
when :Integer
|
|
179
|
-
value.to_i
|
|
180
|
-
when :Float
|
|
181
|
-
value.to_f
|
|
182
|
-
when :Boolean
|
|
183
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
184
|
-
true
|
|
185
|
-
else
|
|
186
|
-
false
|
|
187
|
-
end
|
|
188
|
-
when :Object
|
|
189
|
-
# generic object (usually a Hash), return directly
|
|
190
|
-
value
|
|
191
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
192
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
193
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
194
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
195
|
-
k_type = Regexp.last_match[:k_type]
|
|
196
|
-
v_type = Regexp.last_match[:v_type]
|
|
197
|
-
{}.tap do |hash|
|
|
198
|
-
value.each do |k, v|
|
|
199
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
201
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
202
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
200
203
|
end
|
|
204
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
205
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
201
206
|
end
|
|
202
|
-
else # model
|
|
203
|
-
DevDraftAI.const_get(type).build_from_hash(value)
|
|
204
207
|
end
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
# Returns the string representation of the object
|
|
208
|
-
# @return [String] String presentation of the object
|
|
209
|
-
def to_s
|
|
210
|
-
to_hash.to_s
|
|
211
|
-
end
|
|
212
|
-
|
|
213
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
214
|
-
# @return [Hash] Returns the object in the form of hash
|
|
215
|
-
def to_body
|
|
216
|
-
to_hash
|
|
208
|
+
new(transformed_hash)
|
|
217
209
|
end
|
|
218
210
|
|
|
219
211
|
# Returns the object in the form of hash
|
|
@@ -232,21 +224,6 @@ module DevDraftAI
|
|
|
232
224
|
hash
|
|
233
225
|
end
|
|
234
226
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
# @param [Object] value Any valid value
|
|
238
|
-
# @return [Hash] Returns the value in the form of hash
|
|
239
|
-
def _to_hash(value)
|
|
240
|
-
if value.is_a?(Array)
|
|
241
|
-
value.compact.map { |v| _to_hash(v) }
|
|
242
|
-
elsif value.is_a?(Hash)
|
|
243
|
-
{}.tap do |hash|
|
|
244
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
245
|
-
end
|
|
246
|
-
elsif value.respond_to? :to_hash
|
|
247
|
-
value.to_hash
|
|
248
|
-
else
|
|
249
|
-
value
|
|
250
|
-
end
|
|
251
|
-
end end
|
|
227
|
+
end
|
|
228
|
+
|
|
252
229
|
end
|