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 ExchangeRateResponseDto
|
|
16
|
+
module Devdraft
|
|
17
|
+
class ExchangeRateResponseDto < ApiModelBase
|
|
16
18
|
# Source currency code (USD for USDC)
|
|
17
19
|
attr_accessor :from
|
|
18
20
|
|
|
@@ -43,15 +45,25 @@ module DevDraftAI
|
|
|
43
45
|
}
|
|
44
46
|
end
|
|
45
47
|
|
|
48
|
+
# Returns attribute mapping this model knows about
|
|
49
|
+
def self.acceptable_attribute_map
|
|
50
|
+
attribute_map
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Returns all the JSON keys this model knows about
|
|
54
|
+
def self.acceptable_attributes
|
|
55
|
+
acceptable_attribute_map.values
|
|
56
|
+
end
|
|
57
|
+
|
|
46
58
|
# Attribute type mapping.
|
|
47
59
|
def self.openapi_types
|
|
48
60
|
{
|
|
49
|
-
:'from' => :'
|
|
50
|
-
:'to' => :'
|
|
51
|
-
:'midmarket_rate' => :'
|
|
52
|
-
:'buy_rate' => :'
|
|
53
|
-
:'sell_rate' => :'
|
|
54
|
-
:'timestamp' => :'
|
|
61
|
+
:'from' => :'String',
|
|
62
|
+
:'to' => :'String',
|
|
63
|
+
:'midmarket_rate' => :'String',
|
|
64
|
+
:'buy_rate' => :'String',
|
|
65
|
+
:'sell_rate' => :'String',
|
|
66
|
+
:'timestamp' => :'String'
|
|
55
67
|
}
|
|
56
68
|
end
|
|
57
69
|
|
|
@@ -60,40 +72,51 @@ module DevDraftAI
|
|
|
60
72
|
Set.new([
|
|
61
73
|
])
|
|
62
74
|
end
|
|
63
|
-
|
|
75
|
+
|
|
64
76
|
# Initializes the object
|
|
65
77
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
66
78
|
def initialize(attributes = {})
|
|
67
79
|
if (!attributes.is_a?(Hash))
|
|
68
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Devdraft::ExchangeRateResponseDto` initialize method"
|
|
69
81
|
end
|
|
70
82
|
|
|
71
83
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
84
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
72
85
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
73
|
-
if (!
|
|
74
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
|
86
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
87
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Devdraft::ExchangeRateResponseDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
75
88
|
end
|
|
76
89
|
h[k.to_sym] = v
|
|
77
90
|
}
|
|
78
91
|
|
|
79
92
|
if attributes.key?(:'from')
|
|
80
93
|
self.from = attributes[:'from']
|
|
94
|
+
else
|
|
95
|
+
self.from = nil
|
|
81
96
|
end
|
|
82
97
|
|
|
83
98
|
if attributes.key?(:'to')
|
|
84
99
|
self.to = attributes[:'to']
|
|
100
|
+
else
|
|
101
|
+
self.to = nil
|
|
85
102
|
end
|
|
86
103
|
|
|
87
104
|
if attributes.key?(:'midmarket_rate')
|
|
88
105
|
self.midmarket_rate = attributes[:'midmarket_rate']
|
|
106
|
+
else
|
|
107
|
+
self.midmarket_rate = nil
|
|
89
108
|
end
|
|
90
109
|
|
|
91
110
|
if attributes.key?(:'buy_rate')
|
|
92
111
|
self.buy_rate = attributes[:'buy_rate']
|
|
112
|
+
else
|
|
113
|
+
self.buy_rate = nil
|
|
93
114
|
end
|
|
94
115
|
|
|
95
116
|
if attributes.key?(:'sell_rate')
|
|
96
117
|
self.sell_rate = attributes[:'sell_rate']
|
|
118
|
+
else
|
|
119
|
+
self.sell_rate = nil
|
|
97
120
|
end
|
|
98
121
|
|
|
99
122
|
if attributes.key?(:'timestamp')
|
|
@@ -104,6 +127,7 @@ module DevDraftAI
|
|
|
104
127
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
105
128
|
# @return Array for valid properties with the reasons
|
|
106
129
|
def list_invalid_properties
|
|
130
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
107
131
|
invalid_properties = Array.new
|
|
108
132
|
if @from.nil?
|
|
109
133
|
invalid_properties.push('invalid value for "from", from cannot be nil.')
|
|
@@ -131,6 +155,7 @@ module DevDraftAI
|
|
|
131
155
|
# Check to see if the all the properties in the model are valid
|
|
132
156
|
# @return true if the model is valid
|
|
133
157
|
def valid?
|
|
158
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
134
159
|
return false if @from.nil?
|
|
135
160
|
return false if @to.nil?
|
|
136
161
|
return false if @midmarket_rate.nil?
|
|
@@ -139,6 +164,56 @@ module DevDraftAI
|
|
|
139
164
|
true
|
|
140
165
|
end
|
|
141
166
|
|
|
167
|
+
# Custom attribute writer method with validation
|
|
168
|
+
# @param [Object] from Value to be assigned
|
|
169
|
+
def from=(from)
|
|
170
|
+
if from.nil?
|
|
171
|
+
fail ArgumentError, 'from cannot be nil'
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
@from = from
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Custom attribute writer method with validation
|
|
178
|
+
# @param [Object] to Value to be assigned
|
|
179
|
+
def to=(to)
|
|
180
|
+
if to.nil?
|
|
181
|
+
fail ArgumentError, 'to cannot be nil'
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
@to = to
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Custom attribute writer method with validation
|
|
188
|
+
# @param [Object] midmarket_rate Value to be assigned
|
|
189
|
+
def midmarket_rate=(midmarket_rate)
|
|
190
|
+
if midmarket_rate.nil?
|
|
191
|
+
fail ArgumentError, 'midmarket_rate cannot be nil'
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
@midmarket_rate = midmarket_rate
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Custom attribute writer method with validation
|
|
198
|
+
# @param [Object] buy_rate Value to be assigned
|
|
199
|
+
def buy_rate=(buy_rate)
|
|
200
|
+
if buy_rate.nil?
|
|
201
|
+
fail ArgumentError, 'buy_rate cannot be nil'
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
@buy_rate = buy_rate
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Custom attribute writer method with validation
|
|
208
|
+
# @param [Object] sell_rate Value to be assigned
|
|
209
|
+
def sell_rate=(sell_rate)
|
|
210
|
+
if sell_rate.nil?
|
|
211
|
+
fail ArgumentError, 'sell_rate cannot be nil'
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
@sell_rate = sell_rate
|
|
215
|
+
end
|
|
216
|
+
|
|
142
217
|
# Checks equality by comparing each attribute.
|
|
143
218
|
# @param [Object] Object to be compared
|
|
144
219
|
def ==(o)
|
|
@@ -168,82 +243,23 @@ module DevDraftAI
|
|
|
168
243
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
169
244
|
# @return [Object] Returns the model itself
|
|
170
245
|
def self.build_from_hash(attributes)
|
|
171
|
-
new.build_from_hash(attributes)
|
|
172
|
-
end
|
|
173
|
-
|
|
174
|
-
# Builds the object from hash
|
|
175
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
176
|
-
# @return [Object] Returns the model itself
|
|
177
|
-
def build_from_hash(attributes)
|
|
178
246
|
return nil unless attributes.is_a?(Hash)
|
|
179
|
-
|
|
180
|
-
|
|
247
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
248
|
+
transformed_hash = {}
|
|
249
|
+
openapi_types.each_pair do |key, type|
|
|
250
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
251
|
+
transformed_hash["#{key}"] = nil
|
|
252
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
181
253
|
# check to ensure the input is an array given that the attribute
|
|
182
254
|
# is documented as an array but the input is not
|
|
183
|
-
if attributes[
|
|
184
|
-
|
|
185
|
-
end
|
|
186
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
187
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
188
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
189
|
-
self.send("#{key}=", nil)
|
|
190
|
-
end
|
|
191
|
-
end
|
|
192
|
-
|
|
193
|
-
self
|
|
194
|
-
end
|
|
195
|
-
|
|
196
|
-
# Deserializes the data based on type
|
|
197
|
-
# @param string type Data type
|
|
198
|
-
# @param string value Value to be deserialized
|
|
199
|
-
# @return [Object] Deserialized data
|
|
200
|
-
def _deserialize(type, value)
|
|
201
|
-
case type.to_sym
|
|
202
|
-
when :DateTime
|
|
203
|
-
DateTime.parse(value)
|
|
204
|
-
when :Date
|
|
205
|
-
Date.parse(value)
|
|
206
|
-
when :String
|
|
207
|
-
value.to_s
|
|
208
|
-
when :Integer
|
|
209
|
-
value.to_i
|
|
210
|
-
when :Float
|
|
211
|
-
value.to_f
|
|
212
|
-
when :Boolean
|
|
213
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
214
|
-
true
|
|
215
|
-
else
|
|
216
|
-
false
|
|
217
|
-
end
|
|
218
|
-
when :Object
|
|
219
|
-
# generic object (usually a Hash), return directly
|
|
220
|
-
value
|
|
221
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
222
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
223
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
224
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
225
|
-
k_type = Regexp.last_match[:k_type]
|
|
226
|
-
v_type = Regexp.last_match[:v_type]
|
|
227
|
-
{}.tap do |hash|
|
|
228
|
-
value.each do |k, v|
|
|
229
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
255
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
256
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
230
257
|
end
|
|
258
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
259
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
231
260
|
end
|
|
232
|
-
else # model
|
|
233
|
-
DevDraftAI.const_get(type).build_from_hash(value)
|
|
234
261
|
end
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
# Returns the string representation of the object
|
|
238
|
-
# @return [String] String presentation of the object
|
|
239
|
-
def to_s
|
|
240
|
-
to_hash.to_s
|
|
241
|
-
end
|
|
242
|
-
|
|
243
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
244
|
-
# @return [Hash] Returns the object in the form of hash
|
|
245
|
-
def to_body
|
|
246
|
-
to_hash
|
|
262
|
+
new(transformed_hash)
|
|
247
263
|
end
|
|
248
264
|
|
|
249
265
|
# Returns the object in the form of hash
|
|
@@ -262,21 +278,6 @@ module DevDraftAI
|
|
|
262
278
|
hash
|
|
263
279
|
end
|
|
264
280
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
# @param [Object] value Any valid value
|
|
268
|
-
# @return [Hash] Returns the value in the form of hash
|
|
269
|
-
def _to_hash(value)
|
|
270
|
-
if value.is_a?(Array)
|
|
271
|
-
value.compact.map { |v| _to_hash(v) }
|
|
272
|
-
elsif value.is_a?(Hash)
|
|
273
|
-
{}.tap do |hash|
|
|
274
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
275
|
-
end
|
|
276
|
-
elsif value.respond_to? :to_hash
|
|
277
|
-
value.to_hash
|
|
278
|
-
else
|
|
279
|
-
value
|
|
280
|
-
end
|
|
281
|
-
end end
|
|
281
|
+
end
|
|
282
|
+
|
|
282
283
|
end
|
|
@@ -3,27 +3,39 @@
|
|
|
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
|
|
16
|
+
module Devdraft
|
|
15
17
|
class FiatCurrency
|
|
16
|
-
USD =
|
|
17
|
-
EUR =
|
|
18
|
-
MXN =
|
|
18
|
+
USD = "usd".freeze
|
|
19
|
+
EUR = "eur".freeze
|
|
20
|
+
MXN = "mxn".freeze
|
|
21
|
+
|
|
22
|
+
def self.all_vars
|
|
23
|
+
@all_vars ||= [USD, EUR, MXN].freeze
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Builds the enum from string
|
|
27
|
+
# @param [String] The enum value in the form of the string
|
|
28
|
+
# @return [String] The enum value
|
|
29
|
+
def self.build_from_hash(value)
|
|
30
|
+
new.build_from_hash(value)
|
|
31
|
+
end
|
|
19
32
|
|
|
20
33
|
# Builds the enum from string
|
|
21
34
|
# @param [String] The enum value in the form of the string
|
|
22
35
|
# @return [String] The enum value
|
|
23
36
|
def build_from_hash(value)
|
|
24
|
-
|
|
25
|
-
raise "Invalid ENUM value #{value} for class #FiatCurrency"
|
|
26
|
-
value
|
|
37
|
+
return value if FiatCurrency.all_vars.include?(value)
|
|
38
|
+
raise "Invalid ENUM value #{value} for class #FiatCurrency"
|
|
27
39
|
end
|
|
28
40
|
end
|
|
29
41
|
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 HealthResponseDto
|
|
16
|
+
module Devdraft
|
|
17
|
+
class HealthResponseDto < ApiModelBase
|
|
16
18
|
# Overall health status of the service. Returns \"ok\" when healthy, \"error\" when issues detected.
|
|
17
19
|
attr_accessor :status
|
|
18
20
|
|
|
@@ -65,15 +67,25 @@ module DevDraftAI
|
|
|
65
67
|
}
|
|
66
68
|
end
|
|
67
69
|
|
|
70
|
+
# Returns attribute mapping this model knows about
|
|
71
|
+
def self.acceptable_attribute_map
|
|
72
|
+
attribute_map
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Returns all the JSON keys this model knows about
|
|
76
|
+
def self.acceptable_attributes
|
|
77
|
+
acceptable_attribute_map.values
|
|
78
|
+
end
|
|
79
|
+
|
|
68
80
|
# Attribute type mapping.
|
|
69
81
|
def self.openapi_types
|
|
70
82
|
{
|
|
71
|
-
:'status' => :'
|
|
72
|
-
:'timestamp' => :'
|
|
73
|
-
:'version' => :'
|
|
74
|
-
:'database' => :'
|
|
75
|
-
:'message' => :'
|
|
76
|
-
:'authenticated' => :'
|
|
83
|
+
:'status' => :'String',
|
|
84
|
+
:'timestamp' => :'Time',
|
|
85
|
+
:'version' => :'String',
|
|
86
|
+
:'database' => :'String',
|
|
87
|
+
:'message' => :'String',
|
|
88
|
+
:'authenticated' => :'Boolean'
|
|
77
89
|
}
|
|
78
90
|
end
|
|
79
91
|
|
|
@@ -82,50 +94,64 @@ module DevDraftAI
|
|
|
82
94
|
Set.new([
|
|
83
95
|
])
|
|
84
96
|
end
|
|
85
|
-
|
|
97
|
+
|
|
86
98
|
# Initializes the object
|
|
87
99
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
88
100
|
def initialize(attributes = {})
|
|
89
101
|
if (!attributes.is_a?(Hash))
|
|
90
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
|
102
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Devdraft::HealthResponseDto` initialize method"
|
|
91
103
|
end
|
|
92
104
|
|
|
93
105
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
106
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
94
107
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
95
|
-
if (!
|
|
96
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
|
108
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
109
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Devdraft::HealthResponseDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
97
110
|
end
|
|
98
111
|
h[k.to_sym] = v
|
|
99
112
|
}
|
|
100
113
|
|
|
101
114
|
if attributes.key?(:'status')
|
|
102
115
|
self.status = attributes[:'status']
|
|
116
|
+
else
|
|
117
|
+
self.status = nil
|
|
103
118
|
end
|
|
104
119
|
|
|
105
120
|
if attributes.key?(:'timestamp')
|
|
106
121
|
self.timestamp = attributes[:'timestamp']
|
|
122
|
+
else
|
|
123
|
+
self.timestamp = nil
|
|
107
124
|
end
|
|
108
125
|
|
|
109
126
|
if attributes.key?(:'version')
|
|
110
127
|
self.version = attributes[:'version']
|
|
128
|
+
else
|
|
129
|
+
self.version = nil
|
|
111
130
|
end
|
|
112
131
|
|
|
113
132
|
if attributes.key?(:'database')
|
|
114
133
|
self.database = attributes[:'database']
|
|
134
|
+
else
|
|
135
|
+
self.database = nil
|
|
115
136
|
end
|
|
116
137
|
|
|
117
138
|
if attributes.key?(:'message')
|
|
118
139
|
self.message = attributes[:'message']
|
|
140
|
+
else
|
|
141
|
+
self.message = nil
|
|
119
142
|
end
|
|
120
143
|
|
|
121
144
|
if attributes.key?(:'authenticated')
|
|
122
145
|
self.authenticated = attributes[:'authenticated']
|
|
146
|
+
else
|
|
147
|
+
self.authenticated = nil
|
|
123
148
|
end
|
|
124
149
|
end
|
|
125
150
|
|
|
126
151
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
127
152
|
# @return Array for valid properties with the reasons
|
|
128
153
|
def list_invalid_properties
|
|
154
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
129
155
|
invalid_properties = Array.new
|
|
130
156
|
if @status.nil?
|
|
131
157
|
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
@@ -157,13 +183,14 @@ module DevDraftAI
|
|
|
157
183
|
# Check to see if the all the properties in the model are valid
|
|
158
184
|
# @return true if the model is valid
|
|
159
185
|
def valid?
|
|
186
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
160
187
|
return false if @status.nil?
|
|
161
|
-
status_validator = EnumAttributeValidator.new('
|
|
188
|
+
status_validator = EnumAttributeValidator.new('String', ["ok", "error"])
|
|
162
189
|
return false unless status_validator.valid?(@status)
|
|
163
190
|
return false if @timestamp.nil?
|
|
164
191
|
return false if @version.nil?
|
|
165
192
|
return false if @database.nil?
|
|
166
|
-
database_validator = EnumAttributeValidator.new('
|
|
193
|
+
database_validator = EnumAttributeValidator.new('String', ["connected", "error"])
|
|
167
194
|
return false unless database_validator.valid?(@database)
|
|
168
195
|
return false if @message.nil?
|
|
169
196
|
return false if @authenticated.nil?
|
|
@@ -173,23 +200,63 @@ module DevDraftAI
|
|
|
173
200
|
# Custom attribute writer method checking allowed values (enum).
|
|
174
201
|
# @param [Object] status Object to be assigned
|
|
175
202
|
def status=(status)
|
|
176
|
-
validator = EnumAttributeValidator.new('
|
|
203
|
+
validator = EnumAttributeValidator.new('String', ["ok", "error"])
|
|
177
204
|
unless validator.valid?(status)
|
|
178
205
|
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
179
206
|
end
|
|
180
207
|
@status = status
|
|
181
208
|
end
|
|
182
209
|
|
|
210
|
+
# Custom attribute writer method with validation
|
|
211
|
+
# @param [Object] timestamp Value to be assigned
|
|
212
|
+
def timestamp=(timestamp)
|
|
213
|
+
if timestamp.nil?
|
|
214
|
+
fail ArgumentError, 'timestamp cannot be nil'
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
@timestamp = timestamp
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Custom attribute writer method with validation
|
|
221
|
+
# @param [Object] version Value to be assigned
|
|
222
|
+
def version=(version)
|
|
223
|
+
if version.nil?
|
|
224
|
+
fail ArgumentError, 'version cannot be nil'
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
@version = version
|
|
228
|
+
end
|
|
229
|
+
|
|
183
230
|
# Custom attribute writer method checking allowed values (enum).
|
|
184
231
|
# @param [Object] database Object to be assigned
|
|
185
232
|
def database=(database)
|
|
186
|
-
validator = EnumAttributeValidator.new('
|
|
233
|
+
validator = EnumAttributeValidator.new('String', ["connected", "error"])
|
|
187
234
|
unless validator.valid?(database)
|
|
188
235
|
fail ArgumentError, "invalid value for \"database\", must be one of #{validator.allowable_values}."
|
|
189
236
|
end
|
|
190
237
|
@database = database
|
|
191
238
|
end
|
|
192
239
|
|
|
240
|
+
# Custom attribute writer method with validation
|
|
241
|
+
# @param [Object] message Value to be assigned
|
|
242
|
+
def message=(message)
|
|
243
|
+
if message.nil?
|
|
244
|
+
fail ArgumentError, 'message cannot be nil'
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
@message = message
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Custom attribute writer method with validation
|
|
251
|
+
# @param [Object] authenticated Value to be assigned
|
|
252
|
+
def authenticated=(authenticated)
|
|
253
|
+
if authenticated.nil?
|
|
254
|
+
fail ArgumentError, 'authenticated cannot be nil'
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
@authenticated = authenticated
|
|
258
|
+
end
|
|
259
|
+
|
|
193
260
|
# Checks equality by comparing each attribute.
|
|
194
261
|
# @param [Object] Object to be compared
|
|
195
262
|
def ==(o)
|
|
@@ -219,82 +286,23 @@ module DevDraftAI
|
|
|
219
286
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
220
287
|
# @return [Object] Returns the model itself
|
|
221
288
|
def self.build_from_hash(attributes)
|
|
222
|
-
new.build_from_hash(attributes)
|
|
223
|
-
end
|
|
224
|
-
|
|
225
|
-
# Builds the object from hash
|
|
226
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
227
|
-
# @return [Object] Returns the model itself
|
|
228
|
-
def build_from_hash(attributes)
|
|
229
289
|
return nil unless attributes.is_a?(Hash)
|
|
230
|
-
|
|
231
|
-
|
|
290
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
291
|
+
transformed_hash = {}
|
|
292
|
+
openapi_types.each_pair do |key, type|
|
|
293
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
294
|
+
transformed_hash["#{key}"] = nil
|
|
295
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
232
296
|
# check to ensure the input is an array given that the attribute
|
|
233
297
|
# is documented as an array but the input is not
|
|
234
|
-
if attributes[
|
|
235
|
-
|
|
236
|
-
end
|
|
237
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
238
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
239
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
240
|
-
self.send("#{key}=", nil)
|
|
241
|
-
end
|
|
242
|
-
end
|
|
243
|
-
|
|
244
|
-
self
|
|
245
|
-
end
|
|
246
|
-
|
|
247
|
-
# Deserializes the data based on type
|
|
248
|
-
# @param string type Data type
|
|
249
|
-
# @param string value Value to be deserialized
|
|
250
|
-
# @return [Object] Deserialized data
|
|
251
|
-
def _deserialize(type, value)
|
|
252
|
-
case type.to_sym
|
|
253
|
-
when :DateTime
|
|
254
|
-
DateTime.parse(value)
|
|
255
|
-
when :Date
|
|
256
|
-
Date.parse(value)
|
|
257
|
-
when :String
|
|
258
|
-
value.to_s
|
|
259
|
-
when :Integer
|
|
260
|
-
value.to_i
|
|
261
|
-
when :Float
|
|
262
|
-
value.to_f
|
|
263
|
-
when :Boolean
|
|
264
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
265
|
-
true
|
|
266
|
-
else
|
|
267
|
-
false
|
|
268
|
-
end
|
|
269
|
-
when :Object
|
|
270
|
-
# generic object (usually a Hash), return directly
|
|
271
|
-
value
|
|
272
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
273
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
274
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
275
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
276
|
-
k_type = Regexp.last_match[:k_type]
|
|
277
|
-
v_type = Regexp.last_match[:v_type]
|
|
278
|
-
{}.tap do |hash|
|
|
279
|
-
value.each do |k, v|
|
|
280
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
298
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
299
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
281
300
|
end
|
|
301
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
302
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
282
303
|
end
|
|
283
|
-
else # model
|
|
284
|
-
DevDraftAI.const_get(type).build_from_hash(value)
|
|
285
304
|
end
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
# Returns the string representation of the object
|
|
289
|
-
# @return [String] String presentation of the object
|
|
290
|
-
def to_s
|
|
291
|
-
to_hash.to_s
|
|
292
|
-
end
|
|
293
|
-
|
|
294
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
295
|
-
# @return [Hash] Returns the object in the form of hash
|
|
296
|
-
def to_body
|
|
297
|
-
to_hash
|
|
305
|
+
new(transformed_hash)
|
|
298
306
|
end
|
|
299
307
|
|
|
300
308
|
# Returns the object in the form of hash
|
|
@@ -313,21 +321,6 @@ module DevDraftAI
|
|
|
313
321
|
hash
|
|
314
322
|
end
|
|
315
323
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
# @param [Object] value Any valid value
|
|
319
|
-
# @return [Hash] Returns the value in the form of hash
|
|
320
|
-
def _to_hash(value)
|
|
321
|
-
if value.is_a?(Array)
|
|
322
|
-
value.compact.map { |v| _to_hash(v) }
|
|
323
|
-
elsif value.is_a?(Hash)
|
|
324
|
-
{}.tap do |hash|
|
|
325
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
326
|
-
end
|
|
327
|
-
elsif value.respond_to? :to_hash
|
|
328
|
-
value.to_hash
|
|
329
|
-
else
|
|
330
|
-
value
|
|
331
|
-
end
|
|
332
|
-
end end
|
|
324
|
+
end
|
|
325
|
+
|
|
333
326
|
end
|