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 CreateStablePaymentIntentDto
|
|
16
|
+
module Devdraft
|
|
17
|
+
class CreateStablePaymentIntentDto < ApiModelBase
|
|
16
18
|
# The stablecoin currency to convert FROM. This is the currency the customer will pay with.
|
|
17
19
|
attr_accessor :source_currency
|
|
18
20
|
|
|
@@ -58,6 +60,28 @@ module DevDraftAI
|
|
|
58
60
|
# Customer's phone number with country code. Used for SMS notifications and verification.
|
|
59
61
|
attr_accessor :phone_number
|
|
60
62
|
|
|
63
|
+
class EnumAttributeValidator
|
|
64
|
+
attr_reader :datatype
|
|
65
|
+
attr_reader :allowable_values
|
|
66
|
+
|
|
67
|
+
def initialize(datatype, allowable_values)
|
|
68
|
+
@allowable_values = allowable_values.map do |value|
|
|
69
|
+
case datatype.to_s
|
|
70
|
+
when /Integer/i
|
|
71
|
+
value.to_i
|
|
72
|
+
when /Float/i
|
|
73
|
+
value.to_f
|
|
74
|
+
else
|
|
75
|
+
value
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def valid?(value)
|
|
81
|
+
!value || allowable_values.include?(value)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
61
85
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
62
86
|
def self.attribute_map
|
|
63
87
|
{
|
|
@@ -79,24 +103,34 @@ module DevDraftAI
|
|
|
79
103
|
}
|
|
80
104
|
end
|
|
81
105
|
|
|
106
|
+
# Returns attribute mapping this model knows about
|
|
107
|
+
def self.acceptable_attribute_map
|
|
108
|
+
attribute_map
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Returns all the JSON keys this model knows about
|
|
112
|
+
def self.acceptable_attributes
|
|
113
|
+
acceptable_attribute_map.values
|
|
114
|
+
end
|
|
115
|
+
|
|
82
116
|
# Attribute type mapping.
|
|
83
117
|
def self.openapi_types
|
|
84
118
|
{
|
|
85
|
-
:'source_currency' => :'
|
|
86
|
-
:'source_network' => :'
|
|
87
|
-
:'destination_currency' => :'
|
|
88
|
-
:'destination_network' => :'
|
|
89
|
-
:'destination_address' => :'
|
|
90
|
-
:'amount' => :'
|
|
91
|
-
:'customer_first_name' => :'
|
|
92
|
-
:'customer_last_name' => :'
|
|
93
|
-
:'customer_email' => :'
|
|
94
|
-
:'customer_address' => :'
|
|
95
|
-
:'customer_country' => :'
|
|
96
|
-
:'customer_country_iso' => :'
|
|
97
|
-
:'customer_province' => :'
|
|
98
|
-
:'customer_province_iso' => :'
|
|
99
|
-
:'phone_number' => :'
|
|
119
|
+
:'source_currency' => :'StableCoinCurrency',
|
|
120
|
+
:'source_network' => :'BridgePaymentRail',
|
|
121
|
+
:'destination_currency' => :'StableCoinCurrency',
|
|
122
|
+
:'destination_network' => :'BridgePaymentRail',
|
|
123
|
+
:'destination_address' => :'String',
|
|
124
|
+
:'amount' => :'String',
|
|
125
|
+
:'customer_first_name' => :'String',
|
|
126
|
+
:'customer_last_name' => :'String',
|
|
127
|
+
:'customer_email' => :'String',
|
|
128
|
+
:'customer_address' => :'String',
|
|
129
|
+
:'customer_country' => :'String',
|
|
130
|
+
:'customer_country_iso' => :'String',
|
|
131
|
+
:'customer_province' => :'String',
|
|
132
|
+
:'customer_province_iso' => :'String',
|
|
133
|
+
:'phone_number' => :'String'
|
|
100
134
|
}
|
|
101
135
|
end
|
|
102
136
|
|
|
@@ -105,28 +139,33 @@ module DevDraftAI
|
|
|
105
139
|
Set.new([
|
|
106
140
|
])
|
|
107
141
|
end
|
|
108
|
-
|
|
142
|
+
|
|
109
143
|
# Initializes the object
|
|
110
144
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
111
145
|
def initialize(attributes = {})
|
|
112
146
|
if (!attributes.is_a?(Hash))
|
|
113
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
|
147
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Devdraft::CreateStablePaymentIntentDto` initialize method"
|
|
114
148
|
end
|
|
115
149
|
|
|
116
150
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
151
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
117
152
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
118
|
-
if (!
|
|
119
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
|
153
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
154
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Devdraft::CreateStablePaymentIntentDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
120
155
|
end
|
|
121
156
|
h[k.to_sym] = v
|
|
122
157
|
}
|
|
123
158
|
|
|
124
159
|
if attributes.key?(:'source_currency')
|
|
125
160
|
self.source_currency = attributes[:'source_currency']
|
|
161
|
+
else
|
|
162
|
+
self.source_currency = nil
|
|
126
163
|
end
|
|
127
164
|
|
|
128
165
|
if attributes.key?(:'source_network')
|
|
129
166
|
self.source_network = attributes[:'source_network']
|
|
167
|
+
else
|
|
168
|
+
self.source_network = nil
|
|
130
169
|
end
|
|
131
170
|
|
|
132
171
|
if attributes.key?(:'destination_currency')
|
|
@@ -135,6 +174,8 @@ module DevDraftAI
|
|
|
135
174
|
|
|
136
175
|
if attributes.key?(:'destination_network')
|
|
137
176
|
self.destination_network = attributes[:'destination_network']
|
|
177
|
+
else
|
|
178
|
+
self.destination_network = nil
|
|
138
179
|
end
|
|
139
180
|
|
|
140
181
|
if attributes.key?(:'destination_address')
|
|
@@ -185,6 +226,7 @@ module DevDraftAI
|
|
|
185
226
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
186
227
|
# @return Array for valid properties with the reasons
|
|
187
228
|
def list_invalid_properties
|
|
229
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
188
230
|
invalid_properties = Array.new
|
|
189
231
|
if @source_currency.nil?
|
|
190
232
|
invalid_properties.push('invalid value for "source_currency", source_currency cannot be nil.')
|
|
@@ -198,18 +240,263 @@ module DevDraftAI
|
|
|
198
240
|
invalid_properties.push('invalid value for "destination_network", destination_network cannot be nil.')
|
|
199
241
|
end
|
|
200
242
|
|
|
243
|
+
pattern = Regexp.new(/^\d+(\.\d{1,6})?$/)
|
|
244
|
+
if !@amount.nil? && @amount !~ pattern
|
|
245
|
+
invalid_properties.push("invalid value for \"amount\", must conform to the pattern #{pattern}.")
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
if !@customer_first_name.nil? && @customer_first_name.to_s.length > 100
|
|
249
|
+
invalid_properties.push('invalid value for "customer_first_name", the character length must be smaller than or equal to 100.')
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
if !@customer_last_name.nil? && @customer_last_name.to_s.length > 100
|
|
253
|
+
invalid_properties.push('invalid value for "customer_last_name", the character length must be smaller than or equal to 100.')
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
if !@customer_email.nil? && @customer_email.to_s.length > 255
|
|
257
|
+
invalid_properties.push('invalid value for "customer_email", the character length must be smaller than or equal to 255.')
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
if !@customer_address.nil? && @customer_address.to_s.length > 500
|
|
261
|
+
invalid_properties.push('invalid value for "customer_address", the character length must be smaller than or equal to 500.')
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
if !@customer_country.nil? && @customer_country.to_s.length > 100
|
|
265
|
+
invalid_properties.push('invalid value for "customer_country", the character length must be smaller than or equal to 100.')
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
if !@customer_country_iso.nil? && @customer_country_iso.to_s.length > 2
|
|
269
|
+
invalid_properties.push('invalid value for "customer_country_iso", the character length must be smaller than or equal to 2.')
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
pattern = Regexp.new(/^[A-Z]{2}$/)
|
|
273
|
+
if !@customer_country_iso.nil? && @customer_country_iso !~ pattern
|
|
274
|
+
invalid_properties.push("invalid value for \"customer_country_iso\", must conform to the pattern #{pattern}.")
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
if !@customer_province.nil? && @customer_province.to_s.length > 100
|
|
278
|
+
invalid_properties.push('invalid value for "customer_province", the character length must be smaller than or equal to 100.')
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
if !@customer_province_iso.nil? && @customer_province_iso.to_s.length > 10
|
|
282
|
+
invalid_properties.push('invalid value for "customer_province_iso", the character length must be smaller than or equal to 10.')
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
if !@phone_number.nil? && @phone_number.to_s.length > 20
|
|
286
|
+
invalid_properties.push('invalid value for "phone_number", the character length must be smaller than or equal to 20.')
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
pattern = Regexp.new(/^[+]?[\d\s\-\(\)]+$/)
|
|
290
|
+
if !@phone_number.nil? && @phone_number !~ pattern
|
|
291
|
+
invalid_properties.push("invalid value for \"phone_number\", must conform to the pattern #{pattern}.")
|
|
292
|
+
end
|
|
293
|
+
|
|
201
294
|
invalid_properties
|
|
202
295
|
end
|
|
203
296
|
|
|
204
297
|
# Check to see if the all the properties in the model are valid
|
|
205
298
|
# @return true if the model is valid
|
|
206
299
|
def valid?
|
|
300
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
207
301
|
return false if @source_currency.nil?
|
|
208
302
|
return false if @source_network.nil?
|
|
209
303
|
return false if @destination_network.nil?
|
|
304
|
+
return false if !@amount.nil? && @amount !~ Regexp.new(/^\d+(\.\d{1,6})?$/)
|
|
305
|
+
return false if !@customer_first_name.nil? && @customer_first_name.to_s.length > 100
|
|
306
|
+
return false if !@customer_last_name.nil? && @customer_last_name.to_s.length > 100
|
|
307
|
+
return false if !@customer_email.nil? && @customer_email.to_s.length > 255
|
|
308
|
+
return false if !@customer_address.nil? && @customer_address.to_s.length > 500
|
|
309
|
+
return false if !@customer_country.nil? && @customer_country.to_s.length > 100
|
|
310
|
+
return false if !@customer_country_iso.nil? && @customer_country_iso.to_s.length > 2
|
|
311
|
+
return false if !@customer_country_iso.nil? && @customer_country_iso !~ Regexp.new(/^[A-Z]{2}$/)
|
|
312
|
+
return false if !@customer_province.nil? && @customer_province.to_s.length > 100
|
|
313
|
+
return false if !@customer_province_iso.nil? && @customer_province_iso.to_s.length > 10
|
|
314
|
+
return false if !@phone_number.nil? && @phone_number.to_s.length > 20
|
|
315
|
+
return false if !@phone_number.nil? && @phone_number !~ Regexp.new(/^[+]?[\d\s\-\(\)]+$/)
|
|
210
316
|
true
|
|
211
317
|
end
|
|
212
318
|
|
|
319
|
+
# Custom attribute writer method with validation
|
|
320
|
+
# @param [Object] source_currency Value to be assigned
|
|
321
|
+
def source_currency=(source_currency)
|
|
322
|
+
if source_currency.nil?
|
|
323
|
+
fail ArgumentError, 'source_currency cannot be nil'
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
@source_currency = source_currency
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
# Custom attribute writer method with validation
|
|
330
|
+
# @param [Object] source_network Value to be assigned
|
|
331
|
+
def source_network=(source_network)
|
|
332
|
+
if source_network.nil?
|
|
333
|
+
fail ArgumentError, 'source_network cannot be nil'
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
@source_network = source_network
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
# Custom attribute writer method with validation
|
|
340
|
+
# @param [Object] destination_network Value to be assigned
|
|
341
|
+
def destination_network=(destination_network)
|
|
342
|
+
if destination_network.nil?
|
|
343
|
+
fail ArgumentError, 'destination_network cannot be nil'
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
@destination_network = destination_network
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
# Custom attribute writer method with validation
|
|
350
|
+
# @param [Object] amount Value to be assigned
|
|
351
|
+
def amount=(amount)
|
|
352
|
+
if amount.nil?
|
|
353
|
+
fail ArgumentError, 'amount cannot be nil'
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
pattern = Regexp.new(/^\d+(\.\d{1,6})?$/)
|
|
357
|
+
if amount !~ pattern
|
|
358
|
+
fail ArgumentError, "invalid value for \"amount\", must conform to the pattern #{pattern}."
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
@amount = amount
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
# Custom attribute writer method with validation
|
|
365
|
+
# @param [Object] customer_first_name Value to be assigned
|
|
366
|
+
def customer_first_name=(customer_first_name)
|
|
367
|
+
if customer_first_name.nil?
|
|
368
|
+
fail ArgumentError, 'customer_first_name cannot be nil'
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
if customer_first_name.to_s.length > 100
|
|
372
|
+
fail ArgumentError, 'invalid value for "customer_first_name", the character length must be smaller than or equal to 100.'
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
@customer_first_name = customer_first_name
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
# Custom attribute writer method with validation
|
|
379
|
+
# @param [Object] customer_last_name Value to be assigned
|
|
380
|
+
def customer_last_name=(customer_last_name)
|
|
381
|
+
if customer_last_name.nil?
|
|
382
|
+
fail ArgumentError, 'customer_last_name cannot be nil'
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
if customer_last_name.to_s.length > 100
|
|
386
|
+
fail ArgumentError, 'invalid value for "customer_last_name", the character length must be smaller than or equal to 100.'
|
|
387
|
+
end
|
|
388
|
+
|
|
389
|
+
@customer_last_name = customer_last_name
|
|
390
|
+
end
|
|
391
|
+
|
|
392
|
+
# Custom attribute writer method with validation
|
|
393
|
+
# @param [Object] customer_email Value to be assigned
|
|
394
|
+
def customer_email=(customer_email)
|
|
395
|
+
if customer_email.nil?
|
|
396
|
+
fail ArgumentError, 'customer_email cannot be nil'
|
|
397
|
+
end
|
|
398
|
+
|
|
399
|
+
if customer_email.to_s.length > 255
|
|
400
|
+
fail ArgumentError, 'invalid value for "customer_email", the character length must be smaller than or equal to 255.'
|
|
401
|
+
end
|
|
402
|
+
|
|
403
|
+
@customer_email = customer_email
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
# Custom attribute writer method with validation
|
|
407
|
+
# @param [Object] customer_address Value to be assigned
|
|
408
|
+
def customer_address=(customer_address)
|
|
409
|
+
if customer_address.nil?
|
|
410
|
+
fail ArgumentError, 'customer_address cannot be nil'
|
|
411
|
+
end
|
|
412
|
+
|
|
413
|
+
if customer_address.to_s.length > 500
|
|
414
|
+
fail ArgumentError, 'invalid value for "customer_address", the character length must be smaller than or equal to 500.'
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
@customer_address = customer_address
|
|
418
|
+
end
|
|
419
|
+
|
|
420
|
+
# Custom attribute writer method with validation
|
|
421
|
+
# @param [Object] customer_country Value to be assigned
|
|
422
|
+
def customer_country=(customer_country)
|
|
423
|
+
if customer_country.nil?
|
|
424
|
+
fail ArgumentError, 'customer_country cannot be nil'
|
|
425
|
+
end
|
|
426
|
+
|
|
427
|
+
if customer_country.to_s.length > 100
|
|
428
|
+
fail ArgumentError, 'invalid value for "customer_country", the character length must be smaller than or equal to 100.'
|
|
429
|
+
end
|
|
430
|
+
|
|
431
|
+
@customer_country = customer_country
|
|
432
|
+
end
|
|
433
|
+
|
|
434
|
+
# Custom attribute writer method with validation
|
|
435
|
+
# @param [Object] customer_country_iso Value to be assigned
|
|
436
|
+
def customer_country_iso=(customer_country_iso)
|
|
437
|
+
if customer_country_iso.nil?
|
|
438
|
+
fail ArgumentError, 'customer_country_iso cannot be nil'
|
|
439
|
+
end
|
|
440
|
+
|
|
441
|
+
if customer_country_iso.to_s.length > 2
|
|
442
|
+
fail ArgumentError, 'invalid value for "customer_country_iso", the character length must be smaller than or equal to 2.'
|
|
443
|
+
end
|
|
444
|
+
|
|
445
|
+
pattern = Regexp.new(/^[A-Z]{2}$/)
|
|
446
|
+
if customer_country_iso !~ pattern
|
|
447
|
+
fail ArgumentError, "invalid value for \"customer_country_iso\", must conform to the pattern #{pattern}."
|
|
448
|
+
end
|
|
449
|
+
|
|
450
|
+
@customer_country_iso = customer_country_iso
|
|
451
|
+
end
|
|
452
|
+
|
|
453
|
+
# Custom attribute writer method with validation
|
|
454
|
+
# @param [Object] customer_province Value to be assigned
|
|
455
|
+
def customer_province=(customer_province)
|
|
456
|
+
if customer_province.nil?
|
|
457
|
+
fail ArgumentError, 'customer_province cannot be nil'
|
|
458
|
+
end
|
|
459
|
+
|
|
460
|
+
if customer_province.to_s.length > 100
|
|
461
|
+
fail ArgumentError, 'invalid value for "customer_province", the character length must be smaller than or equal to 100.'
|
|
462
|
+
end
|
|
463
|
+
|
|
464
|
+
@customer_province = customer_province
|
|
465
|
+
end
|
|
466
|
+
|
|
467
|
+
# Custom attribute writer method with validation
|
|
468
|
+
# @param [Object] customer_province_iso Value to be assigned
|
|
469
|
+
def customer_province_iso=(customer_province_iso)
|
|
470
|
+
if customer_province_iso.nil?
|
|
471
|
+
fail ArgumentError, 'customer_province_iso cannot be nil'
|
|
472
|
+
end
|
|
473
|
+
|
|
474
|
+
if customer_province_iso.to_s.length > 10
|
|
475
|
+
fail ArgumentError, 'invalid value for "customer_province_iso", the character length must be smaller than or equal to 10.'
|
|
476
|
+
end
|
|
477
|
+
|
|
478
|
+
@customer_province_iso = customer_province_iso
|
|
479
|
+
end
|
|
480
|
+
|
|
481
|
+
# Custom attribute writer method with validation
|
|
482
|
+
# @param [Object] phone_number Value to be assigned
|
|
483
|
+
def phone_number=(phone_number)
|
|
484
|
+
if phone_number.nil?
|
|
485
|
+
fail ArgumentError, 'phone_number cannot be nil'
|
|
486
|
+
end
|
|
487
|
+
|
|
488
|
+
if phone_number.to_s.length > 20
|
|
489
|
+
fail ArgumentError, 'invalid value for "phone_number", the character length must be smaller than or equal to 20.'
|
|
490
|
+
end
|
|
491
|
+
|
|
492
|
+
pattern = Regexp.new(/^[+]?[\d\s\-\(\)]+$/)
|
|
493
|
+
if phone_number !~ pattern
|
|
494
|
+
fail ArgumentError, "invalid value for \"phone_number\", must conform to the pattern #{pattern}."
|
|
495
|
+
end
|
|
496
|
+
|
|
497
|
+
@phone_number = phone_number
|
|
498
|
+
end
|
|
499
|
+
|
|
213
500
|
# Checks equality by comparing each attribute.
|
|
214
501
|
# @param [Object] Object to be compared
|
|
215
502
|
def ==(o)
|
|
@@ -248,82 +535,23 @@ module DevDraftAI
|
|
|
248
535
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
249
536
|
# @return [Object] Returns the model itself
|
|
250
537
|
def self.build_from_hash(attributes)
|
|
251
|
-
new.build_from_hash(attributes)
|
|
252
|
-
end
|
|
253
|
-
|
|
254
|
-
# Builds the object from hash
|
|
255
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
256
|
-
# @return [Object] Returns the model itself
|
|
257
|
-
def build_from_hash(attributes)
|
|
258
538
|
return nil unless attributes.is_a?(Hash)
|
|
259
|
-
|
|
260
|
-
|
|
539
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
540
|
+
transformed_hash = {}
|
|
541
|
+
openapi_types.each_pair do |key, type|
|
|
542
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
543
|
+
transformed_hash["#{key}"] = nil
|
|
544
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
261
545
|
# check to ensure the input is an array given that the attribute
|
|
262
546
|
# is documented as an array but the input is not
|
|
263
|
-
if attributes[
|
|
264
|
-
|
|
547
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
548
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
265
549
|
end
|
|
266
|
-
elsif !attributes[
|
|
267
|
-
|
|
268
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
269
|
-
self.send("#{key}=", nil)
|
|
550
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
551
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
270
552
|
end
|
|
271
553
|
end
|
|
272
|
-
|
|
273
|
-
self
|
|
274
|
-
end
|
|
275
|
-
|
|
276
|
-
# Deserializes the data based on type
|
|
277
|
-
# @param string type Data type
|
|
278
|
-
# @param string value Value to be deserialized
|
|
279
|
-
# @return [Object] Deserialized data
|
|
280
|
-
def _deserialize(type, value)
|
|
281
|
-
case type.to_sym
|
|
282
|
-
when :DateTime
|
|
283
|
-
DateTime.parse(value)
|
|
284
|
-
when :Date
|
|
285
|
-
Date.parse(value)
|
|
286
|
-
when :String
|
|
287
|
-
value.to_s
|
|
288
|
-
when :Integer
|
|
289
|
-
value.to_i
|
|
290
|
-
when :Float
|
|
291
|
-
value.to_f
|
|
292
|
-
when :Boolean
|
|
293
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
294
|
-
true
|
|
295
|
-
else
|
|
296
|
-
false
|
|
297
|
-
end
|
|
298
|
-
when :Object
|
|
299
|
-
# generic object (usually a Hash), return directly
|
|
300
|
-
value
|
|
301
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
302
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
303
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
304
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
305
|
-
k_type = Regexp.last_match[:k_type]
|
|
306
|
-
v_type = Regexp.last_match[:v_type]
|
|
307
|
-
{}.tap do |hash|
|
|
308
|
-
value.each do |k, v|
|
|
309
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
310
|
-
end
|
|
311
|
-
end
|
|
312
|
-
else # model
|
|
313
|
-
DevDraftAI.const_get(type).build_from_hash(value)
|
|
314
|
-
end
|
|
315
|
-
end
|
|
316
|
-
|
|
317
|
-
# Returns the string representation of the object
|
|
318
|
-
# @return [String] String presentation of the object
|
|
319
|
-
def to_s
|
|
320
|
-
to_hash.to_s
|
|
321
|
-
end
|
|
322
|
-
|
|
323
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
324
|
-
# @return [Hash] Returns the object in the form of hash
|
|
325
|
-
def to_body
|
|
326
|
-
to_hash
|
|
554
|
+
new(transformed_hash)
|
|
327
555
|
end
|
|
328
556
|
|
|
329
557
|
# Returns the object in the form of hash
|
|
@@ -342,21 +570,6 @@ module DevDraftAI
|
|
|
342
570
|
hash
|
|
343
571
|
end
|
|
344
572
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
# @param [Object] value Any valid value
|
|
348
|
-
# @return [Hash] Returns the value in the form of hash
|
|
349
|
-
def _to_hash(value)
|
|
350
|
-
if value.is_a?(Array)
|
|
351
|
-
value.compact.map { |v| _to_hash(v) }
|
|
352
|
-
elsif value.is_a?(Hash)
|
|
353
|
-
{}.tap do |hash|
|
|
354
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
355
|
-
end
|
|
356
|
-
elsif value.respond_to? :to_hash
|
|
357
|
-
value.to_hash
|
|
358
|
-
else
|
|
359
|
-
value
|
|
360
|
-
end
|
|
361
|
-
end end
|
|
573
|
+
end
|
|
574
|
+
|
|
362
575
|
end
|