turnkey_client 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +7 -0
- data/Rakefile +8 -0
- data/git_push.sh +55 -0
- data/lib/turnkey_client/api/activities_api.rb +136 -0
- data/lib/turnkey_client/api/api_keys_api.rb +252 -0
- data/lib/turnkey_client/api/authenticators_api.rb +252 -0
- data/lib/turnkey_client/api/consensus_api.rb +136 -0
- data/lib/turnkey_client/api/features_api.rb +136 -0
- data/lib/turnkey_client/api/invitations_api.rb +136 -0
- data/lib/turnkey_client/api/organizations_api.rb +194 -0
- data/lib/turnkey_client/api/policies_api.rb +310 -0
- data/lib/turnkey_client/api/private_key_tags_api.rb +194 -0
- data/lib/turnkey_client/api/private_keys_api.rb +252 -0
- data/lib/turnkey_client/api/public_api_service_api.rb +66 -0
- data/lib/turnkey_client/api/sessions_api.rb +78 -0
- data/lib/turnkey_client/api/signing_api.rb +136 -0
- data/lib/turnkey_client/api/user_auth_api.rb +78 -0
- data/lib/turnkey_client/api/user_recovery_api.rb +136 -0
- data/lib/turnkey_client/api/user_tags_api.rb +194 -0
- data/lib/turnkey_client/api/users_api.rb +310 -0
- data/lib/turnkey_client/api/wallets_api.rb +426 -0
- data/lib/turnkey_client/api_client.rb +446 -0
- data/lib/turnkey_client/api_error.rb +57 -0
- data/lib/turnkey_client/configuration.rb +216 -0
- data/lib/turnkey_client/models/datav1_tag.rb +269 -0
- data/lib/turnkey_client/models/externaldatav1_address.rb +215 -0
- data/lib/turnkey_client/models/externaldatav1_credential.rb +226 -0
- data/lib/turnkey_client/models/externaldatav1_quorum.rb +229 -0
- data/lib/turnkey_client/models/externaldatav1_timestamp.rb +225 -0
- data/lib/turnkey_client/models/immutableactivityv1_address.rb +215 -0
- data/lib/turnkey_client/models/protobuf_any.rb +201 -0
- data/lib/turnkey_client/models/rpc_status.rb +226 -0
- data/lib/turnkey_client/models/v1_accept_invitation_intent.rb +241 -0
- data/lib/turnkey_client/models/v1_accept_invitation_intent_v2.rb +241 -0
- data/lib/turnkey_client/models/v1_accept_invitation_result.rb +227 -0
- data/lib/turnkey_client/models/v1_access_type.rb +29 -0
- data/lib/turnkey_client/models/v1_activate_billing_tier_intent.rb +212 -0
- data/lib/turnkey_client/models/v1_activate_billing_tier_result.rb +212 -0
- data/lib/turnkey_client/models/v1_activity.rb +371 -0
- data/lib/turnkey_client/models/v1_activity_response.rb +211 -0
- data/lib/turnkey_client/models/v1_activity_status.rb +32 -0
- data/lib/turnkey_client/models/v1_activity_type.rb +83 -0
- data/lib/turnkey_client/models/v1_address_format.rb +31 -0
- data/lib/turnkey_client/models/v1_api_key.rb +279 -0
- data/lib/turnkey_client/models/v1_api_key_params.rb +237 -0
- data/lib/turnkey_client/models/v1_api_only_user_params.rb +256 -0
- data/lib/turnkey_client/models/v1_approve_activity_intent.rb +212 -0
- data/lib/turnkey_client/models/v1_approve_activity_request.rb +289 -0
- data/lib/turnkey_client/models/v1_attestation.rb +259 -0
- data/lib/turnkey_client/models/v1_authenticator.rb +345 -0
- data/lib/turnkey_client/models/v1_authenticator_attestation_response.rb +280 -0
- data/lib/turnkey_client/models/v1_authenticator_params.rb +256 -0
- data/lib/turnkey_client/models/v1_authenticator_params_v2.rb +241 -0
- data/lib/turnkey_client/models/v1_authenticator_transport.rb +31 -0
- data/lib/turnkey_client/models/v1_create_api_keys_intent.rb +229 -0
- data/lib/turnkey_client/models/v1_create_api_keys_request.rb +289 -0
- data/lib/turnkey_client/models/v1_create_api_keys_result.rb +214 -0
- data/lib/turnkey_client/models/v1_create_api_only_users_intent.rb +214 -0
- data/lib/turnkey_client/models/v1_create_api_only_users_request.rb +289 -0
- data/lib/turnkey_client/models/v1_create_api_only_users_result.rb +214 -0
- data/lib/turnkey_client/models/v1_create_authenticators_intent.rb +229 -0
- data/lib/turnkey_client/models/v1_create_authenticators_intent_v2.rb +229 -0
- data/lib/turnkey_client/models/v1_create_authenticators_request.rb +289 -0
- data/lib/turnkey_client/models/v1_create_authenticators_result.rb +214 -0
- data/lib/turnkey_client/models/v1_create_invitations_intent.rb +214 -0
- data/lib/turnkey_client/models/v1_create_invitations_request.rb +289 -0
- data/lib/turnkey_client/models/v1_create_invitations_result.rb +214 -0
- data/lib/turnkey_client/models/v1_create_organization_intent.rb +251 -0
- data/lib/turnkey_client/models/v1_create_organization_intent_v2.rb +251 -0
- data/lib/turnkey_client/models/v1_create_organization_result.rb +212 -0
- data/lib/turnkey_client/models/v1_create_policy_intent.rb +252 -0
- data/lib/turnkey_client/models/v1_create_policy_intent_v2.rb +252 -0
- data/lib/turnkey_client/models/v1_create_policy_intent_v3.rb +255 -0
- data/lib/turnkey_client/models/v1_create_policy_request.rb +289 -0
- data/lib/turnkey_client/models/v1_create_policy_result.rb +212 -0
- data/lib/turnkey_client/models/v1_create_private_key_tag_intent.rb +229 -0
- data/lib/turnkey_client/models/v1_create_private_key_tag_request.rb +289 -0
- data/lib/turnkey_client/models/v1_create_private_key_tag_result.rb +229 -0
- data/lib/turnkey_client/models/v1_create_private_keys_intent.rb +214 -0
- data/lib/turnkey_client/models/v1_create_private_keys_intent_v2.rb +214 -0
- data/lib/turnkey_client/models/v1_create_private_keys_request.rb +289 -0
- data/lib/turnkey_client/models/v1_create_private_keys_result.rb +214 -0
- data/lib/turnkey_client/models/v1_create_private_keys_result_v2.rb +214 -0
- data/lib/turnkey_client/models/v1_create_sub_organization_intent.rb +226 -0
- data/lib/turnkey_client/models/v1_create_sub_organization_intent_v2.rb +244 -0
- data/lib/turnkey_client/models/v1_create_sub_organization_intent_v3.rb +261 -0
- data/lib/turnkey_client/models/v1_create_sub_organization_intent_v4.rb +273 -0
- data/lib/turnkey_client/models/v1_create_sub_organization_request.rb +289 -0
- data/lib/turnkey_client/models/v1_create_sub_organization_result.rb +211 -0
- data/lib/turnkey_client/models/v1_create_sub_organization_result_v3.rb +228 -0
- data/lib/turnkey_client/models/v1_create_sub_organization_result_v4.rb +220 -0
- data/lib/turnkey_client/models/v1_create_user_tag_intent.rb +229 -0
- data/lib/turnkey_client/models/v1_create_user_tag_request.rb +289 -0
- data/lib/turnkey_client/models/v1_create_user_tag_result.rb +229 -0
- data/lib/turnkey_client/models/v1_create_users_intent.rb +214 -0
- data/lib/turnkey_client/models/v1_create_users_intent_v2.rb +214 -0
- data/lib/turnkey_client/models/v1_create_users_request.rb +289 -0
- data/lib/turnkey_client/models/v1_create_users_result.rb +214 -0
- data/lib/turnkey_client/models/v1_create_wallet_accounts_intent.rb +229 -0
- data/lib/turnkey_client/models/v1_create_wallet_accounts_request.rb +289 -0
- data/lib/turnkey_client/models/v1_create_wallet_accounts_result.rb +214 -0
- data/lib/turnkey_client/models/v1_create_wallet_intent.rb +239 -0
- data/lib/turnkey_client/models/v1_create_wallet_request.rb +289 -0
- data/lib/turnkey_client/models/v1_create_wallet_result.rb +229 -0
- data/lib/turnkey_client/models/v1_cred_props_authentication_extensions_client_outputs.rb +211 -0
- data/lib/turnkey_client/models/v1_credential_type.rb +29 -0
- data/lib/turnkey_client/models/v1_curve.rb +28 -0
- data/lib/turnkey_client/models/v1_delete_api_keys_intent.rb +229 -0
- data/lib/turnkey_client/models/v1_delete_api_keys_request.rb +289 -0
- data/lib/turnkey_client/models/v1_delete_api_keys_result.rb +214 -0
- data/lib/turnkey_client/models/v1_delete_authenticators_intent.rb +229 -0
- data/lib/turnkey_client/models/v1_delete_authenticators_request.rb +289 -0
- data/lib/turnkey_client/models/v1_delete_authenticators_result.rb +214 -0
- data/lib/turnkey_client/models/v1_delete_invitation_intent.rb +212 -0
- data/lib/turnkey_client/models/v1_delete_invitation_request.rb +289 -0
- data/lib/turnkey_client/models/v1_delete_invitation_result.rb +212 -0
- data/lib/turnkey_client/models/v1_delete_organization_intent.rb +212 -0
- data/lib/turnkey_client/models/v1_delete_organization_result.rb +212 -0
- data/lib/turnkey_client/models/v1_delete_payment_method_intent.rb +212 -0
- data/lib/turnkey_client/models/v1_delete_payment_method_result.rb +212 -0
- data/lib/turnkey_client/models/v1_delete_policy_intent.rb +212 -0
- data/lib/turnkey_client/models/v1_delete_policy_request.rb +289 -0
- data/lib/turnkey_client/models/v1_delete_policy_result.rb +212 -0
- data/lib/turnkey_client/models/v1_delete_private_key_tags_intent.rb +214 -0
- data/lib/turnkey_client/models/v1_delete_private_key_tags_result.rb +231 -0
- data/lib/turnkey_client/models/v1_delete_user_tags_intent.rb +214 -0
- data/lib/turnkey_client/models/v1_delete_user_tags_result.rb +231 -0
- data/lib/turnkey_client/models/v1_delete_users_intent.rb +214 -0
- data/lib/turnkey_client/models/v1_delete_users_result.rb +214 -0
- data/lib/turnkey_client/models/v1_disable_private_key_intent.rb +212 -0
- data/lib/turnkey_client/models/v1_disable_private_key_result.rb +212 -0
- data/lib/turnkey_client/models/v1_effect.rb +28 -0
- data/lib/turnkey_client/models/v1_email_auth_intent.rb +256 -0
- data/lib/turnkey_client/models/v1_email_auth_request.rb +289 -0
- data/lib/turnkey_client/models/v1_email_auth_result.rb +227 -0
- data/lib/turnkey_client/models/v1_email_customization.rb +233 -0
- data/lib/turnkey_client/models/v1_export_private_key_intent.rb +227 -0
- data/lib/turnkey_client/models/v1_export_private_key_request.rb +289 -0
- data/lib/turnkey_client/models/v1_export_private_key_result.rb +227 -0
- data/lib/turnkey_client/models/v1_export_wallet_account_intent.rb +227 -0
- data/lib/turnkey_client/models/v1_export_wallet_account_request.rb +289 -0
- data/lib/turnkey_client/models/v1_export_wallet_account_result.rb +227 -0
- data/lib/turnkey_client/models/v1_export_wallet_intent.rb +236 -0
- data/lib/turnkey_client/models/v1_export_wallet_request.rb +289 -0
- data/lib/turnkey_client/models/v1_export_wallet_result.rb +227 -0
- data/lib/turnkey_client/models/v1_feature.rb +215 -0
- data/lib/turnkey_client/models/v1_feature_name.rb +30 -0
- data/lib/turnkey_client/models/v1_get_activities_request.rb +245 -0
- data/lib/turnkey_client/models/v1_get_activities_response.rb +214 -0
- data/lib/turnkey_client/models/v1_get_activity_request.rb +227 -0
- data/lib/turnkey_client/models/v1_get_api_key_request.rb +227 -0
- data/lib/turnkey_client/models/v1_get_api_key_response.rb +211 -0
- data/lib/turnkey_client/models/v1_get_api_keys_request.rb +222 -0
- data/lib/turnkey_client/models/v1_get_api_keys_response.rb +214 -0
- data/lib/turnkey_client/models/v1_get_authenticator_request.rb +227 -0
- data/lib/turnkey_client/models/v1_get_authenticator_response.rb +211 -0
- data/lib/turnkey_client/models/v1_get_authenticators_request.rb +227 -0
- data/lib/turnkey_client/models/v1_get_authenticators_response.rb +214 -0
- data/lib/turnkey_client/models/v1_get_organization_request.rb +212 -0
- data/lib/turnkey_client/models/v1_get_organization_response.rb +211 -0
- data/lib/turnkey_client/models/v1_get_policies_request.rb +212 -0
- data/lib/turnkey_client/models/v1_get_policies_response.rb +214 -0
- data/lib/turnkey_client/models/v1_get_policy_request.rb +227 -0
- data/lib/turnkey_client/models/v1_get_policy_response.rb +211 -0
- data/lib/turnkey_client/models/v1_get_private_key_request.rb +227 -0
- data/lib/turnkey_client/models/v1_get_private_key_response.rb +211 -0
- data/lib/turnkey_client/models/v1_get_private_keys_request.rb +212 -0
- data/lib/turnkey_client/models/v1_get_private_keys_response.rb +214 -0
- data/lib/turnkey_client/models/v1_get_user_request.rb +227 -0
- data/lib/turnkey_client/models/v1_get_user_response.rb +211 -0
- data/lib/turnkey_client/models/v1_get_users_request.rb +212 -0
- data/lib/turnkey_client/models/v1_get_users_response.rb +214 -0
- data/lib/turnkey_client/models/v1_get_wallet_accounts_request.rb +227 -0
- data/lib/turnkey_client/models/v1_get_wallet_accounts_response.rb +214 -0
- data/lib/turnkey_client/models/v1_get_wallet_request.rb +227 -0
- data/lib/turnkey_client/models/v1_get_wallet_response.rb +211 -0
- data/lib/turnkey_client/models/v1_get_wallets_request.rb +212 -0
- data/lib/turnkey_client/models/v1_get_wallets_response.rb +214 -0
- data/lib/turnkey_client/models/v1_get_whoami_request.rb +212 -0
- data/lib/turnkey_client/models/v1_get_whoami_response.rb +257 -0
- data/lib/turnkey_client/models/v1_hash_function.rb +30 -0
- data/lib/turnkey_client/models/v1_init_user_email_recovery_intent.rb +237 -0
- data/lib/turnkey_client/models/v1_init_user_email_recovery_request.rb +289 -0
- data/lib/turnkey_client/models/v1_init_user_email_recovery_result.rb +212 -0
- data/lib/turnkey_client/models/v1_intent.rb +715 -0
- data/lib/turnkey_client/models/v1_invitation.rb +330 -0
- data/lib/turnkey_client/models/v1_invitation_params.rb +273 -0
- data/lib/turnkey_client/models/v1_invitation_status.rb +29 -0
- data/lib/turnkey_client/models/v1_list_private_key_tags_request.rb +212 -0
- data/lib/turnkey_client/models/v1_list_private_key_tags_response.rb +214 -0
- data/lib/turnkey_client/models/v1_list_user_tags_request.rb +212 -0
- data/lib/turnkey_client/models/v1_list_user_tags_response.rb +214 -0
- data/lib/turnkey_client/models/v1_mnemonic_language.rb +35 -0
- data/lib/turnkey_client/models/v1_noop_codegen_anchor_response.rb +211 -0
- data/lib/turnkey_client/models/v1_operator.rb +37 -0
- data/lib/turnkey_client/models/v1_organization_data.rb +301 -0
- data/lib/turnkey_client/models/v1_pagination.rb +227 -0
- data/lib/turnkey_client/models/v1_path_format.rb +27 -0
- data/lib/turnkey_client/models/v1_payload_encoding.rb +28 -0
- data/lib/turnkey_client/models/v1_policy.rb +314 -0
- data/lib/turnkey_client/models/v1_private_key.rb +333 -0
- data/lib/turnkey_client/models/v1_private_key_params.rb +260 -0
- data/lib/turnkey_client/models/v1_private_key_result.rb +217 -0
- data/lib/turnkey_client/models/v1_public_key_credential_with_attestation.rb +323 -0
- data/lib/turnkey_client/models/v1_recover_user_intent.rb +226 -0
- data/lib/turnkey_client/models/v1_recover_user_request.rb +289 -0
- data/lib/turnkey_client/models/v1_recover_user_result.rb +214 -0
- data/lib/turnkey_client/models/v1_reject_activity_intent.rb +212 -0
- data/lib/turnkey_client/models/v1_reject_activity_request.rb +289 -0
- data/lib/turnkey_client/models/v1_remove_organization_feature_intent.rb +211 -0
- data/lib/turnkey_client/models/v1_remove_organization_feature_request.rb +289 -0
- data/lib/turnkey_client/models/v1_remove_organization_feature_result.rb +214 -0
- data/lib/turnkey_client/models/v1_result.rb +602 -0
- data/lib/turnkey_client/models/v1_root_user_params.rb +256 -0
- data/lib/turnkey_client/models/v1_selector.rb +224 -0
- data/lib/turnkey_client/models/v1_selector_v2.rb +226 -0
- data/lib/turnkey_client/models/v1_set_organization_feature_intent.rb +226 -0
- data/lib/turnkey_client/models/v1_set_organization_feature_request.rb +289 -0
- data/lib/turnkey_client/models/v1_set_organization_feature_result.rb +214 -0
- data/lib/turnkey_client/models/v1_set_payment_method_intent.rb +287 -0
- data/lib/turnkey_client/models/v1_set_payment_method_intent_v2.rb +242 -0
- data/lib/turnkey_client/models/v1_set_payment_method_result.rb +242 -0
- data/lib/turnkey_client/models/v1_sign_raw_payload_intent.rb +255 -0
- data/lib/turnkey_client/models/v1_sign_raw_payload_intent_v2.rb +255 -0
- data/lib/turnkey_client/models/v1_sign_raw_payload_request.rb +289 -0
- data/lib/turnkey_client/models/v1_sign_raw_payload_result.rb +242 -0
- data/lib/turnkey_client/models/v1_sign_transaction_intent.rb +241 -0
- data/lib/turnkey_client/models/v1_sign_transaction_intent_v2.rb +241 -0
- data/lib/turnkey_client/models/v1_sign_transaction_request.rb +289 -0
- data/lib/turnkey_client/models/v1_sign_transaction_result.rb +211 -0
- data/lib/turnkey_client/models/v1_simple_client_extension_results.rb +224 -0
- data/lib/turnkey_client/models/v1_tag_type.rb +28 -0
- data/lib/turnkey_client/models/v1_transaction_type.rb +27 -0
- data/lib/turnkey_client/models/v1_update_allowed_origins_intent.rb +214 -0
- data/lib/turnkey_client/models/v1_update_allowed_origins_result.rb +197 -0
- data/lib/turnkey_client/models/v1_update_policy_intent.rb +261 -0
- data/lib/turnkey_client/models/v1_update_policy_request.rb +289 -0
- data/lib/turnkey_client/models/v1_update_policy_result.rb +212 -0
- data/lib/turnkey_client/models/v1_update_private_key_tag_intent.rb +256 -0
- data/lib/turnkey_client/models/v1_update_private_key_tag_request.rb +289 -0
- data/lib/turnkey_client/models/v1_update_private_key_tag_result.rb +212 -0
- data/lib/turnkey_client/models/v1_update_root_quorum_intent.rb +229 -0
- data/lib/turnkey_client/models/v1_update_root_quorum_request.rb +289 -0
- data/lib/turnkey_client/models/v1_update_root_quorum_result.rb +197 -0
- data/lib/turnkey_client/models/v1_update_user_intent.rb +244 -0
- data/lib/turnkey_client/models/v1_update_user_request.rb +289 -0
- data/lib/turnkey_client/models/v1_update_user_result.rb +212 -0
- data/lib/turnkey_client/models/v1_update_user_tag_intent.rb +256 -0
- data/lib/turnkey_client/models/v1_update_user_tag_request.rb +289 -0
- data/lib/turnkey_client/models/v1_update_user_tag_result.rb +212 -0
- data/lib/turnkey_client/models/v1_user.rb +316 -0
- data/lib/turnkey_client/models/v1_user_params.rb +287 -0
- data/lib/turnkey_client/models/v1_user_params_v2.rb +273 -0
- data/lib/turnkey_client/models/v1_vote.rb +378 -0
- data/lib/turnkey_client/models/v1_wallet.rb +270 -0
- data/lib/turnkey_client/models/v1_wallet_account.rb +342 -0
- data/lib/turnkey_client/models/v1_wallet_account_params.rb +254 -0
- data/lib/turnkey_client/models/v1_wallet_params.rb +239 -0
- data/lib/turnkey_client/models/v1_wallet_result.rb +228 -0
- data/lib/turnkey_client/models/v1_web_authn_stamp.rb +257 -0
- data/lib/turnkey_client/version.rb +14 -0
- data/lib/turnkey_client.rb +289 -0
- data/turnkey_client.gemspec +38 -0
- metadata +387 -0
@@ -0,0 +1,345 @@
|
|
1
|
+
=begin
|
2
|
+
#API Reference
|
3
|
+
|
4
|
+
#Review our [API Introduction](../api-introduction) to get started.
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 3.0.53
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
|
14
|
+
module TurnkeyClient
|
15
|
+
class V1Authenticator
|
16
|
+
# Types of transports that may be used by an Authenticator (e.g., USB, NFC, BLE).
|
17
|
+
attr_accessor :transports
|
18
|
+
|
19
|
+
attr_accessor :attestation_type
|
20
|
+
|
21
|
+
# Identifier indicating the type of the Security Key.
|
22
|
+
attr_accessor :aaguid
|
23
|
+
|
24
|
+
# Unique identifier for a WebAuthn credential.
|
25
|
+
attr_accessor :credential_id
|
26
|
+
|
27
|
+
# The type of Authenticator device.
|
28
|
+
attr_accessor :model
|
29
|
+
|
30
|
+
attr_accessor :credential
|
31
|
+
|
32
|
+
# Unique identifier for a given Authenticator.
|
33
|
+
attr_accessor :authenticator_id
|
34
|
+
|
35
|
+
# Human-readable name for an Authenticator.
|
36
|
+
attr_accessor :authenticator_name
|
37
|
+
|
38
|
+
attr_accessor :created_at
|
39
|
+
|
40
|
+
attr_accessor :updated_at
|
41
|
+
|
42
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
43
|
+
def self.attribute_map
|
44
|
+
{
|
45
|
+
:'transports' => :'transports',
|
46
|
+
:'attestation_type' => :'attestationType',
|
47
|
+
:'aaguid' => :'aaguid',
|
48
|
+
:'credential_id' => :'credentialId',
|
49
|
+
:'model' => :'model',
|
50
|
+
:'credential' => :'credential',
|
51
|
+
:'authenticator_id' => :'authenticatorId',
|
52
|
+
:'authenticator_name' => :'authenticatorName',
|
53
|
+
:'created_at' => :'createdAt',
|
54
|
+
:'updated_at' => :'updatedAt'
|
55
|
+
}
|
56
|
+
end
|
57
|
+
|
58
|
+
# Attribute type mapping.
|
59
|
+
def self.openapi_types
|
60
|
+
{
|
61
|
+
:'transports' => :'Object',
|
62
|
+
:'attestation_type' => :'Object',
|
63
|
+
:'aaguid' => :'Object',
|
64
|
+
:'credential_id' => :'Object',
|
65
|
+
:'model' => :'Object',
|
66
|
+
:'credential' => :'Object',
|
67
|
+
:'authenticator_id' => :'Object',
|
68
|
+
:'authenticator_name' => :'Object',
|
69
|
+
:'created_at' => :'Object',
|
70
|
+
:'updated_at' => :'Object'
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
74
|
+
# List of attributes with nullable: true
|
75
|
+
def self.openapi_nullable
|
76
|
+
Set.new([
|
77
|
+
])
|
78
|
+
end
|
79
|
+
|
80
|
+
# Initializes the object
|
81
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
82
|
+
def initialize(attributes = {})
|
83
|
+
if (!attributes.is_a?(Hash))
|
84
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::V1Authenticator` initialize method"
|
85
|
+
end
|
86
|
+
|
87
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
88
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
89
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
90
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::V1Authenticator`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
91
|
+
end
|
92
|
+
h[k.to_sym] = v
|
93
|
+
}
|
94
|
+
|
95
|
+
if attributes.key?(:'transports')
|
96
|
+
if (value = attributes[:'transports']).is_a?(Array)
|
97
|
+
self.transports = value
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.key?(:'attestation_type')
|
102
|
+
self.attestation_type = attributes[:'attestation_type']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.key?(:'aaguid')
|
106
|
+
self.aaguid = attributes[:'aaguid']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.key?(:'credential_id')
|
110
|
+
self.credential_id = attributes[:'credential_id']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.key?(:'model')
|
114
|
+
self.model = attributes[:'model']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.key?(:'credential')
|
118
|
+
self.credential = attributes[:'credential']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.key?(:'authenticator_id')
|
122
|
+
self.authenticator_id = attributes[:'authenticator_id']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.key?(:'authenticator_name')
|
126
|
+
self.authenticator_name = attributes[:'authenticator_name']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.key?(:'created_at')
|
130
|
+
self.created_at = attributes[:'created_at']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.key?(:'updated_at')
|
134
|
+
self.updated_at = attributes[:'updated_at']
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
139
|
+
# @return Array for valid properties with the reasons
|
140
|
+
def list_invalid_properties
|
141
|
+
invalid_properties = Array.new
|
142
|
+
if @transports.nil?
|
143
|
+
invalid_properties.push('invalid value for "transports", transports cannot be nil.')
|
144
|
+
end
|
145
|
+
|
146
|
+
if @attestation_type.nil?
|
147
|
+
invalid_properties.push('invalid value for "attestation_type", attestation_type cannot be nil.')
|
148
|
+
end
|
149
|
+
|
150
|
+
if @aaguid.nil?
|
151
|
+
invalid_properties.push('invalid value for "aaguid", aaguid cannot be nil.')
|
152
|
+
end
|
153
|
+
|
154
|
+
if @credential_id.nil?
|
155
|
+
invalid_properties.push('invalid value for "credential_id", credential_id cannot be nil.')
|
156
|
+
end
|
157
|
+
|
158
|
+
if @model.nil?
|
159
|
+
invalid_properties.push('invalid value for "model", model cannot be nil.')
|
160
|
+
end
|
161
|
+
|
162
|
+
if @credential.nil?
|
163
|
+
invalid_properties.push('invalid value for "credential", credential cannot be nil.')
|
164
|
+
end
|
165
|
+
|
166
|
+
if @authenticator_id.nil?
|
167
|
+
invalid_properties.push('invalid value for "authenticator_id", authenticator_id cannot be nil.')
|
168
|
+
end
|
169
|
+
|
170
|
+
if @authenticator_name.nil?
|
171
|
+
invalid_properties.push('invalid value for "authenticator_name", authenticator_name cannot be nil.')
|
172
|
+
end
|
173
|
+
|
174
|
+
if @created_at.nil?
|
175
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
176
|
+
end
|
177
|
+
|
178
|
+
if @updated_at.nil?
|
179
|
+
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
180
|
+
end
|
181
|
+
|
182
|
+
invalid_properties
|
183
|
+
end
|
184
|
+
|
185
|
+
# Check to see if the all the properties in the model are valid
|
186
|
+
# @return true if the model is valid
|
187
|
+
def valid?
|
188
|
+
return false if @transports.nil?
|
189
|
+
return false if @attestation_type.nil?
|
190
|
+
return false if @aaguid.nil?
|
191
|
+
return false if @credential_id.nil?
|
192
|
+
return false if @model.nil?
|
193
|
+
return false if @credential.nil?
|
194
|
+
return false if @authenticator_id.nil?
|
195
|
+
return false if @authenticator_name.nil?
|
196
|
+
return false if @created_at.nil?
|
197
|
+
return false if @updated_at.nil?
|
198
|
+
true
|
199
|
+
end
|
200
|
+
|
201
|
+
# Checks equality by comparing each attribute.
|
202
|
+
# @param [Object] Object to be compared
|
203
|
+
def ==(o)
|
204
|
+
return true if self.equal?(o)
|
205
|
+
self.class == o.class &&
|
206
|
+
transports == o.transports &&
|
207
|
+
attestation_type == o.attestation_type &&
|
208
|
+
aaguid == o.aaguid &&
|
209
|
+
credential_id == o.credential_id &&
|
210
|
+
model == o.model &&
|
211
|
+
credential == o.credential &&
|
212
|
+
authenticator_id == o.authenticator_id &&
|
213
|
+
authenticator_name == o.authenticator_name &&
|
214
|
+
created_at == o.created_at &&
|
215
|
+
updated_at == o.updated_at
|
216
|
+
end
|
217
|
+
|
218
|
+
# @see the `==` method
|
219
|
+
# @param [Object] Object to be compared
|
220
|
+
def eql?(o)
|
221
|
+
self == o
|
222
|
+
end
|
223
|
+
|
224
|
+
# Calculates hash code according to all attributes.
|
225
|
+
# @return [Integer] Hash code
|
226
|
+
def hash
|
227
|
+
[transports, attestation_type, aaguid, credential_id, model, credential, authenticator_id, authenticator_name, created_at, updated_at].hash
|
228
|
+
end
|
229
|
+
|
230
|
+
# Builds the object from hash
|
231
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
232
|
+
# @return [Object] Returns the model itself
|
233
|
+
def self.build_from_hash(attributes)
|
234
|
+
new.build_from_hash(attributes)
|
235
|
+
end
|
236
|
+
|
237
|
+
# Builds the object from hash
|
238
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
239
|
+
# @return [Object] Returns the model itself
|
240
|
+
def build_from_hash(attributes)
|
241
|
+
return nil unless attributes.is_a?(Hash)
|
242
|
+
self.class.openapi_types.each_pair do |key, type|
|
243
|
+
if type =~ /\AArray<(.*)>/i
|
244
|
+
# check to ensure the input is an array given that the attribute
|
245
|
+
# is documented as an array but the input is not
|
246
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
247
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
248
|
+
end
|
249
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
250
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
251
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
252
|
+
self.send("#{key}=", nil)
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
self
|
257
|
+
end
|
258
|
+
|
259
|
+
# Deserializes the data based on type
|
260
|
+
# @param string type Data type
|
261
|
+
# @param string value Value to be deserialized
|
262
|
+
# @return [Object] Deserialized data
|
263
|
+
def _deserialize(type, value)
|
264
|
+
case type.to_sym
|
265
|
+
when :DateTime
|
266
|
+
DateTime.parse(value)
|
267
|
+
when :Date
|
268
|
+
Date.parse(value)
|
269
|
+
when :String
|
270
|
+
value.to_s
|
271
|
+
when :Integer
|
272
|
+
value.to_i
|
273
|
+
when :Float
|
274
|
+
value.to_f
|
275
|
+
when :Boolean
|
276
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
277
|
+
true
|
278
|
+
else
|
279
|
+
false
|
280
|
+
end
|
281
|
+
when :Object
|
282
|
+
# generic object (usually a Hash), return directly
|
283
|
+
value
|
284
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
285
|
+
inner_type = Regexp.last_match[:inner_type]
|
286
|
+
value.map { |v| _deserialize(inner_type, v) }
|
287
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
288
|
+
k_type = Regexp.last_match[:k_type]
|
289
|
+
v_type = Regexp.last_match[:v_type]
|
290
|
+
{}.tap do |hash|
|
291
|
+
value.each do |k, v|
|
292
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
293
|
+
end
|
294
|
+
end
|
295
|
+
else # model
|
296
|
+
TurnkeyClient.const_get(type).build_from_hash(value)
|
297
|
+
end
|
298
|
+
end
|
299
|
+
|
300
|
+
# Returns the string representation of the object
|
301
|
+
# @return [String] String presentation of the object
|
302
|
+
def to_s
|
303
|
+
to_hash.to_s
|
304
|
+
end
|
305
|
+
|
306
|
+
# to_body is an alias to to_hash (backward compatibility)
|
307
|
+
# @return [Hash] Returns the object in the form of hash
|
308
|
+
def to_body
|
309
|
+
to_hash
|
310
|
+
end
|
311
|
+
|
312
|
+
# Returns the object in the form of hash
|
313
|
+
# @return [Hash] Returns the object in the form of hash
|
314
|
+
def to_hash
|
315
|
+
hash = {}
|
316
|
+
self.class.attribute_map.each_pair do |attr, param|
|
317
|
+
value = self.send(attr)
|
318
|
+
if value.nil?
|
319
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
320
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
321
|
+
end
|
322
|
+
|
323
|
+
hash[param] = _to_hash(value)
|
324
|
+
end
|
325
|
+
hash
|
326
|
+
end
|
327
|
+
|
328
|
+
# Outputs non-array value in the form of hash
|
329
|
+
# For object, use to_hash. Otherwise, just return the value
|
330
|
+
# @param [Object] value Any valid value
|
331
|
+
# @return [Hash] Returns the value in the form of hash
|
332
|
+
def _to_hash(value)
|
333
|
+
if value.is_a?(Array)
|
334
|
+
value.compact.map { |v| _to_hash(v) }
|
335
|
+
elsif value.is_a?(Hash)
|
336
|
+
{}.tap do |hash|
|
337
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
338
|
+
end
|
339
|
+
elsif value.respond_to? :to_hash
|
340
|
+
value.to_hash
|
341
|
+
else
|
342
|
+
value
|
343
|
+
end
|
344
|
+
end end
|
345
|
+
end
|
@@ -0,0 +1,280 @@
|
|
1
|
+
=begin
|
2
|
+
#API Reference
|
3
|
+
|
4
|
+
#Review our [API Introduction](../api-introduction) to get started.
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 3.0.53
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
|
14
|
+
module TurnkeyClient
|
15
|
+
class V1AuthenticatorAttestationResponse
|
16
|
+
attr_accessor :client_data_json
|
17
|
+
|
18
|
+
attr_accessor :attestation_object
|
19
|
+
|
20
|
+
attr_accessor :transports
|
21
|
+
|
22
|
+
attr_accessor :authenticator_attachment
|
23
|
+
|
24
|
+
class EnumAttributeValidator
|
25
|
+
attr_reader :datatype
|
26
|
+
attr_reader :allowable_values
|
27
|
+
|
28
|
+
def initialize(datatype, allowable_values)
|
29
|
+
@allowable_values = allowable_values.map do |value|
|
30
|
+
case datatype.to_s
|
31
|
+
when /Integer/i
|
32
|
+
value.to_i
|
33
|
+
when /Float/i
|
34
|
+
value.to_f
|
35
|
+
else
|
36
|
+
value
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def valid?(value)
|
42
|
+
!value || allowable_values.include?(value)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
47
|
+
def self.attribute_map
|
48
|
+
{
|
49
|
+
:'client_data_json' => :'clientDataJson',
|
50
|
+
:'attestation_object' => :'attestationObject',
|
51
|
+
:'transports' => :'transports',
|
52
|
+
:'authenticator_attachment' => :'authenticatorAttachment'
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# Attribute type mapping.
|
57
|
+
def self.openapi_types
|
58
|
+
{
|
59
|
+
:'client_data_json' => :'Object',
|
60
|
+
:'attestation_object' => :'Object',
|
61
|
+
:'transports' => :'Object',
|
62
|
+
:'authenticator_attachment' => :'Object'
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
# List of attributes with nullable: true
|
67
|
+
def self.openapi_nullable
|
68
|
+
Set.new([
|
69
|
+
:'authenticator_attachment'
|
70
|
+
])
|
71
|
+
end
|
72
|
+
|
73
|
+
# Initializes the object
|
74
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
75
|
+
def initialize(attributes = {})
|
76
|
+
if (!attributes.is_a?(Hash))
|
77
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::V1AuthenticatorAttestationResponse` initialize method"
|
78
|
+
end
|
79
|
+
|
80
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
81
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
82
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::V1AuthenticatorAttestationResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
84
|
+
end
|
85
|
+
h[k.to_sym] = v
|
86
|
+
}
|
87
|
+
|
88
|
+
if attributes.key?(:'client_data_json')
|
89
|
+
self.client_data_json = attributes[:'client_data_json']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'attestation_object')
|
93
|
+
self.attestation_object = attributes[:'attestation_object']
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.key?(:'transports')
|
97
|
+
if (value = attributes[:'transports']).is_a?(Array)
|
98
|
+
self.transports = value
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:'authenticator_attachment')
|
103
|
+
self.authenticator_attachment = attributes[:'authenticator_attachment']
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
108
|
+
# @return Array for valid properties with the reasons
|
109
|
+
def list_invalid_properties
|
110
|
+
invalid_properties = Array.new
|
111
|
+
if @client_data_json.nil?
|
112
|
+
invalid_properties.push('invalid value for "client_data_json", client_data_json cannot be nil.')
|
113
|
+
end
|
114
|
+
|
115
|
+
if @attestation_object.nil?
|
116
|
+
invalid_properties.push('invalid value for "attestation_object", attestation_object cannot be nil.')
|
117
|
+
end
|
118
|
+
|
119
|
+
invalid_properties
|
120
|
+
end
|
121
|
+
|
122
|
+
# Check to see if the all the properties in the model are valid
|
123
|
+
# @return true if the model is valid
|
124
|
+
def valid?
|
125
|
+
return false if @client_data_json.nil?
|
126
|
+
return false if @attestation_object.nil?
|
127
|
+
authenticator_attachment_validator = EnumAttributeValidator.new('Object', ['cross-platform', 'platform'])
|
128
|
+
return false unless authenticator_attachment_validator.valid?(@authenticator_attachment)
|
129
|
+
true
|
130
|
+
end
|
131
|
+
|
132
|
+
# Custom attribute writer method checking allowed values (enum).
|
133
|
+
# @param [Object] authenticator_attachment Object to be assigned
|
134
|
+
def authenticator_attachment=(authenticator_attachment)
|
135
|
+
validator = EnumAttributeValidator.new('Object', ['cross-platform', 'platform'])
|
136
|
+
unless validator.valid?(authenticator_attachment)
|
137
|
+
fail ArgumentError, "invalid value for \"authenticator_attachment\", must be one of #{validator.allowable_values}."
|
138
|
+
end
|
139
|
+
@authenticator_attachment = authenticator_attachment
|
140
|
+
end
|
141
|
+
|
142
|
+
# Checks equality by comparing each attribute.
|
143
|
+
# @param [Object] Object to be compared
|
144
|
+
def ==(o)
|
145
|
+
return true if self.equal?(o)
|
146
|
+
self.class == o.class &&
|
147
|
+
client_data_json == o.client_data_json &&
|
148
|
+
attestation_object == o.attestation_object &&
|
149
|
+
transports == o.transports &&
|
150
|
+
authenticator_attachment == o.authenticator_attachment
|
151
|
+
end
|
152
|
+
|
153
|
+
# @see the `==` method
|
154
|
+
# @param [Object] Object to be compared
|
155
|
+
def eql?(o)
|
156
|
+
self == o
|
157
|
+
end
|
158
|
+
|
159
|
+
# Calculates hash code according to all attributes.
|
160
|
+
# @return [Integer] Hash code
|
161
|
+
def hash
|
162
|
+
[client_data_json, attestation_object, transports, authenticator_attachment].hash
|
163
|
+
end
|
164
|
+
|
165
|
+
# Builds the object from hash
|
166
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
167
|
+
# @return [Object] Returns the model itself
|
168
|
+
def self.build_from_hash(attributes)
|
169
|
+
new.build_from_hash(attributes)
|
170
|
+
end
|
171
|
+
|
172
|
+
# Builds the object from hash
|
173
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
174
|
+
# @return [Object] Returns the model itself
|
175
|
+
def build_from_hash(attributes)
|
176
|
+
return nil unless attributes.is_a?(Hash)
|
177
|
+
self.class.openapi_types.each_pair do |key, type|
|
178
|
+
if type =~ /\AArray<(.*)>/i
|
179
|
+
# check to ensure the input is an array given that the attribute
|
180
|
+
# is documented as an array but the input is not
|
181
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
182
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
183
|
+
end
|
184
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
185
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
186
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
187
|
+
self.send("#{key}=", nil)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
self
|
192
|
+
end
|
193
|
+
|
194
|
+
# Deserializes the data based on type
|
195
|
+
# @param string type Data type
|
196
|
+
# @param string value Value to be deserialized
|
197
|
+
# @return [Object] Deserialized data
|
198
|
+
def _deserialize(type, value)
|
199
|
+
case type.to_sym
|
200
|
+
when :DateTime
|
201
|
+
DateTime.parse(value)
|
202
|
+
when :Date
|
203
|
+
Date.parse(value)
|
204
|
+
when :String
|
205
|
+
value.to_s
|
206
|
+
when :Integer
|
207
|
+
value.to_i
|
208
|
+
when :Float
|
209
|
+
value.to_f
|
210
|
+
when :Boolean
|
211
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
212
|
+
true
|
213
|
+
else
|
214
|
+
false
|
215
|
+
end
|
216
|
+
when :Object
|
217
|
+
# generic object (usually a Hash), return directly
|
218
|
+
value
|
219
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
220
|
+
inner_type = Regexp.last_match[:inner_type]
|
221
|
+
value.map { |v| _deserialize(inner_type, v) }
|
222
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
223
|
+
k_type = Regexp.last_match[:k_type]
|
224
|
+
v_type = Regexp.last_match[:v_type]
|
225
|
+
{}.tap do |hash|
|
226
|
+
value.each do |k, v|
|
227
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
228
|
+
end
|
229
|
+
end
|
230
|
+
else # model
|
231
|
+
TurnkeyClient.const_get(type).build_from_hash(value)
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
# Returns the string representation of the object
|
236
|
+
# @return [String] String presentation of the object
|
237
|
+
def to_s
|
238
|
+
to_hash.to_s
|
239
|
+
end
|
240
|
+
|
241
|
+
# to_body is an alias to to_hash (backward compatibility)
|
242
|
+
# @return [Hash] Returns the object in the form of hash
|
243
|
+
def to_body
|
244
|
+
to_hash
|
245
|
+
end
|
246
|
+
|
247
|
+
# Returns the object in the form of hash
|
248
|
+
# @return [Hash] Returns the object in the form of hash
|
249
|
+
def to_hash
|
250
|
+
hash = {}
|
251
|
+
self.class.attribute_map.each_pair do |attr, param|
|
252
|
+
value = self.send(attr)
|
253
|
+
if value.nil?
|
254
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
255
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
256
|
+
end
|
257
|
+
|
258
|
+
hash[param] = _to_hash(value)
|
259
|
+
end
|
260
|
+
hash
|
261
|
+
end
|
262
|
+
|
263
|
+
# Outputs non-array value in the form of hash
|
264
|
+
# For object, use to_hash. Otherwise, just return the value
|
265
|
+
# @param [Object] value Any valid value
|
266
|
+
# @return [Hash] Returns the value in the form of hash
|
267
|
+
def _to_hash(value)
|
268
|
+
if value.is_a?(Array)
|
269
|
+
value.compact.map { |v| _to_hash(v) }
|
270
|
+
elsif value.is_a?(Hash)
|
271
|
+
{}.tap do |hash|
|
272
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
273
|
+
end
|
274
|
+
elsif value.respond_to? :to_hash
|
275
|
+
value.to_hash
|
276
|
+
else
|
277
|
+
value
|
278
|
+
end
|
279
|
+
end end
|
280
|
+
end
|