devdraft 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +155 -253
- data/Rakefile +2 -0
- data/devdraft-1.0.0.gem +0 -0
- data/{devdraft_ai_sdk.gemspec → devdraft.gemspec} +15 -11
- data/docs/APIHealthApi.md +82 -30
- data/docs/AggregatedBalanceResponse.md +19 -6
- data/docs/AllBalancesResponse.md +19 -6
- data/docs/AppBalancesApi.md +125 -65
- data/docs/BridgeFiatPaymentRail.md +15 -0
- data/docs/BridgePaymentRail.md +12 -3
- data/docs/CreateBankPaymentIntentDto.md +49 -21
- data/docs/CreateCustomerDto.md +25 -9
- data/docs/CreateDirectBankTransferDto.md +29 -11
- data/docs/CreateDirectWalletTransferDto.md +21 -7
- data/docs/CreateExternalBankTransferDto.md +40 -0
- data/docs/CreateExternalStablecoinTransferDto.md +28 -0
- data/docs/CreateInvoiceDto.md +45 -19
- data/docs/CreateLiquidationAddressDto.md +43 -18
- data/docs/CreatePaymentLinkDto.md +53 -28
- data/docs/CreateStablePaymentIntentDto.md +43 -18
- data/docs/CreateStablecoinConversionDto.md +23 -8
- data/docs/CreateTaxDto.md +26 -0
- data/docs/CreateWebhookDto.md +23 -8
- data/docs/CustomerStatus.md +12 -3
- data/docs/CustomerType.md +15 -0
- data/docs/CustomersApi.md +187 -114
- data/docs/DestinationCurrency.md +12 -3
- data/docs/ExchangeRateResponseDto.md +25 -9
- data/docs/ExchangeRatesApi.md +130 -72
- data/docs/FiatCurrency.md +12 -3
- data/docs/HealthResponseDto.md +25 -9
- data/docs/InvoiceProductDto.md +17 -5
- data/docs/InvoicesApi.md +177 -104
- data/docs/LiquidationAddressResponseDto.md +41 -17
- data/docs/LiquidationAddressesApi.md +115 -61
- data/docs/PaymentIntentsApi.md +93 -57
- data/docs/PaymentLinkProductDto.md +17 -5
- data/docs/PaymentLinksApi.md +175 -102
- data/docs/PaymentRequestDto.md +21 -7
- data/docs/PaymentResponseDto.md +23 -8
- data/docs/ProductsApi.md +307 -194
- data/docs/PublicHealthResponseDto.md +19 -6
- data/docs/RefundResponseDto.md +23 -8
- data/docs/StableCoinCurrency.md +12 -3
- data/docs/TaxControllerCreate201Response.md +30 -0
- data/docs/TaxControllerDeleteWithoutId400Response.md +22 -0
- data/docs/TaxControllerUpdateWithoutId400Response.md +22 -0
- data/docs/TaxesApi.md +374 -122
- data/docs/TestPaymentsApi.md +150 -60
- data/docs/TransfersApi.md +274 -72
- data/docs/UpdateCustomerDto.md +25 -9
- data/docs/UpdateTaxDto.md +26 -0
- data/docs/UpdateWebhookDto.md +23 -8
- data/docs/WalletsApi.md +44 -24
- data/docs/WebhookResponseDto.md +29 -11
- data/docs/WebhooksApi.md +225 -134
- data/git_push.sh +41 -28
- data/lib/devdraft/api/api_health_api.rb +32 -16
- data/lib/devdraft/api/app_balances_api.rb +45 -22
- data/lib/devdraft/api/customers_api.rb +124 -71
- data/lib/devdraft/api/exchange_rates_api.rb +49 -26
- data/lib/devdraft/api/invoices_api.rb +89 -53
- data/lib/devdraft/api/liquidation_addresses_api.rb +70 -44
- data/lib/devdraft/api/payment_intents_api.rb +62 -40
- data/lib/devdraft/api/payment_links_api.rb +85 -49
- data/lib/devdraft/api/products_api.rb +214 -216
- data/lib/devdraft/api/taxes_api.rb +257 -66
- data/lib/devdraft/api/test_payments_api.rb +70 -44
- data/lib/devdraft/api/transfers_api.rb +206 -46
- data/lib/devdraft/api/wallets_api.rb +18 -9
- data/lib/devdraft/api/webhooks_api.rb +109 -66
- data/lib/devdraft/api_client.rb +76 -71
- data/lib/devdraft/api_error.rb +5 -4
- data/lib/devdraft/api_model_base.rb +88 -0
- data/lib/devdraft/configuration.rb +121 -18
- data/lib/devdraft/models/aggregated_balance_response.rb +68 -101
- data/lib/devdraft/models/all_balances_response.rb +76 -99
- data/lib/devdraft/models/bridge_fiat_payment_rail.rb +45 -0
- data/lib/devdraft/models/bridge_payment_rail.rb +36 -24
- data/lib/devdraft/models/create_bank_payment_intent_dto.rb +191 -114
- data/lib/devdraft/models/create_customer_dto.rb +123 -113
- data/lib/devdraft/models/create_direct_bank_transfer_dto.rb +105 -104
- data/lib/devdraft/models/create_direct_wallet_transfer_dto.rb +89 -100
- data/lib/devdraft/models/create_external_bank_transfer_dto.rb +505 -0
- data/lib/devdraft/models/create_external_stablecoin_transfer_dto.rb +266 -0
- data/lib/devdraft/models/create_invoice_dto.rb +151 -121
- data/lib/devdraft/models/create_liquidation_address_dto.rb +195 -115
- data/lib/devdraft/models/create_payment_link_dto.rb +192 -214
- data/lib/devdraft/models/create_stable_payment_intent_dto.rb +324 -111
- data/lib/devdraft/models/create_stablecoin_conversion_dto.rb +102 -101
- data/lib/devdraft/models/create_tax_dto.rb +281 -0
- data/lib/devdraft/models/create_webhook_dto.rb +104 -101
- data/lib/devdraft/models/customer_status.rb +23 -10
- data/lib/devdraft/models/customer_type.rb +45 -0
- data/lib/devdraft/models/destination_currency.rb +27 -15
- data/lib/devdraft/models/exchange_rate_response_dto.rb +103 -102
- data/lib/devdraft/models/fiat_currency.rb +22 -10
- data/lib/devdraft/models/health_response_dto.rb +99 -106
- data/lib/devdraft/models/invoice_product_dto.rb +63 -98
- data/lib/devdraft/models/liquidation_address_response_dto.rb +147 -110
- data/lib/devdraft/models/payment_link_product_dto.rb +70 -98
- data/lib/devdraft/models/payment_request_dto.rb +77 -100
- data/lib/devdraft/models/payment_response_dto.rb +102 -101
- data/lib/devdraft/models/public_health_response_dto.rb +68 -101
- data/lib/devdraft/models/refund_response_dto.rb +102 -101
- data/lib/devdraft/models/stable_coin_currency.rb +21 -9
- data/lib/devdraft/models/tax_controller_create201_response.rb +201 -0
- data/lib/devdraft/models/tax_controller_delete_without_id400_response.rb +165 -0
- data/lib/devdraft/models/tax_controller_update_without_id400_response.rb +165 -0
- data/lib/devdraft/models/update_customer_dto.rb +117 -113
- data/lib/devdraft/models/update_tax_dto.rb +256 -0
- data/lib/devdraft/models/update_webhook_dto.rb +70 -101
- data/lib/devdraft/models/webhook_response_dto.rb +140 -103
- data/lib/devdraft/version.rb +6 -5
- data/lib/devdraft.rb +18 -27
- data/spec/api/api_health_api_spec.rb +10 -9
- data/spec/api/app_balances_api_spec.rb +11 -10
- data/spec/api/customers_api_spec.rb +25 -24
- data/spec/api/exchange_rates_api_spec.rb +11 -10
- data/spec/api/invoices_api_spec.rb +16 -15
- data/spec/api/liquidation_addresses_api_spec.rb +13 -12
- data/spec/api/payment_intents_api_spec.rb +12 -11
- data/spec/api/payment_links_api_spec.rb +14 -13
- data/spec/api/products_api_spec.rb +41 -40
- data/spec/api/taxes_api_spec.rb +51 -21
- data/spec/api/test_payments_api_spec.rb +14 -13
- data/spec/api/transfers_api_spec.rb +36 -13
- data/spec/api/wallets_api_spec.rb +9 -8
- data/spec/api/webhooks_api_spec.rb +20 -19
- data/spec/models/aggregated_balance_response_spec.rb +15 -19
- data/spec/models/all_balances_response_spec.rb +14 -18
- data/spec/models/bridge_fiat_payment_rail_spec.rb +30 -0
- data/spec/models/bridge_payment_rail_spec.rb +11 -15
- data/spec/models/create_bank_payment_intent_dto_spec.rb +29 -33
- data/spec/models/create_customer_dto_spec.rb +17 -25
- data/spec/models/create_direct_bank_transfer_dto_spec.rb +19 -23
- data/spec/models/create_direct_wallet_transfer_dto_spec.rb +15 -19
- data/spec/models/create_external_bank_transfer_dto_spec.rb +102 -0
- data/spec/models/create_external_stablecoin_transfer_dto_spec.rb +66 -0
- data/spec/models/create_invoice_dto_spec.rb +31 -35
- data/spec/models/create_liquidation_address_dto_spec.rb +28 -32
- data/spec/models/create_payment_link_dto_spec.rb +34 -76
- data/spec/models/create_stable_payment_intent_dto_spec.rb +26 -30
- data/spec/models/create_stablecoin_conversion_dto_spec.rb +16 -20
- data/spec/models/create_tax_dto_spec.rb +60 -0
- data/spec/models/create_webhook_dto_spec.rb +16 -20
- data/spec/models/customer_status_spec.rb +11 -15
- data/spec/models/customer_type_spec.rb +30 -0
- data/spec/models/destination_currency_spec.rb +11 -15
- data/spec/models/exchange_rate_response_dto_spec.rb +17 -21
- data/spec/models/fiat_currency_spec.rb +11 -15
- data/spec/models/health_response_dto_spec.rb +19 -23
- data/spec/models/invoice_product_dto_spec.rb +13 -17
- data/spec/models/liquidation_address_response_dto_spec.rb +25 -29
- data/spec/models/payment_link_product_dto_spec.rb +13 -17
- data/spec/models/payment_request_dto_spec.rb +15 -19
- data/spec/models/payment_response_dto_spec.rb +16 -20
- data/spec/models/public_health_response_dto_spec.rb +15 -19
- data/spec/models/refund_response_dto_spec.rb +16 -20
- data/spec/models/stable_coin_currency_spec.rb +11 -15
- data/spec/models/tax_controller_create201_response_spec.rb +72 -0
- data/spec/models/tax_controller_delete_without_id400_response_spec.rb +48 -0
- data/spec/models/tax_controller_update_without_id400_response_spec.rb +48 -0
- data/spec/models/update_customer_dto_spec.rb +17 -25
- data/spec/models/update_tax_dto_spec.rb +60 -0
- data/spec/models/update_webhook_dto_spec.rb +16 -20
- data/spec/models/webhook_response_dto_spec.rb +19 -23
- data/spec/spec_helper.rb +5 -4
- metadata +49 -116
- data/docs/AllOfAllBalancesResponseEurc.md +0 -9
- data/docs/AllOfAllBalancesResponseUsdc.md +0 -9
- data/docs/AllOfCreateBankPaymentIntentDtoDestinationCurrency.md +0 -6
- data/docs/AllOfCreateBankPaymentIntentDtoDestinationNetwork.md +0 -6
- data/docs/AllOfCreateBankPaymentIntentDtoSourceCurrency.md +0 -6
- data/docs/AllOfCreateBankPaymentIntentDtoSourcePaymentRail.md +0 -6
- data/docs/AllOfCreateCustomerDtoStatus.md +0 -6
- data/docs/AllOfCreateLiquidationAddressDtoDestinationCurrency.md +0 -6
- data/docs/AllOfCreateLiquidationAddressDtoDestinationPaymentRail.md +0 -6
- data/docs/AllOfCreateStablePaymentIntentDtoDestinationCurrency.md +0 -6
- data/docs/AllOfCreateStablePaymentIntentDtoDestinationNetwork.md +0 -6
- data/docs/AllOfCreateStablePaymentIntentDtoSourceCurrency.md +0 -6
- data/docs/AllOfCreateStablePaymentIntentDtoSourceNetwork.md +0 -6
- data/docs/AllOfUpdateCustomerDtoStatus.md +0 -6
- data/docs/CreateProductDto.md +0 -18
- data/docs/CreateTaxInput.md +0 -6
- data/docs/UpdatePaymentLinkDto.md +0 -6
- data/docs/UpdatePreferenceInput.md +0 -6
- data/docs/UpdateProductDto.md +0 -18
- data/docs/UpdateTaxInput.md +0 -6
- data/example.rb +0 -129
- data/lib/devdraft/models/all_of_all_balances_response_eurc.rb +0 -283
- data/lib/devdraft/models/all_of_all_balances_response_usdc.rb +0 -283
- data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_destination_currency.rb +0 -202
- data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_destination_network.rb +0 -202
- data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_source_currency.rb +0 -202
- data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_source_payment_rail.rb +0 -202
- data/lib/devdraft/models/all_of_create_customer_dto_status.rb +0 -202
- data/lib/devdraft/models/all_of_create_liquidation_address_dto_destination_currency.rb +0 -202
- data/lib/devdraft/models/all_of_create_liquidation_address_dto_destination_payment_rail.rb +0 -202
- data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_destination_currency.rb +0 -202
- data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_destination_network.rb +0 -202
- data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_source_currency.rb +0 -202
- data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_source_network.rb +0 -202
- data/lib/devdraft/models/all_of_update_customer_dto_status.rb +0 -202
- data/lib/devdraft/models/create_product_dto.rb +0 -370
- data/lib/devdraft/models/create_tax_input.rb +0 -197
- data/lib/devdraft/models/update_payment_link_dto.rb +0 -197
- data/lib/devdraft/models/update_preference_input.rb +0 -197
- data/lib/devdraft/models/update_product_dto.rb +0 -355
- data/lib/devdraft/models/update_tax_input.rb +0 -197
- data/spec/api_client_spec.rb +0 -225
- data/spec/base_object_spec.rb +0 -109
- data/spec/configuration_spec.rb +0 -41
- data/spec/models/all_of_all_balances_response_eurc_spec.rb +0 -56
- data/spec/models/all_of_all_balances_response_usdc_spec.rb +0 -56
- data/spec/models/all_of_create_bank_payment_intent_dto_destination_currency_spec.rb +0 -34
- data/spec/models/all_of_create_bank_payment_intent_dto_destination_network_spec.rb +0 -34
- data/spec/models/all_of_create_bank_payment_intent_dto_source_currency_spec.rb +0 -34
- data/spec/models/all_of_create_bank_payment_intent_dto_source_payment_rail_spec.rb +0 -34
- data/spec/models/all_of_create_customer_dto_status_spec.rb +0 -34
- data/spec/models/all_of_create_liquidation_address_dto_destination_currency_spec.rb +0 -34
- data/spec/models/all_of_create_liquidation_address_dto_destination_payment_rail_spec.rb +0 -34
- data/spec/models/all_of_create_stable_payment_intent_dto_destination_currency_spec.rb +0 -34
- data/spec/models/all_of_create_stable_payment_intent_dto_destination_network_spec.rb +0 -34
- data/spec/models/all_of_create_stable_payment_intent_dto_source_currency_spec.rb +0 -34
- data/spec/models/all_of_create_stable_payment_intent_dto_source_network_spec.rb +0 -34
- data/spec/models/all_of_update_customer_dto_status_spec.rb +0 -34
- data/spec/models/create_product_dto_spec.rb +0 -110
- data/spec/models/create_tax_input_spec.rb +0 -34
- data/spec/models/update_payment_link_dto_spec.rb +0 -34
- data/spec/models/update_preference_input_spec.rb +0 -34
- data/spec/models/update_product_dto_spec.rb +0 -110
- data/spec/models/update_tax_input_spec.rb +0 -34
|
@@ -3,16 +3,18 @@
|
|
|
3
3
|
|
|
4
4
|
# A comprehensive payment processing and business management API that enables seamless integration of cryptocurrency and traditional payment methods.
|
|
5
5
|
|
|
6
|
-
OpenAPI
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.17.0
|
|
7
10
|
|
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
-
Swagger Codegen version: 3.0.65
|
|
10
11
|
=end
|
|
11
12
|
|
|
12
13
|
require 'date'
|
|
14
|
+
require 'time'
|
|
13
15
|
|
|
14
|
-
module
|
|
15
|
-
class CreatePaymentLinkDto
|
|
16
|
+
module Devdraft
|
|
17
|
+
class CreatePaymentLinkDto < ApiModelBase
|
|
16
18
|
# Display title for the payment link. This appears on the checkout page and in customer communications.
|
|
17
19
|
attr_accessor :title
|
|
18
20
|
|
|
@@ -34,9 +36,6 @@ module DevDraftAI
|
|
|
34
36
|
# Payment for ID
|
|
35
37
|
attr_accessor :payment_for_id
|
|
36
38
|
|
|
37
|
-
# Recurring type
|
|
38
|
-
attr_accessor :recurring_type
|
|
39
|
-
|
|
40
39
|
# Customer ID
|
|
41
40
|
attr_accessor :customer_id
|
|
42
41
|
|
|
@@ -58,9 +57,6 @@ module DevDraftAI
|
|
|
58
57
|
# Whether to collect address
|
|
59
58
|
attr_accessor :collect_address
|
|
60
59
|
|
|
61
|
-
# Whether to require phone number
|
|
62
|
-
attr_accessor :require_phone_number
|
|
63
|
-
|
|
64
60
|
# Whether to limit payments
|
|
65
61
|
attr_accessor :limit_payments
|
|
66
62
|
|
|
@@ -70,18 +66,9 @@ module DevDraftAI
|
|
|
70
66
|
# Custom fields
|
|
71
67
|
attr_accessor :custom_fields
|
|
72
68
|
|
|
73
|
-
# Whether to allow business tax ID
|
|
74
|
-
attr_accessor :allow_business_tax_id
|
|
75
|
-
|
|
76
69
|
# Whether to allow mobile payment
|
|
77
70
|
attr_accessor :allow_mobile_payment
|
|
78
71
|
|
|
79
|
-
# Confirmation page type
|
|
80
|
-
attr_accessor :confirmation_page
|
|
81
|
-
|
|
82
|
-
# Whether to create invoice PDF
|
|
83
|
-
attr_accessor :create_invoice_pdf
|
|
84
|
-
|
|
85
72
|
# Currency
|
|
86
73
|
attr_accessor :currency
|
|
87
74
|
|
|
@@ -120,7 +107,6 @@ module DevDraftAI
|
|
|
120
107
|
:'link_type' => :'linkType',
|
|
121
108
|
:'amount' => :'amount',
|
|
122
109
|
:'payment_for_id' => :'paymentForId',
|
|
123
|
-
:'recurring_type' => :'recurringType',
|
|
124
110
|
:'customer_id' => :'customerId',
|
|
125
111
|
:'payment_link_products' => :'paymentLinkProducts',
|
|
126
112
|
:'is_for_all_product' => :'isForAllProduct',
|
|
@@ -128,47 +114,48 @@ module DevDraftAI
|
|
|
128
114
|
:'collect_tax' => :'collectTax',
|
|
129
115
|
:'tax_id' => :'taxId',
|
|
130
116
|
:'collect_address' => :'collectAddress',
|
|
131
|
-
:'require_phone_number' => :'requirePhoneNumber',
|
|
132
117
|
:'limit_payments' => :'limitPayments',
|
|
133
118
|
:'max_payments' => :'maxPayments',
|
|
134
119
|
:'custom_fields' => :'customFields',
|
|
135
|
-
:'allow_business_tax_id' => :'allowBusinessTaxId',
|
|
136
120
|
:'allow_mobile_payment' => :'allowMobilePayment',
|
|
137
|
-
:'confirmation_page' => :'confirmationPage',
|
|
138
|
-
:'create_invoice_pdf' => :'createInvoicePdf',
|
|
139
121
|
:'currency' => :'currency',
|
|
140
122
|
:'expiration_date' => :'expiration_date'
|
|
141
123
|
}
|
|
142
124
|
end
|
|
143
125
|
|
|
126
|
+
# Returns attribute mapping this model knows about
|
|
127
|
+
def self.acceptable_attribute_map
|
|
128
|
+
attribute_map
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Returns all the JSON keys this model knows about
|
|
132
|
+
def self.acceptable_attributes
|
|
133
|
+
acceptable_attribute_map.values
|
|
134
|
+
end
|
|
135
|
+
|
|
144
136
|
# Attribute type mapping.
|
|
145
137
|
def self.openapi_types
|
|
146
138
|
{
|
|
147
|
-
:'title' => :'
|
|
148
|
-
:'url' => :'
|
|
149
|
-
:'description' => :'
|
|
150
|
-
:'cover_image' => :'
|
|
151
|
-
:'link_type' => :'
|
|
152
|
-
:'amount' => :'
|
|
153
|
-
:'payment_for_id' => :'
|
|
154
|
-
:'
|
|
155
|
-
:'
|
|
156
|
-
:'
|
|
157
|
-
:'
|
|
158
|
-
:'
|
|
159
|
-
:'
|
|
160
|
-
:'
|
|
161
|
-
:'
|
|
162
|
-
:'
|
|
163
|
-
:'limit_payments' => :'Object',
|
|
164
|
-
:'max_payments' => :'Object',
|
|
139
|
+
:'title' => :'String',
|
|
140
|
+
:'url' => :'String',
|
|
141
|
+
:'description' => :'String',
|
|
142
|
+
:'cover_image' => :'String',
|
|
143
|
+
:'link_type' => :'String',
|
|
144
|
+
:'amount' => :'Float',
|
|
145
|
+
:'payment_for_id' => :'String',
|
|
146
|
+
:'customer_id' => :'String',
|
|
147
|
+
:'payment_link_products' => :'Array<PaymentLinkProductDto>',
|
|
148
|
+
:'is_for_all_product' => :'Boolean',
|
|
149
|
+
:'allow_quantity_adjustment' => :'Boolean',
|
|
150
|
+
:'collect_tax' => :'Boolean',
|
|
151
|
+
:'tax_id' => :'String',
|
|
152
|
+
:'collect_address' => :'Boolean',
|
|
153
|
+
:'limit_payments' => :'Boolean',
|
|
154
|
+
:'max_payments' => :'Float',
|
|
165
155
|
:'custom_fields' => :'Object',
|
|
166
|
-
:'
|
|
167
|
-
:'
|
|
168
|
-
:'
|
|
169
|
-
:'create_invoice_pdf' => :'Object',
|
|
170
|
-
:'currency' => :'Object',
|
|
171
|
-
:'expiration_date' => :'Object'
|
|
156
|
+
:'allow_mobile_payment' => :'Boolean',
|
|
157
|
+
:'currency' => :'String',
|
|
158
|
+
:'expiration_date' => :'Time'
|
|
172
159
|
}
|
|
173
160
|
end
|
|
174
161
|
|
|
@@ -177,28 +164,33 @@ module DevDraftAI
|
|
|
177
164
|
Set.new([
|
|
178
165
|
])
|
|
179
166
|
end
|
|
180
|
-
|
|
167
|
+
|
|
181
168
|
# Initializes the object
|
|
182
169
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
183
170
|
def initialize(attributes = {})
|
|
184
171
|
if (!attributes.is_a?(Hash))
|
|
185
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
|
172
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Devdraft::CreatePaymentLinkDto` initialize method"
|
|
186
173
|
end
|
|
187
174
|
|
|
188
175
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
176
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
189
177
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
190
|
-
if (!
|
|
191
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
|
178
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
179
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Devdraft::CreatePaymentLinkDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
192
180
|
end
|
|
193
181
|
h[k.to_sym] = v
|
|
194
182
|
}
|
|
195
183
|
|
|
196
184
|
if attributes.key?(:'title')
|
|
197
185
|
self.title = attributes[:'title']
|
|
186
|
+
else
|
|
187
|
+
self.title = nil
|
|
198
188
|
end
|
|
199
189
|
|
|
200
190
|
if attributes.key?(:'url')
|
|
201
191
|
self.url = attributes[:'url']
|
|
192
|
+
else
|
|
193
|
+
self.url = nil
|
|
202
194
|
end
|
|
203
195
|
|
|
204
196
|
if attributes.key?(:'description')
|
|
@@ -211,6 +203,8 @@ module DevDraftAI
|
|
|
211
203
|
|
|
212
204
|
if attributes.key?(:'link_type')
|
|
213
205
|
self.link_type = attributes[:'link_type']
|
|
206
|
+
else
|
|
207
|
+
self.link_type = nil
|
|
214
208
|
end
|
|
215
209
|
|
|
216
210
|
if attributes.key?(:'amount')
|
|
@@ -221,12 +215,6 @@ module DevDraftAI
|
|
|
221
215
|
self.payment_for_id = attributes[:'payment_for_id']
|
|
222
216
|
end
|
|
223
217
|
|
|
224
|
-
if attributes.key?(:'recurring_type')
|
|
225
|
-
self.recurring_type = attributes[:'recurring_type']
|
|
226
|
-
else
|
|
227
|
-
self.recurring_type = 'ONE_TIME'
|
|
228
|
-
end
|
|
229
|
-
|
|
230
218
|
if attributes.key?(:'customer_id')
|
|
231
219
|
self.customer_id = attributes[:'customer_id']
|
|
232
220
|
end
|
|
@@ -265,12 +253,6 @@ module DevDraftAI
|
|
|
265
253
|
self.collect_address = false
|
|
266
254
|
end
|
|
267
255
|
|
|
268
|
-
if attributes.key?(:'require_phone_number')
|
|
269
|
-
self.require_phone_number = attributes[:'require_phone_number']
|
|
270
|
-
else
|
|
271
|
-
self.require_phone_number = false
|
|
272
|
-
end
|
|
273
|
-
|
|
274
256
|
if attributes.key?(:'limit_payments')
|
|
275
257
|
self.limit_payments = attributes[:'limit_payments']
|
|
276
258
|
else
|
|
@@ -285,30 +267,12 @@ module DevDraftAI
|
|
|
285
267
|
self.custom_fields = attributes[:'custom_fields']
|
|
286
268
|
end
|
|
287
269
|
|
|
288
|
-
if attributes.key?(:'allow_business_tax_id')
|
|
289
|
-
self.allow_business_tax_id = attributes[:'allow_business_tax_id']
|
|
290
|
-
else
|
|
291
|
-
self.allow_business_tax_id = false
|
|
292
|
-
end
|
|
293
|
-
|
|
294
270
|
if attributes.key?(:'allow_mobile_payment')
|
|
295
271
|
self.allow_mobile_payment = attributes[:'allow_mobile_payment']
|
|
296
272
|
else
|
|
297
273
|
self.allow_mobile_payment = false
|
|
298
274
|
end
|
|
299
275
|
|
|
300
|
-
if attributes.key?(:'confirmation_page')
|
|
301
|
-
self.confirmation_page = attributes[:'confirmation_page']
|
|
302
|
-
else
|
|
303
|
-
self.confirmation_page = 'SHOW'
|
|
304
|
-
end
|
|
305
|
-
|
|
306
|
-
if attributes.key?(:'create_invoice_pdf')
|
|
307
|
-
self.create_invoice_pdf = attributes[:'create_invoice_pdf']
|
|
308
|
-
else
|
|
309
|
-
self.create_invoice_pdf = false
|
|
310
|
-
end
|
|
311
|
-
|
|
312
276
|
if attributes.key?(:'currency')
|
|
313
277
|
self.currency = attributes[:'currency']
|
|
314
278
|
else
|
|
@@ -323,21 +287,34 @@ module DevDraftAI
|
|
|
323
287
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
324
288
|
# @return Array for valid properties with the reasons
|
|
325
289
|
def list_invalid_properties
|
|
290
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
326
291
|
invalid_properties = Array.new
|
|
327
292
|
if @title.nil?
|
|
328
293
|
invalid_properties.push('invalid value for "title", title cannot be nil.')
|
|
329
294
|
end
|
|
330
295
|
|
|
296
|
+
if @title.to_s.length > 100
|
|
297
|
+
invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 100.')
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
if @title.to_s.length < 3
|
|
301
|
+
invalid_properties.push('invalid value for "title", the character length must be greater than or equal to 3.')
|
|
302
|
+
end
|
|
303
|
+
|
|
331
304
|
if @url.nil?
|
|
332
305
|
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
|
333
306
|
end
|
|
334
307
|
|
|
308
|
+
if !@description.nil? && @description.to_s.length > 500
|
|
309
|
+
invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 500.')
|
|
310
|
+
end
|
|
311
|
+
|
|
335
312
|
if @link_type.nil?
|
|
336
313
|
invalid_properties.push('invalid value for "link_type", link_type cannot be nil.')
|
|
337
314
|
end
|
|
338
315
|
|
|
339
|
-
if
|
|
340
|
-
invalid_properties.push('invalid value for "
|
|
316
|
+
if !@amount.nil? && @amount < 0.01
|
|
317
|
+
invalid_properties.push('invalid value for "amount", must be greater than or equal to 0.01.')
|
|
341
318
|
end
|
|
342
319
|
|
|
343
320
|
if @allow_quantity_adjustment.nil?
|
|
@@ -352,22 +329,14 @@ module DevDraftAI
|
|
|
352
329
|
invalid_properties.push('invalid value for "collect_address", collect_address cannot be nil.')
|
|
353
330
|
end
|
|
354
331
|
|
|
355
|
-
if
|
|
356
|
-
invalid_properties.push('invalid value for "
|
|
332
|
+
if !@max_payments.nil? && @max_payments < 1
|
|
333
|
+
invalid_properties.push('invalid value for "max_payments", must be greater than or equal to 1.')
|
|
357
334
|
end
|
|
358
335
|
|
|
359
336
|
if @allow_mobile_payment.nil?
|
|
360
337
|
invalid_properties.push('invalid value for "allow_mobile_payment", allow_mobile_payment cannot be nil.')
|
|
361
338
|
end
|
|
362
339
|
|
|
363
|
-
if @confirmation_page.nil?
|
|
364
|
-
invalid_properties.push('invalid value for "confirmation_page", confirmation_page cannot be nil.')
|
|
365
|
-
end
|
|
366
|
-
|
|
367
|
-
if @create_invoice_pdf.nil?
|
|
368
|
-
invalid_properties.push('invalid value for "create_invoice_pdf", create_invoice_pdf cannot be nil.')
|
|
369
|
-
end
|
|
370
|
-
|
|
371
340
|
if @currency.nil?
|
|
372
341
|
invalid_properties.push('invalid value for "currency", currency cannot be nil.')
|
|
373
342
|
end
|
|
@@ -378,63 +347,151 @@ module DevDraftAI
|
|
|
378
347
|
# Check to see if the all the properties in the model are valid
|
|
379
348
|
# @return true if the model is valid
|
|
380
349
|
def valid?
|
|
350
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
381
351
|
return false if @title.nil?
|
|
352
|
+
return false if @title.to_s.length > 100
|
|
353
|
+
return false if @title.to_s.length < 3
|
|
382
354
|
return false if @url.nil?
|
|
355
|
+
return false if !@description.nil? && @description.to_s.length > 500
|
|
383
356
|
return false if @link_type.nil?
|
|
384
|
-
link_type_validator = EnumAttributeValidator.new('
|
|
357
|
+
link_type_validator = EnumAttributeValidator.new('String', ["INVOICE", "PRODUCT", "COLLECTION", "DONATION"])
|
|
385
358
|
return false unless link_type_validator.valid?(@link_type)
|
|
386
|
-
return false if
|
|
387
|
-
recurring_type_validator = EnumAttributeValidator.new('Object', ['ONE_TIME', 'WEEKLY', 'BI_WEEKLY', 'MONTHLY', 'BI_MONTHLY', 'QUARTERLY', 'ANNUALLY'])
|
|
388
|
-
return false unless recurring_type_validator.valid?(@recurring_type)
|
|
359
|
+
return false if !@amount.nil? && @amount < 0.01
|
|
389
360
|
return false if @allow_quantity_adjustment.nil?
|
|
390
361
|
return false if @collect_tax.nil?
|
|
391
362
|
return false if @collect_address.nil?
|
|
392
|
-
return false if
|
|
363
|
+
return false if !@max_payments.nil? && @max_payments < 1
|
|
393
364
|
return false if @allow_mobile_payment.nil?
|
|
394
|
-
return false if @confirmation_page.nil?
|
|
395
|
-
confirmation_page_validator = EnumAttributeValidator.new('Object', ['SHOW', 'REDIRECT'])
|
|
396
|
-
return false unless confirmation_page_validator.valid?(@confirmation_page)
|
|
397
|
-
return false if @create_invoice_pdf.nil?
|
|
398
365
|
return false if @currency.nil?
|
|
399
|
-
currency_validator = EnumAttributeValidator.new('
|
|
366
|
+
currency_validator = EnumAttributeValidator.new('String', ["usdc", "eurc"])
|
|
400
367
|
return false unless currency_validator.valid?(@currency)
|
|
401
368
|
true
|
|
402
369
|
end
|
|
403
370
|
|
|
371
|
+
# Custom attribute writer method with validation
|
|
372
|
+
# @param [Object] title Value to be assigned
|
|
373
|
+
def title=(title)
|
|
374
|
+
if title.nil?
|
|
375
|
+
fail ArgumentError, 'title cannot be nil'
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
if title.to_s.length > 100
|
|
379
|
+
fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 100.'
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
if title.to_s.length < 3
|
|
383
|
+
fail ArgumentError, 'invalid value for "title", the character length must be greater than or equal to 3.'
|
|
384
|
+
end
|
|
385
|
+
|
|
386
|
+
@title = title
|
|
387
|
+
end
|
|
388
|
+
|
|
389
|
+
# Custom attribute writer method with validation
|
|
390
|
+
# @param [Object] url Value to be assigned
|
|
391
|
+
def url=(url)
|
|
392
|
+
if url.nil?
|
|
393
|
+
fail ArgumentError, 'url cannot be nil'
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
@url = url
|
|
397
|
+
end
|
|
398
|
+
|
|
399
|
+
# Custom attribute writer method with validation
|
|
400
|
+
# @param [Object] description Value to be assigned
|
|
401
|
+
def description=(description)
|
|
402
|
+
if description.nil?
|
|
403
|
+
fail ArgumentError, 'description cannot be nil'
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
if description.to_s.length > 500
|
|
407
|
+
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 500.'
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
@description = description
|
|
411
|
+
end
|
|
412
|
+
|
|
404
413
|
# Custom attribute writer method checking allowed values (enum).
|
|
405
414
|
# @param [Object] link_type Object to be assigned
|
|
406
415
|
def link_type=(link_type)
|
|
407
|
-
validator = EnumAttributeValidator.new('
|
|
416
|
+
validator = EnumAttributeValidator.new('String', ["INVOICE", "PRODUCT", "COLLECTION", "DONATION"])
|
|
408
417
|
unless validator.valid?(link_type)
|
|
409
418
|
fail ArgumentError, "invalid value for \"link_type\", must be one of #{validator.allowable_values}."
|
|
410
419
|
end
|
|
411
420
|
@link_type = link_type
|
|
412
421
|
end
|
|
413
422
|
|
|
414
|
-
# Custom attribute writer method
|
|
415
|
-
# @param [Object]
|
|
416
|
-
def
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
fail ArgumentError, "invalid value for \"recurring_type\", must be one of #{validator.allowable_values}."
|
|
423
|
+
# Custom attribute writer method with validation
|
|
424
|
+
# @param [Object] amount Value to be assigned
|
|
425
|
+
def amount=(amount)
|
|
426
|
+
if amount.nil?
|
|
427
|
+
fail ArgumentError, 'amount cannot be nil'
|
|
420
428
|
end
|
|
421
|
-
|
|
429
|
+
|
|
430
|
+
if amount < 0.01
|
|
431
|
+
fail ArgumentError, 'invalid value for "amount", must be greater than or equal to 0.01.'
|
|
432
|
+
end
|
|
433
|
+
|
|
434
|
+
@amount = amount
|
|
422
435
|
end
|
|
423
436
|
|
|
424
|
-
# Custom attribute writer method
|
|
425
|
-
# @param [Object]
|
|
426
|
-
def
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
437
|
+
# Custom attribute writer method with validation
|
|
438
|
+
# @param [Object] allow_quantity_adjustment Value to be assigned
|
|
439
|
+
def allow_quantity_adjustment=(allow_quantity_adjustment)
|
|
440
|
+
if allow_quantity_adjustment.nil?
|
|
441
|
+
fail ArgumentError, 'allow_quantity_adjustment cannot be nil'
|
|
442
|
+
end
|
|
443
|
+
|
|
444
|
+
@allow_quantity_adjustment = allow_quantity_adjustment
|
|
445
|
+
end
|
|
446
|
+
|
|
447
|
+
# Custom attribute writer method with validation
|
|
448
|
+
# @param [Object] collect_tax Value to be assigned
|
|
449
|
+
def collect_tax=(collect_tax)
|
|
450
|
+
if collect_tax.nil?
|
|
451
|
+
fail ArgumentError, 'collect_tax cannot be nil'
|
|
430
452
|
end
|
|
431
|
-
|
|
453
|
+
|
|
454
|
+
@collect_tax = collect_tax
|
|
455
|
+
end
|
|
456
|
+
|
|
457
|
+
# Custom attribute writer method with validation
|
|
458
|
+
# @param [Object] collect_address Value to be assigned
|
|
459
|
+
def collect_address=(collect_address)
|
|
460
|
+
if collect_address.nil?
|
|
461
|
+
fail ArgumentError, 'collect_address cannot be nil'
|
|
462
|
+
end
|
|
463
|
+
|
|
464
|
+
@collect_address = collect_address
|
|
465
|
+
end
|
|
466
|
+
|
|
467
|
+
# Custom attribute writer method with validation
|
|
468
|
+
# @param [Object] max_payments Value to be assigned
|
|
469
|
+
def max_payments=(max_payments)
|
|
470
|
+
if max_payments.nil?
|
|
471
|
+
fail ArgumentError, 'max_payments cannot be nil'
|
|
472
|
+
end
|
|
473
|
+
|
|
474
|
+
if max_payments < 1
|
|
475
|
+
fail ArgumentError, 'invalid value for "max_payments", must be greater than or equal to 1.'
|
|
476
|
+
end
|
|
477
|
+
|
|
478
|
+
@max_payments = max_payments
|
|
479
|
+
end
|
|
480
|
+
|
|
481
|
+
# Custom attribute writer method with validation
|
|
482
|
+
# @param [Object] allow_mobile_payment Value to be assigned
|
|
483
|
+
def allow_mobile_payment=(allow_mobile_payment)
|
|
484
|
+
if allow_mobile_payment.nil?
|
|
485
|
+
fail ArgumentError, 'allow_mobile_payment cannot be nil'
|
|
486
|
+
end
|
|
487
|
+
|
|
488
|
+
@allow_mobile_payment = allow_mobile_payment
|
|
432
489
|
end
|
|
433
490
|
|
|
434
491
|
# Custom attribute writer method checking allowed values (enum).
|
|
435
492
|
# @param [Object] currency Object to be assigned
|
|
436
493
|
def currency=(currency)
|
|
437
|
-
validator = EnumAttributeValidator.new('
|
|
494
|
+
validator = EnumAttributeValidator.new('String', ["usdc", "eurc"])
|
|
438
495
|
unless validator.valid?(currency)
|
|
439
496
|
fail ArgumentError, "invalid value for \"currency\", must be one of #{validator.allowable_values}."
|
|
440
497
|
end
|
|
@@ -453,7 +510,6 @@ module DevDraftAI
|
|
|
453
510
|
link_type == o.link_type &&
|
|
454
511
|
amount == o.amount &&
|
|
455
512
|
payment_for_id == o.payment_for_id &&
|
|
456
|
-
recurring_type == o.recurring_type &&
|
|
457
513
|
customer_id == o.customer_id &&
|
|
458
514
|
payment_link_products == o.payment_link_products &&
|
|
459
515
|
is_for_all_product == o.is_for_all_product &&
|
|
@@ -461,14 +517,10 @@ module DevDraftAI
|
|
|
461
517
|
collect_tax == o.collect_tax &&
|
|
462
518
|
tax_id == o.tax_id &&
|
|
463
519
|
collect_address == o.collect_address &&
|
|
464
|
-
require_phone_number == o.require_phone_number &&
|
|
465
520
|
limit_payments == o.limit_payments &&
|
|
466
521
|
max_payments == o.max_payments &&
|
|
467
522
|
custom_fields == o.custom_fields &&
|
|
468
|
-
allow_business_tax_id == o.allow_business_tax_id &&
|
|
469
523
|
allow_mobile_payment == o.allow_mobile_payment &&
|
|
470
|
-
confirmation_page == o.confirmation_page &&
|
|
471
|
-
create_invoice_pdf == o.create_invoice_pdf &&
|
|
472
524
|
currency == o.currency &&
|
|
473
525
|
expiration_date == o.expiration_date
|
|
474
526
|
end
|
|
@@ -482,89 +534,30 @@ module DevDraftAI
|
|
|
482
534
|
# Calculates hash code according to all attributes.
|
|
483
535
|
# @return [Integer] Hash code
|
|
484
536
|
def hash
|
|
485
|
-
[title, url, description, cover_image, link_type, amount, payment_for_id,
|
|
537
|
+
[title, url, description, cover_image, link_type, amount, payment_for_id, customer_id, payment_link_products, is_for_all_product, allow_quantity_adjustment, collect_tax, tax_id, collect_address, limit_payments, max_payments, custom_fields, allow_mobile_payment, currency, expiration_date].hash
|
|
486
538
|
end
|
|
487
539
|
|
|
488
540
|
# Builds the object from hash
|
|
489
541
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
490
542
|
# @return [Object] Returns the model itself
|
|
491
543
|
def self.build_from_hash(attributes)
|
|
492
|
-
new.build_from_hash(attributes)
|
|
493
|
-
end
|
|
494
|
-
|
|
495
|
-
# Builds the object from hash
|
|
496
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
497
|
-
# @return [Object] Returns the model itself
|
|
498
|
-
def build_from_hash(attributes)
|
|
499
544
|
return nil unless attributes.is_a?(Hash)
|
|
500
|
-
|
|
501
|
-
|
|
545
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
546
|
+
transformed_hash = {}
|
|
547
|
+
openapi_types.each_pair do |key, type|
|
|
548
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
549
|
+
transformed_hash["#{key}"] = nil
|
|
550
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
502
551
|
# check to ensure the input is an array given that the attribute
|
|
503
552
|
# is documented as an array but the input is not
|
|
504
|
-
if attributes[
|
|
505
|
-
|
|
553
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
554
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
506
555
|
end
|
|
507
|
-
elsif !attributes[
|
|
508
|
-
|
|
509
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
510
|
-
self.send("#{key}=", nil)
|
|
556
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
557
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
511
558
|
end
|
|
512
559
|
end
|
|
513
|
-
|
|
514
|
-
self
|
|
515
|
-
end
|
|
516
|
-
|
|
517
|
-
# Deserializes the data based on type
|
|
518
|
-
# @param string type Data type
|
|
519
|
-
# @param string value Value to be deserialized
|
|
520
|
-
# @return [Object] Deserialized data
|
|
521
|
-
def _deserialize(type, value)
|
|
522
|
-
case type.to_sym
|
|
523
|
-
when :DateTime
|
|
524
|
-
DateTime.parse(value)
|
|
525
|
-
when :Date
|
|
526
|
-
Date.parse(value)
|
|
527
|
-
when :String
|
|
528
|
-
value.to_s
|
|
529
|
-
when :Integer
|
|
530
|
-
value.to_i
|
|
531
|
-
when :Float
|
|
532
|
-
value.to_f
|
|
533
|
-
when :Boolean
|
|
534
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
535
|
-
true
|
|
536
|
-
else
|
|
537
|
-
false
|
|
538
|
-
end
|
|
539
|
-
when :Object
|
|
540
|
-
# generic object (usually a Hash), return directly
|
|
541
|
-
value
|
|
542
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
543
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
544
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
545
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
546
|
-
k_type = Regexp.last_match[:k_type]
|
|
547
|
-
v_type = Regexp.last_match[:v_type]
|
|
548
|
-
{}.tap do |hash|
|
|
549
|
-
value.each do |k, v|
|
|
550
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
551
|
-
end
|
|
552
|
-
end
|
|
553
|
-
else # model
|
|
554
|
-
DevDraftAI.const_get(type).build_from_hash(value)
|
|
555
|
-
end
|
|
556
|
-
end
|
|
557
|
-
|
|
558
|
-
# Returns the string representation of the object
|
|
559
|
-
# @return [String] String presentation of the object
|
|
560
|
-
def to_s
|
|
561
|
-
to_hash.to_s
|
|
562
|
-
end
|
|
563
|
-
|
|
564
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
565
|
-
# @return [Hash] Returns the object in the form of hash
|
|
566
|
-
def to_body
|
|
567
|
-
to_hash
|
|
560
|
+
new(transformed_hash)
|
|
568
561
|
end
|
|
569
562
|
|
|
570
563
|
# Returns the object in the form of hash
|
|
@@ -583,21 +576,6 @@ module DevDraftAI
|
|
|
583
576
|
hash
|
|
584
577
|
end
|
|
585
578
|
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
# @param [Object] value Any valid value
|
|
589
|
-
# @return [Hash] Returns the value in the form of hash
|
|
590
|
-
def _to_hash(value)
|
|
591
|
-
if value.is_a?(Array)
|
|
592
|
-
value.compact.map { |v| _to_hash(v) }
|
|
593
|
-
elsif value.is_a?(Hash)
|
|
594
|
-
{}.tap do |hash|
|
|
595
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
596
|
-
end
|
|
597
|
-
elsif value.respond_to? :to_hash
|
|
598
|
-
value.to_hash
|
|
599
|
-
else
|
|
600
|
-
value
|
|
601
|
-
end
|
|
602
|
-
end end
|
|
579
|
+
end
|
|
580
|
+
|
|
603
581
|
end
|