diff --git a/turnkey_client/.swagger-codegen/VERSION b/turnkey_client/.swagger-codegen/VERSION index 3041e12..8515c05 100644 --- a/turnkey_client/.swagger-codegen/VERSION +++ b/turnkey_client/.swagger-codegen/VERSION @@ -1 +1 @@ -3.0.58 \ No newline at end of file +3.0.64 \ No newline at end of file diff --git a/turnkey_client/lib/turnkey_client.rb b/turnkey_client/lib/turnkey_client.rb index cd2e1a5..c51aa97 100644 --- a/turnkey_client/lib/turnkey_client.rb +++ b/turnkey_client/lib/turnkey_client.rb @@ -26,6 +26,7 @@ require 'turnkey_client/models/activity_status' require 'turnkey_client/models/activity_type' require 'turnkey_client/models/activity_v1_address' +require 'turnkey_client/models/activity_v1_policy_evaluation' require 'turnkey_client/models/address_format' require 'turnkey_client/models/any' require 'turnkey_client/models/api_key' @@ -85,6 +86,9 @@ require 'turnkey_client/models/create_read_write_session_request' require 'turnkey_client/models/create_read_write_session_result' require 'turnkey_client/models/create_read_write_session_result_v2' +require 'turnkey_client/models/create_smart_contract_interface_intent' +require 'turnkey_client/models/create_smart_contract_interface_request' +require 'turnkey_client/models/create_smart_contract_interface_result' require 'turnkey_client/models/create_sub_organization_intent' require 'turnkey_client/models/create_sub_organization_intent_v2' require 'turnkey_client/models/create_sub_organization_intent_v3' @@ -104,6 +108,7 @@ require 'turnkey_client/models/create_user_tag_result' require 'turnkey_client/models/create_users_intent' require 'turnkey_client/models/create_users_intent_v2' +require 'turnkey_client/models/create_users_intent_v3' require 'turnkey_client/models/create_users_request' require 'turnkey_client/models/create_users_result' require 'turnkey_client/models/create_wallet_accounts_intent' @@ -116,6 +121,7 @@ require 'turnkey_client/models/credential_type' require 'turnkey_client/models/curve' require 'turnkey_client/models/data_v1_address' +require 'turnkey_client/models/data_v1_smart_contract_interface' require 'turnkey_client/models/delete_api_keys_intent' require 'turnkey_client/models/delete_api_keys_request' require 'turnkey_client/models/delete_api_keys_result' @@ -141,6 +147,9 @@ require 'turnkey_client/models/delete_private_keys_intent' require 'turnkey_client/models/delete_private_keys_request' require 'turnkey_client/models/delete_private_keys_result' +require 'turnkey_client/models/delete_smart_contract_interface_intent' +require 'turnkey_client/models/delete_smart_contract_interface_request' +require 'turnkey_client/models/delete_smart_contract_interface_result' require 'turnkey_client/models/delete_sub_organization_intent' require 'turnkey_client/models/delete_sub_organization_request' require 'turnkey_client/models/delete_sub_organization_result' @@ -175,6 +184,11 @@ require 'turnkey_client/models/external_data_v1_timestamp' require 'turnkey_client/models/feature' require 'turnkey_client/models/feature_name' +require 'turnkey_client/models/fiat_on_ramp_blockchain_network' +require 'turnkey_client/models/fiat_on_ramp_crypto_currency' +require 'turnkey_client/models/fiat_on_ramp_currency' +require 'turnkey_client/models/fiat_on_ramp_payment_method' +require 'turnkey_client/models/fiat_on_ramp_provider' require 'turnkey_client/models/get_activities_request' require 'turnkey_client/models/get_activities_response' require 'turnkey_client/models/get_activity_request' @@ -192,12 +206,18 @@ require 'turnkey_client/models/get_organization_configs_response' require 'turnkey_client/models/get_policies_request' require 'turnkey_client/models/get_policies_response' +require 'turnkey_client/models/get_policy_evaluations_request' +require 'turnkey_client/models/get_policy_evaluations_response' require 'turnkey_client/models/get_policy_request' require 'turnkey_client/models/get_policy_response' require 'turnkey_client/models/get_private_key_request' require 'turnkey_client/models/get_private_key_response' require 'turnkey_client/models/get_private_keys_request' require 'turnkey_client/models/get_private_keys_response' +require 'turnkey_client/models/get_smart_contract_interface_request' +require 'turnkey_client/models/get_smart_contract_interface_response' +require 'turnkey_client/models/get_smart_contract_interfaces_request' +require 'turnkey_client/models/get_smart_contract_interfaces_response' require 'turnkey_client/models/get_sub_org_ids_request' require 'turnkey_client/models/get_sub_org_ids_response' require 'turnkey_client/models/get_user_request' @@ -223,6 +243,9 @@ require 'turnkey_client/models/import_wallet_intent' require 'turnkey_client/models/import_wallet_request' require 'turnkey_client/models/import_wallet_result' +require 'turnkey_client/models/init_fiat_on_ramp_intent' +require 'turnkey_client/models/init_fiat_on_ramp_request' +require 'turnkey_client/models/init_fiat_on_ramp_result' require 'turnkey_client/models/init_import_private_key_intent' require 'turnkey_client/models/init_import_private_key_request' require 'turnkey_client/models/init_import_private_key_result' @@ -230,8 +253,13 @@ require 'turnkey_client/models/init_import_wallet_request' require 'turnkey_client/models/init_import_wallet_result' require 'turnkey_client/models/init_otp_auth_intent' +require 'turnkey_client/models/init_otp_auth_intent_v2' require 'turnkey_client/models/init_otp_auth_request' require 'turnkey_client/models/init_otp_auth_result' +require 'turnkey_client/models/init_otp_auth_result_v2' +require 'turnkey_client/models/init_otp_intent' +require 'turnkey_client/models/init_otp_request' +require 'turnkey_client/models/init_otp_result' require 'turnkey_client/models/init_user_email_recovery_intent' require 'turnkey_client/models/init_user_email_recovery_request' require 'turnkey_client/models/init_user_email_recovery_result' @@ -243,6 +271,9 @@ require 'turnkey_client/models/list_user_tags_response' require 'turnkey_client/models/mnemonic_language' require 'turnkey_client/models/oauth_intent' +require 'turnkey_client/models/oauth_login_intent' +require 'turnkey_client/models/oauth_login_request' +require 'turnkey_client/models/oauth_login_result' require 'turnkey_client/models/oauth_provider' require 'turnkey_client/models/oauth_provider_params' require 'turnkey_client/models/oauth_request' @@ -251,6 +282,10 @@ require 'turnkey_client/models/otp_auth_intent' require 'turnkey_client/models/otp_auth_request' require 'turnkey_client/models/otp_auth_result' +require 'turnkey_client/models/otp_login_intent' +require 'turnkey_client/models/otp_login_request' +require 'turnkey_client/models/otp_login_result' +require 'turnkey_client/models/outcome' require 'turnkey_client/models/pagination' require 'turnkey_client/models/path_format' require 'turnkey_client/models/payload_encoding' @@ -292,22 +327,38 @@ require 'turnkey_client/models/sign_transaction_request' require 'turnkey_client/models/sign_transaction_result' require 'turnkey_client/models/simple_client_extension_results' +require 'turnkey_client/models/smart_contract_interface_type' require 'turnkey_client/models/sms_customization_params' +require 'turnkey_client/models/stamp_login_intent' +require 'turnkey_client/models/stamp_login_request' +require 'turnkey_client/models/stamp_login_result' require 'turnkey_client/models/status' require 'turnkey_client/models/tag_type' require 'turnkey_client/models/transaction_type' +require 'turnkey_client/models/ump_v1_policy_evaluation' require 'turnkey_client/models/update_allowed_origins_intent' require 'turnkey_client/models/update_allowed_origins_result' require 'turnkey_client/models/update_policy_intent' +require 'turnkey_client/models/update_policy_intent_v2' require 'turnkey_client/models/update_policy_request' require 'turnkey_client/models/update_policy_result' +require 'turnkey_client/models/update_policy_result_v2' require 'turnkey_client/models/update_private_key_tag_intent' require 'turnkey_client/models/update_private_key_tag_request' require 'turnkey_client/models/update_private_key_tag_result' require 'turnkey_client/models/update_root_quorum_intent' require 'turnkey_client/models/update_root_quorum_request' require 'turnkey_client/models/update_root_quorum_result' +require 'turnkey_client/models/update_user_email_intent' +require 'turnkey_client/models/update_user_email_request' +require 'turnkey_client/models/update_user_email_result' require 'turnkey_client/models/update_user_intent' +require 'turnkey_client/models/update_user_name_intent' +require 'turnkey_client/models/update_user_name_request' +require 'turnkey_client/models/update_user_name_result' +require 'turnkey_client/models/update_user_phone_number_intent' +require 'turnkey_client/models/update_user_phone_number_request' +require 'turnkey_client/models/update_user_phone_number_result' require 'turnkey_client/models/update_user_request' require 'turnkey_client/models/update_user_result' require 'turnkey_client/models/update_user_tag_intent' @@ -319,7 +370,11 @@ require 'turnkey_client/models/user' require 'turnkey_client/models/user_params' require 'turnkey_client/models/user_params_v2' +require 'turnkey_client/models/user_params_v3' require 'turnkey_client/models/v1_tag' +require 'turnkey_client/models/verify_otp_intent' +require 'turnkey_client/models/verify_otp_request' +require 'turnkey_client/models/verify_otp_result' require 'turnkey_client/models/vote' require 'turnkey_client/models/wallet' require 'turnkey_client/models/wallet_account' @@ -334,6 +389,7 @@ require 'turnkey_client/api/consensus_api' require 'turnkey_client/api/features_api' require 'turnkey_client/api/invitations_api' +require 'turnkey_client/api/on_ramp_api' require 'turnkey_client/api/organizations_api' require 'turnkey_client/api/policies_api' require 'turnkey_client/api/private_key_tags_api' @@ -343,6 +399,7 @@ require 'turnkey_client/api/user_auth_api' require 'turnkey_client/api/user_recovery_api' require 'turnkey_client/api/user_tags_api' +require 'turnkey_client/api/user_verification_api' require 'turnkey_client/api/users_api' require 'turnkey_client/api/wallets_api' diff --git a/turnkey_client/lib/turnkey_client/api/activities_api.rb b/turnkey_client/lib/turnkey_client/api/activities_api.rb index 8855988..ee107f6 100644 --- a/turnkey_client/lib/turnkey_client/api/activities_api.rb +++ b/turnkey_client/lib/turnkey_client/api/activities_api.rb @@ -15,8 +15,8 @@ class ActivitiesApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # List Activities - # List all Activities within an Organization + # List activities + # List all activities within an organization. # @param body # @param [Hash] opts the optional parameters # @return [GetActivitiesResponse] @@ -25,8 +25,8 @@ def get_activities(body, opts = {}) data end - # List Activities - # List all Activities within an Organization + # List activities + # List all activities within an organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(GetActivitiesResponse, Integer, Hash)>] GetActivitiesResponse data, response status code and response headers @@ -73,8 +73,8 @@ def get_activities_with_http_info(body, opts = {}) end return data, status_code, headers end - # Get Activity - # Get details about an Activity + # Get activity + # Get details about an activity. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -83,8 +83,8 @@ def get_activity(body, opts = {}) data end - # Get Activity - # Get details about an Activity + # Get activity + # Get details about an activity. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -131,5 +131,63 @@ def get_activity_with_http_info(body, opts = {}) end return data, status_code, headers end + # Get policy evaluations + # Get the policy evaluations for an activity. + # @param body + # @param [Hash] opts the optional parameters + # @return [GetPolicyEvaluationsResponse] + def get_policy_evaluations(body, opts = {}) + data, _status_code, _headers = get_policy_evaluations_with_http_info(body, opts) + data + end + + # Get policy evaluations + # Get the policy evaluations for an activity. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(GetPolicyEvaluationsResponse, Integer, Hash)>] GetPolicyEvaluationsResponse data, response status code and response headers + def get_policy_evaluations_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ActivitiesApi.get_policy_evaluations ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ActivitiesApi.get_policy_evaluations" + end + # resource path + local_var_path = '/public/v1/query/get_policy_evaluations' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + return_type = opts[:return_type] || 'GetPolicyEvaluationsResponse' + + auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type) + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ActivitiesApi#get_policy_evaluations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/turnkey_client/lib/turnkey_client/api/api_keys_api.rb b/turnkey_client/lib/turnkey_client/api/api_keys_api.rb index 254edab..55a593a 100644 --- a/turnkey_client/lib/turnkey_client/api/api_keys_api.rb +++ b/turnkey_client/lib/turnkey_client/api/api_keys_api.rb @@ -15,8 +15,8 @@ class APIKeysApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create API Keys - # Add api keys to an existing User + # Create API keys + # Add API keys to an existing user. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -25,8 +25,8 @@ def create_api_keys(body, opts = {}) data end - # Create API Keys - # Add api keys to an existing User + # Create API keys + # Add API keys to an existing user. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -73,8 +73,8 @@ def create_api_keys_with_http_info(body, opts = {}) end return data, status_code, headers end - # Delete API Keys - # Remove api keys from a User + # Delete API keys + # Remove api keys from a user. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -83,8 +83,8 @@ def delete_api_keys(body, opts = {}) data end - # Delete API Keys - # Remove api keys from a User + # Delete API keys + # Remove api keys from a user. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -132,7 +132,7 @@ def delete_api_keys_with_http_info(body, opts = {}) return data, status_code, headers end # Get API key - # Get details about an API key + # Get details about an API key. # @param body # @param [Hash] opts the optional parameters # @return [GetApiKeyResponse] @@ -142,7 +142,7 @@ def get_api_key(body, opts = {}) end # Get API key - # Get details about an API key + # Get details about an API key. # @param body # @param [Hash] opts the optional parameters # @return [Array<(GetApiKeyResponse, Integer, Hash)>] GetApiKeyResponse data, response status code and response headers @@ -189,8 +189,8 @@ def get_api_key_with_http_info(body, opts = {}) end return data, status_code, headers end - # Get API key - # Get details about API keys for a user + # Get API keys + # Get details about API keys for a user. # @param body # @param [Hash] opts the optional parameters # @return [GetApiKeysResponse] @@ -199,8 +199,8 @@ def get_api_keys(body, opts = {}) data end - # Get API key - # Get details about API keys for a user + # Get API keys + # Get details about API keys for a user. # @param body # @param [Hash] opts the optional parameters # @return [Array<(GetApiKeysResponse, Integer, Hash)>] GetApiKeysResponse data, response status code and response headers diff --git a/turnkey_client/lib/turnkey_client/api/authenticators_api.rb b/turnkey_client/lib/turnkey_client/api/authenticators_api.rb index c642c19..6e56e85 100644 --- a/turnkey_client/lib/turnkey_client/api/authenticators_api.rb +++ b/turnkey_client/lib/turnkey_client/api/authenticators_api.rb @@ -15,8 +15,8 @@ class AuthenticatorsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create Authenticators - # Create Authenticators to authenticate requests to Turnkey + # Create authenticators + # Create authenticators to authenticate requests to Turnkey. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -25,8 +25,8 @@ def create_authenticators(body, opts = {}) data end - # Create Authenticators - # Create Authenticators to authenticate requests to Turnkey + # Create authenticators + # Create authenticators to authenticate requests to Turnkey. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -73,8 +73,8 @@ def create_authenticators_with_http_info(body, opts = {}) end return data, status_code, headers end - # Delete Authenticators - # Remove authenticators from a User + # Delete authenticators + # Remove authenticators from a user. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -83,8 +83,8 @@ def delete_authenticators(body, opts = {}) data end - # Delete Authenticators - # Remove authenticators from a User + # Delete authenticators + # Remove authenticators from a user. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -131,8 +131,8 @@ def delete_authenticators_with_http_info(body, opts = {}) end return data, status_code, headers end - # Get Authenticator - # Get details about an authenticator + # Get authenticator + # Get details about an authenticator. # @param body # @param [Hash] opts the optional parameters # @return [GetAuthenticatorResponse] @@ -141,8 +141,8 @@ def get_authenticator(body, opts = {}) data end - # Get Authenticator - # Get details about an authenticator + # Get authenticator + # Get details about an authenticator. # @param body # @param [Hash] opts the optional parameters # @return [Array<(GetAuthenticatorResponse, Integer, Hash)>] GetAuthenticatorResponse data, response status code and response headers @@ -189,8 +189,8 @@ def get_authenticator_with_http_info(body, opts = {}) end return data, status_code, headers end - # Get Authenticators - # Get details about authenticators for a user + # Get authenticators + # Get details about authenticators for a user. # @param body # @param [Hash] opts the optional parameters # @return [GetAuthenticatorsResponse] @@ -199,8 +199,8 @@ def get_authenticators(body, opts = {}) data end - # Get Authenticators - # Get details about authenticators for a user + # Get authenticators + # Get details about authenticators for a user. # @param body # @param [Hash] opts the optional parameters # @return [Array<(GetAuthenticatorsResponse, Integer, Hash)>] GetAuthenticatorsResponse data, response status code and response headers diff --git a/turnkey_client/lib/turnkey_client/api/consensus_api.rb b/turnkey_client/lib/turnkey_client/api/consensus_api.rb index 2e83f83..e64882b 100644 --- a/turnkey_client/lib/turnkey_client/api/consensus_api.rb +++ b/turnkey_client/lib/turnkey_client/api/consensus_api.rb @@ -15,8 +15,8 @@ class ConsensusApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Approve Activity - # Approve an Activity + # Approve activity + # Approve an activity. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -25,8 +25,8 @@ def approve_activity(body, opts = {}) data end - # Approve Activity - # Approve an Activity + # Approve activity + # Approve an activity. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -73,8 +73,8 @@ def approve_activity_with_http_info(body, opts = {}) end return data, status_code, headers end - # Reject Activity - # Reject an Activity + # Reject activity + # Reject an activity. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -83,8 +83,8 @@ def reject_activity(body, opts = {}) data end - # Reject Activity - # Reject an Activity + # Reject activity + # Reject an activity. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers diff --git a/turnkey_client/lib/turnkey_client/api/features_api.rb b/turnkey_client/lib/turnkey_client/api/features_api.rb index 7a16082..b756617 100644 --- a/turnkey_client/lib/turnkey_client/api/features_api.rb +++ b/turnkey_client/lib/turnkey_client/api/features_api.rb @@ -15,8 +15,8 @@ class FeaturesApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Remove Organization Feature - # Removes an organization feature. This activity must be approved by the current root quorum. + # Remove organization feature + # Remove an organization feature. This activity must be approved by the current root quorum. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -25,8 +25,8 @@ def remove_organization_feature(body, opts = {}) data end - # Remove Organization Feature - # Removes an organization feature. This activity must be approved by the current root quorum. + # Remove organization feature + # Remove an organization feature. This activity must be approved by the current root quorum. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -73,8 +73,8 @@ def remove_organization_feature_with_http_info(body, opts = {}) end return data, status_code, headers end - # Set Organization Feature - # Sets an organization feature. This activity must be approved by the current root quorum. + # Set organization feature + # Set an organization feature. This activity must be approved by the current root quorum. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -83,8 +83,8 @@ def set_organization_feature(body, opts = {}) data end - # Set Organization Feature - # Sets an organization feature. This activity must be approved by the current root quorum. + # Set organization feature + # Set an organization feature. This activity must be approved by the current root quorum. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers diff --git a/turnkey_client/lib/turnkey_client/api/invitations_api.rb b/turnkey_client/lib/turnkey_client/api/invitations_api.rb index d3639b3..83c37ed 100644 --- a/turnkey_client/lib/turnkey_client/api/invitations_api.rb +++ b/turnkey_client/lib/turnkey_client/api/invitations_api.rb @@ -15,8 +15,8 @@ class InvitationsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create Invitations - # Create Invitations to join an existing Organization + # Create invitations + # Create invitations to join an existing organization. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -25,8 +25,8 @@ def create_invitations(body, opts = {}) data end - # Create Invitations - # Create Invitations to join an existing Organization + # Create invitations + # Create invitations to join an existing organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -73,8 +73,8 @@ def create_invitations_with_http_info(body, opts = {}) end return data, status_code, headers end - # Delete Invitation - # Delete an existing Invitation + # Delete invitation + # Delete an existing invitation. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -83,8 +83,8 @@ def delete_invitation(body, opts = {}) data end - # Delete Invitation - # Delete an existing Invitation + # Delete invitation + # Delete an existing invitation. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers diff --git a/turnkey_client/lib/turnkey_client/api/on_ramp_api.rb b/turnkey_client/lib/turnkey_client/api/on_ramp_api.rb new file mode 100644 index 0000000..7a4ae23 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/api/on_ramp_api.rb @@ -0,0 +1,77 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +module TurnkeyClient + class OnRampApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Init fiat on ramp + # Initiate a fiat on ramp flow. + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def init_fiat_on_ramp(body, opts = {}) + data, _status_code, _headers = init_fiat_on_ramp_with_http_info(body, opts) + data + end + + # Init fiat on ramp + # Initiate a fiat on ramp flow. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def init_fiat_on_ramp_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OnRampApi.init_fiat_on_ramp ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling OnRampApi.init_fiat_on_ramp" + end + # resource path + local_var_path = '/public/v1/submit/init_fiat_on_ramp' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + return_type = opts[:return_type] || 'ActivityResponse' + + auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type) + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OnRampApi#init_fiat_on_ramp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/turnkey_client/lib/turnkey_client/api/organizations_api.rb b/turnkey_client/lib/turnkey_client/api/organizations_api.rb index d4a23db..5e21839 100644 --- a/turnkey_client/lib/turnkey_client/api/organizations_api.rb +++ b/turnkey_client/lib/turnkey_client/api/organizations_api.rb @@ -15,8 +15,8 @@ class OrganizationsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create Sub-Organization - # Create a new Sub-Organization + # Create sub-organization + # Create a new sub-organization. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -25,8 +25,8 @@ def create_sub_organization(body, opts = {}) data end - # Create Sub-Organization - # Create a new Sub-Organization + # Create sub-organization + # Create a new sub-organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -73,8 +73,8 @@ def create_sub_organization_with_http_info(body, opts = {}) end return data, status_code, headers end - # Delete Sub Organization - # Deletes a sub organization + # Delete sub-organization + # Delete a sub-organization. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -83,8 +83,8 @@ def delete_sub_organization(body, opts = {}) data end - # Delete Sub Organization - # Deletes a sub organization + # Delete sub-organization + # Delete a sub-organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -131,8 +131,8 @@ def delete_sub_organization_with_http_info(body, opts = {}) end return data, status_code, headers end - # Get Configs - # Get quorum settings and features for an organization + # Get configs + # Get quorum settings and features for an organization. # @param body # @param [Hash] opts the optional parameters # @return [GetOrganizationConfigsResponse] @@ -141,8 +141,8 @@ def get_organization_configs(body, opts = {}) data end - # Get Configs - # Get quorum settings and features for an organization + # Get configs + # Get quorum settings and features for an organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(GetOrganizationConfigsResponse, Integer, Hash)>] GetOrganizationConfigsResponse data, response status code and response headers @@ -189,7 +189,7 @@ def get_organization_configs_with_http_info(body, opts = {}) end return data, status_code, headers end - # Get Suborgs + # Get sub-organizations # Get all suborg IDs associated given a parent org ID and an optional filter. # @param body # @param [Hash] opts the optional parameters @@ -199,7 +199,7 @@ def get_sub_org_ids(body, opts = {}) data end - # Get Suborgs + # Get sub-organizations # Get all suborg IDs associated given a parent org ID and an optional filter. # @param body # @param [Hash] opts the optional parameters @@ -247,7 +247,7 @@ def get_sub_org_ids_with_http_info(body, opts = {}) end return data, status_code, headers end - # Get Verified Suborgs + # Get verified sub-organizations # Get all email or phone verified suborg IDs associated given a parent org ID. # @param body # @param [Hash] opts the optional parameters @@ -257,7 +257,7 @@ def get_verified_sub_org_ids(body, opts = {}) data end - # Get Verified Suborgs + # Get verified sub-organizations # Get all email or phone verified suborg IDs associated given a parent org ID. # @param body # @param [Hash] opts the optional parameters @@ -305,7 +305,7 @@ def get_verified_sub_org_ids_with_http_info(body, opts = {}) end return data, status_code, headers end - # Update Root Quorum + # Update root quorum # Set the threshold and members of the root quorum. This activity must be approved by the current root quorum. # @param body # @param [Hash] opts the optional parameters @@ -315,7 +315,7 @@ def update_root_quorum(body, opts = {}) data end - # Update Root Quorum + # Update root quorum # Set the threshold and members of the root quorum. This activity must be approved by the current root quorum. # @param body # @param [Hash] opts the optional parameters diff --git a/turnkey_client/lib/turnkey_client/api/policies_api.rb b/turnkey_client/lib/turnkey_client/api/policies_api.rb index 33104dd..9b06a07 100644 --- a/turnkey_client/lib/turnkey_client/api/policies_api.rb +++ b/turnkey_client/lib/turnkey_client/api/policies_api.rb @@ -15,8 +15,8 @@ class PoliciesApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create Policies - # Create new Policies + # Create policies + # Create new policies. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -25,8 +25,8 @@ def create_policies(body, opts = {}) data end - # Create Policies - # Create new Policies + # Create policies + # Create new policies. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -73,8 +73,8 @@ def create_policies_with_http_info(body, opts = {}) end return data, status_code, headers end - # Create Policy - # Create a new Policy + # Create policy + # Create a new policy. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -83,8 +83,8 @@ def create_policy(body, opts = {}) data end - # Create Policy - # Create a new Policy + # Create policy + # Create a new policy. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -131,8 +131,66 @@ def create_policy_with_http_info(body, opts = {}) end return data, status_code, headers end - # Delete Policy - # Delete an existing Policy + # Create smart contract interface + # Create an ABI/IDL in JSON. + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def create_smart_contract_interface(body, opts = {}) + data, _status_code, _headers = create_smart_contract_interface_with_http_info(body, opts) + data + end + + # Create smart contract interface + # Create an ABI/IDL in JSON. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def create_smart_contract_interface_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PoliciesApi.create_smart_contract_interface ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling PoliciesApi.create_smart_contract_interface" + end + # resource path + local_var_path = '/public/v1/submit/create_smart_contract_interface' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + return_type = opts[:return_type] || 'ActivityResponse' + + auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type) + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PoliciesApi#create_smart_contract_interface\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete policy + # Delete an existing policy. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -141,8 +199,8 @@ def delete_policy(body, opts = {}) data end - # Delete Policy - # Delete an existing Policy + # Delete policy + # Delete an existing policy. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -189,8 +247,66 @@ def delete_policy_with_http_info(body, opts = {}) end return data, status_code, headers end - # List Policies - # List all Policies within an Organization + # Delete smart contract interface + # Delete a smart contract interface. + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def delete_smart_contract_interface(body, opts = {}) + data, _status_code, _headers = delete_smart_contract_interface_with_http_info(body, opts) + data + end + + # Delete smart contract interface + # Delete a smart contract interface. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def delete_smart_contract_interface_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PoliciesApi.delete_smart_contract_interface ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling PoliciesApi.delete_smart_contract_interface" + end + # resource path + local_var_path = '/public/v1/submit/delete_smart_contract_interface' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + return_type = opts[:return_type] || 'ActivityResponse' + + auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type) + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PoliciesApi#delete_smart_contract_interface\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List policies + # List all policies within an organization. # @param body # @param [Hash] opts the optional parameters # @return [GetPoliciesResponse] @@ -199,8 +315,8 @@ def get_policies(body, opts = {}) data end - # List Policies - # List all Policies within an Organization + # List policies + # List all policies within an organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(GetPoliciesResponse, Integer, Hash)>] GetPoliciesResponse data, response status code and response headers @@ -247,8 +363,8 @@ def get_policies_with_http_info(body, opts = {}) end return data, status_code, headers end - # Get Policy - # Get details about a Policy + # Get policy + # Get details about a policy. # @param body # @param [Hash] opts the optional parameters # @return [GetPolicyResponse] @@ -257,8 +373,8 @@ def get_policy(body, opts = {}) data end - # Get Policy - # Get details about a Policy + # Get policy + # Get details about a policy. # @param body # @param [Hash] opts the optional parameters # @return [Array<(GetPolicyResponse, Integer, Hash)>] GetPolicyResponse data, response status code and response headers @@ -305,8 +421,124 @@ def get_policy_with_http_info(body, opts = {}) end return data, status_code, headers end - # Update Policy - # Update an existing Policy + # Get smart contract interface + # Get details about a smart contract interface. + # @param body + # @param [Hash] opts the optional parameters + # @return [GetSmartContractInterfaceResponse] + def get_smart_contract_interface(body, opts = {}) + data, _status_code, _headers = get_smart_contract_interface_with_http_info(body, opts) + data + end + + # Get smart contract interface + # Get details about a smart contract interface. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(GetSmartContractInterfaceResponse, Integer, Hash)>] GetSmartContractInterfaceResponse data, response status code and response headers + def get_smart_contract_interface_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PoliciesApi.get_smart_contract_interface ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling PoliciesApi.get_smart_contract_interface" + end + # resource path + local_var_path = '/public/v1/query/get_smart_contract_interface' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + return_type = opts[:return_type] || 'GetSmartContractInterfaceResponse' + + auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type) + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PoliciesApi#get_smart_contract_interface\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List smart contract interfaces + # List all smart contract interfaces within an organization. + # @param body + # @param [Hash] opts the optional parameters + # @return [GetSmartContractInterfacesResponse] + def get_smart_contract_interfaces(body, opts = {}) + data, _status_code, _headers = get_smart_contract_interfaces_with_http_info(body, opts) + data + end + + # List smart contract interfaces + # List all smart contract interfaces within an organization. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(GetSmartContractInterfacesResponse, Integer, Hash)>] GetSmartContractInterfacesResponse data, response status code and response headers + def get_smart_contract_interfaces_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PoliciesApi.get_smart_contract_interfaces ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling PoliciesApi.get_smart_contract_interfaces" + end + # resource path + local_var_path = '/public/v1/query/list_smart_contract_interfaces' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + return_type = opts[:return_type] || 'GetSmartContractInterfacesResponse' + + auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type) + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PoliciesApi#get_smart_contract_interfaces\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update policy + # Update an existing policy. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -315,8 +547,8 @@ def update_policy(body, opts = {}) data end - # Update Policy - # Update an existing Policy + # Update policy + # Update an existing policy. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers diff --git a/turnkey_client/lib/turnkey_client/api/private_key_tags_api.rb b/turnkey_client/lib/turnkey_client/api/private_key_tags_api.rb index e93759b..6a72352 100644 --- a/turnkey_client/lib/turnkey_client/api/private_key_tags_api.rb +++ b/turnkey_client/lib/turnkey_client/api/private_key_tags_api.rb @@ -15,7 +15,7 @@ class PrivateKeyTagsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create Private Key Tag + # Create private key tag # Create a private key tag and add it to private keys. # @param body # @param [Hash] opts the optional parameters @@ -25,7 +25,7 @@ def create_private_key_tag(body, opts = {}) data end - # Create Private Key Tag + # Create private key tag # Create a private key tag and add it to private keys. # @param body # @param [Hash] opts the optional parameters @@ -73,8 +73,8 @@ def create_private_key_tag_with_http_info(body, opts = {}) end return data, status_code, headers end - # Delete Private Key Tags - # Delete Private Key Tags within an Organization + # Delete private key tags + # Delete private key tags within an organization. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -83,8 +83,8 @@ def delete_private_key_tags(body, opts = {}) data end - # Delete Private Key Tags - # Delete Private Key Tags within an Organization + # Delete private key tags + # Delete private key tags within an organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -131,8 +131,8 @@ def delete_private_key_tags_with_http_info(body, opts = {}) end return data, status_code, headers end - # List Private Key Tags - # List all Private Key Tags within an Organization + # List private key tags + # List all private key tags within an organization. # @param body # @param [Hash] opts the optional parameters # @return [ListPrivateKeyTagsResponse] @@ -141,8 +141,8 @@ def list_private_key_tags(body, opts = {}) data end - # List Private Key Tags - # List all Private Key Tags within an Organization + # List private key tags + # List all private key tags within an organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ListPrivateKeyTagsResponse, Integer, Hash)>] ListPrivateKeyTagsResponse data, response status code and response headers @@ -189,7 +189,7 @@ def list_private_key_tags_with_http_info(body, opts = {}) end return data, status_code, headers end - # Update Private Key Tag + # Update private key tag # Update human-readable name or associated private keys. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. # @param body # @param [Hash] opts the optional parameters @@ -199,7 +199,7 @@ def update_private_key_tag(body, opts = {}) data end - # Update Private Key Tag + # Update private key tag # Update human-readable name or associated private keys. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. # @param body # @param [Hash] opts the optional parameters diff --git a/turnkey_client/lib/turnkey_client/api/private_keys_api.rb b/turnkey_client/lib/turnkey_client/api/private_keys_api.rb index 44bbf3f..e935574 100644 --- a/turnkey_client/lib/turnkey_client/api/private_keys_api.rb +++ b/turnkey_client/lib/turnkey_client/api/private_keys_api.rb @@ -15,8 +15,8 @@ class PrivateKeysApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create Private Keys - # Create new Private Keys + # Create private keys + # Create new private keys. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -25,8 +25,8 @@ def create_private_keys(body, opts = {}) data end - # Create Private Keys - # Create new Private Keys + # Create private keys + # Create new private keys. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -73,8 +73,8 @@ def create_private_keys_with_http_info(body, opts = {}) end return data, status_code, headers end - # Delete Private Keys - # Deletes private keys for an organization + # Delete private keys + # Delete private keys for an organization. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -83,8 +83,8 @@ def delete_private_keys(body, opts = {}) data end - # Delete Private Keys - # Deletes private keys for an organization + # Delete private keys + # Delete private keys for an organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -131,8 +131,8 @@ def delete_private_keys_with_http_info(body, opts = {}) end return data, status_code, headers end - # Export Private Key - # Exports a Private Key + # Export private key + # Export a private key. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -141,8 +141,8 @@ def export_private_key(body, opts = {}) data end - # Export Private Key - # Exports a Private Key + # Export private key + # Export a private key. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -189,8 +189,8 @@ def export_private_key_with_http_info(body, opts = {}) end return data, status_code, headers end - # Get Private Key - # Get details about a Private Key + # Get private key + # Get details about a private key. # @param body # @param [Hash] opts the optional parameters # @return [GetPrivateKeyResponse] @@ -199,8 +199,8 @@ def get_private_key(body, opts = {}) data end - # Get Private Key - # Get details about a Private Key + # Get private key + # Get details about a private key. # @param body # @param [Hash] opts the optional parameters # @return [Array<(GetPrivateKeyResponse, Integer, Hash)>] GetPrivateKeyResponse data, response status code and response headers @@ -247,8 +247,8 @@ def get_private_key_with_http_info(body, opts = {}) end return data, status_code, headers end - # List Private Keys - # List all Private Keys within an Organization + # List private keys + # List all private keys within an organization. # @param body # @param [Hash] opts the optional parameters # @return [GetPrivateKeysResponse] @@ -257,8 +257,8 @@ def get_private_keys(body, opts = {}) data end - # List Private Keys - # List all Private Keys within an Organization + # List private keys + # List all private keys within an organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(GetPrivateKeysResponse, Integer, Hash)>] GetPrivateKeysResponse data, response status code and response headers @@ -305,8 +305,8 @@ def get_private_keys_with_http_info(body, opts = {}) end return data, status_code, headers end - # Import Private Key - # Imports a private key + # Import private key + # Import a private key. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -315,8 +315,8 @@ def import_private_key(body, opts = {}) data end - # Import Private Key - # Imports a private key + # Import private key + # Import a private key. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -363,8 +363,8 @@ def import_private_key_with_http_info(body, opts = {}) end return data, status_code, headers end - # Init Import Private Key - # Initializes a new private key import + # Init import private key + # Initialize a new private key import. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -373,8 +373,8 @@ def init_import_private_key(body, opts = {}) data end - # Init Import Private Key - # Initializes a new private key import + # Init import private key + # Initialize a new private key import. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers diff --git a/turnkey_client/lib/turnkey_client/api/sessions_api.rb b/turnkey_client/lib/turnkey_client/api/sessions_api.rb index bd6473a..54e1183 100644 --- a/turnkey_client/lib/turnkey_client/api/sessions_api.rb +++ b/turnkey_client/lib/turnkey_client/api/sessions_api.rb @@ -15,8 +15,8 @@ class SessionsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create Read Only Session - # Create a read only session for a user (valid for 1 hour) + # Create read only session + # Create a read only session for a user (valid for 1 hour). # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -25,8 +25,8 @@ def create_read_only_session(body, opts = {}) data end - # Create Read Only Session - # Create a read only session for a user (valid for 1 hour) + # Create read only session + # Create a read only session for a user (valid for 1 hour). # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -73,8 +73,8 @@ def create_read_only_session_with_http_info(body, opts = {}) end return data, status_code, headers end - # Create Read Write Session - # Create a read write session for a user + # Create read write session + # Create a read write session for a user. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -83,8 +83,8 @@ def create_read_write_session(body, opts = {}) data end - # Create Read Write Session - # Create a read write session for a user + # Create read write session + # Create a read write session for a user. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -132,7 +132,7 @@ def create_read_write_session_with_http_info(body, opts = {}) return data, status_code, headers end # Who am I? - # Get basic information about your current API or WebAuthN user and their organization. Affords Sub-Organization look ups via Parent Organization for WebAuthN or API key users. + # Get basic information about your current API or WebAuthN user and their organization. Affords sub-organization look ups via parent organization for WebAuthN or API key users. # @param body # @param [Hash] opts the optional parameters # @return [GetWhoamiResponse] @@ -142,7 +142,7 @@ def get_whoami(body, opts = {}) end # Who am I? - # Get basic information about your current API or WebAuthN user and their organization. Affords Sub-Organization look ups via Parent Organization for WebAuthN or API key users. + # Get basic information about your current API or WebAuthN user and their organization. Affords sub-organization look ups via parent organization for WebAuthN or API key users. # @param body # @param [Hash] opts the optional parameters # @return [Array<(GetWhoamiResponse, Integer, Hash)>] GetWhoamiResponse data, response status code and response headers @@ -189,5 +189,179 @@ def get_whoami_with_http_info(body, opts = {}) end return data, status_code, headers end + # Login with Oauth + # Create an Oauth session for a user. + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def oauth_login(body, opts = {}) + data, _status_code, _headers = oauth_login_with_http_info(body, opts) + data + end + + # Login with Oauth + # Create an Oauth session for a user. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def oauth_login_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SessionsApi.oauth_login ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SessionsApi.oauth_login" + end + # resource path + local_var_path = '/public/v1/submit/oauth_login' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + return_type = opts[:return_type] || 'ActivityResponse' + + auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type) + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SessionsApi#oauth_login\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Login with OTP + # Create an OTP session for a user. + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def otp_login(body, opts = {}) + data, _status_code, _headers = otp_login_with_http_info(body, opts) + data + end + + # Login with OTP + # Create an OTP session for a user. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def otp_login_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SessionsApi.otp_login ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SessionsApi.otp_login" + end + # resource path + local_var_path = '/public/v1/submit/otp_login' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + return_type = opts[:return_type] || 'ActivityResponse' + + auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type) + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SessionsApi#otp_login\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Login with a stamp + # Create a session for a user through stamping client side (API key, wallet client, or passkey client). + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def stamp_login(body, opts = {}) + data, _status_code, _headers = stamp_login_with_http_info(body, opts) + data + end + + # Login with a stamp + # Create a session for a user through stamping client side (API key, wallet client, or passkey client). + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def stamp_login_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SessionsApi.stamp_login ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SessionsApi.stamp_login" + end + # resource path + local_var_path = '/public/v1/submit/stamp_login' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + return_type = opts[:return_type] || 'ActivityResponse' + + auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type) + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SessionsApi#stamp_login\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/turnkey_client/lib/turnkey_client/api/signing_api.rb b/turnkey_client/lib/turnkey_client/api/signing_api.rb index a700054..e6db5d4 100644 --- a/turnkey_client/lib/turnkey_client/api/signing_api.rb +++ b/turnkey_client/lib/turnkey_client/api/signing_api.rb @@ -15,8 +15,8 @@ class SigningApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Sign Raw Payload - # Sign a raw payload + # Sign raw payload + # Sign a raw payload. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -25,8 +25,8 @@ def sign_raw_payload(body, opts = {}) data end - # Sign Raw Payload - # Sign a raw payload + # Sign raw payload + # Sign a raw payload. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -73,8 +73,8 @@ def sign_raw_payload_with_http_info(body, opts = {}) end return data, status_code, headers end - # Sign Raw Payloads - # Sign multiple raw payloads with the same signing parameters + # Sign raw payloads + # Sign multiple raw payloads with the same signing parameters. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -83,8 +83,8 @@ def sign_raw_payloads(body, opts = {}) data end - # Sign Raw Payloads - # Sign multiple raw payloads with the same signing parameters + # Sign raw payloads + # Sign multiple raw payloads with the same signing parameters. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -131,8 +131,8 @@ def sign_raw_payloads_with_http_info(body, opts = {}) end return data, status_code, headers end - # Sign Transaction - # Sign a transaction + # Sign transaction + # Sign a transaction. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -141,8 +141,8 @@ def sign_transaction(body, opts = {}) data end - # Sign Transaction - # Sign a transaction + # Sign transaction + # Sign a transaction. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers diff --git a/turnkey_client/lib/turnkey_client/api/user_auth_api.rb b/turnkey_client/lib/turnkey_client/api/user_auth_api.rb index b20deea..b082a71 100644 --- a/turnkey_client/lib/turnkey_client/api/user_auth_api.rb +++ b/turnkey_client/lib/turnkey_client/api/user_auth_api.rb @@ -15,8 +15,8 @@ class UserAuthApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create Oauth Providers - # Creates Oauth providers for a specified user - BETA + # Create Oauth providers + # Create Oauth providers for a specified user. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -25,8 +25,8 @@ def create_oauth_providers(body, opts = {}) data end - # Create Oauth Providers - # Creates Oauth providers for a specified user - BETA + # Create Oauth providers + # Create Oauth providers for a specified user. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -73,8 +73,8 @@ def create_oauth_providers_with_http_info(body, opts = {}) end return data, status_code, headers end - # Delete Oauth Providers - # Removes Oauth providers for a specified user - BETA + # Delete Oauth providers + # Remove Oauth providers for a specified user. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -83,8 +83,8 @@ def delete_oauth_providers(body, opts = {}) data end - # Delete Oauth Providers - # Removes Oauth providers for a specified user - BETA + # Delete Oauth providers + # Remove Oauth providers for a specified user. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -131,8 +131,8 @@ def delete_oauth_providers_with_http_info(body, opts = {}) end return data, status_code, headers end - # Perform Email Auth - # Authenticate a user via Email + # Perform email auth + # Authenticate a user via email. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -141,8 +141,8 @@ def email_auth(body, opts = {}) data end - # Perform Email Auth - # Authenticate a user via Email + # Perform email auth + # Authenticate a user via email. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -190,7 +190,7 @@ def email_auth_with_http_info(body, opts = {}) return data, status_code, headers end # Get Oauth providers - # Get details about Oauth providers for a user + # Get details about Oauth providers for a user. # @param body # @param [Hash] opts the optional parameters # @return [GetOauthProvidersResponse] @@ -200,7 +200,7 @@ def get_oauth_providers(body, opts = {}) end # Get Oauth providers - # Get details about Oauth providers for a user + # Get details about Oauth providers for a user. # @param body # @param [Hash] opts the optional parameters # @return [Array<(GetOauthProvidersResponse, Integer, Hash)>] GetOauthProvidersResponse data, response status code and response headers @@ -248,7 +248,7 @@ def get_oauth_providers_with_http_info(body, opts = {}) return data, status_code, headers end # Init OTP auth - # Initiate an OTP auth activity + # Initiate an OTP auth activity. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -258,7 +258,7 @@ def init_otp_auth(body, opts = {}) end # Init OTP auth - # Initiate an OTP auth activity + # Initiate an OTP auth activity. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -306,7 +306,7 @@ def init_otp_auth_with_http_info(body, opts = {}) return data, status_code, headers end # Oauth - # Authenticate a user with an Oidc token (Oauth) - BETA + # Authenticate a user with an OIDC token (Oauth). # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -316,7 +316,7 @@ def oauth(body, opts = {}) end # Oauth - # Authenticate a user with an Oidc token (Oauth) - BETA + # Authenticate a user with an OIDC token (Oauth). # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -364,7 +364,7 @@ def oauth_with_http_info(body, opts = {}) return data, status_code, headers end # OTP auth - # Authenticate a user with an OTP code sent via email or SMS + # Authenticate a user with an OTP code sent via email or SMS. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -374,7 +374,7 @@ def otp_auth(body, opts = {}) end # OTP auth - # Authenticate a user with an OTP code sent via email or SMS + # Authenticate a user with an OTP code sent via email or SMS. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers diff --git a/turnkey_client/lib/turnkey_client/api/user_recovery_api.rb b/turnkey_client/lib/turnkey_client/api/user_recovery_api.rb index e9d754e..df95517 100644 --- a/turnkey_client/lib/turnkey_client/api/user_recovery_api.rb +++ b/turnkey_client/lib/turnkey_client/api/user_recovery_api.rb @@ -15,8 +15,8 @@ class UserRecoveryApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Init Email Recovery - # Initializes a new email recovery + # Init email recovery + # Initialize a new email recovery. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -25,8 +25,8 @@ def init_user_email_recovery(body, opts = {}) data end - # Init Email Recovery - # Initializes a new email recovery + # Init email recovery + # Initialize a new email recovery. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -74,7 +74,7 @@ def init_user_email_recovery_with_http_info(body, opts = {}) return data, status_code, headers end # Recover a user - # Completes the process of recovering a user by adding an authenticator + # Complete the process of recovering a user by adding an authenticator. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -84,7 +84,7 @@ def recover_user(body, opts = {}) end # Recover a user - # Completes the process of recovering a user by adding an authenticator + # Complete the process of recovering a user by adding an authenticator. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers diff --git a/turnkey_client/lib/turnkey_client/api/user_tags_api.rb b/turnkey_client/lib/turnkey_client/api/user_tags_api.rb index 7449184..b2eb154 100644 --- a/turnkey_client/lib/turnkey_client/api/user_tags_api.rb +++ b/turnkey_client/lib/turnkey_client/api/user_tags_api.rb @@ -15,7 +15,7 @@ class UserTagsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create User Tag + # Create user tag # Create a user tag and add it to users. # @param body # @param [Hash] opts the optional parameters @@ -25,7 +25,7 @@ def create_user_tag(body, opts = {}) data end - # Create User Tag + # Create user tag # Create a user tag and add it to users. # @param body # @param [Hash] opts the optional parameters @@ -73,8 +73,8 @@ def create_user_tag_with_http_info(body, opts = {}) end return data, status_code, headers end - # Delete User Tags - # Delete User Tags within an Organization + # Delete user tags + # Delete user tags within an organization. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -83,8 +83,8 @@ def delete_user_tags(body, opts = {}) data end - # Delete User Tags - # Delete User Tags within an Organization + # Delete user tags + # Delete user tags within an organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -131,8 +131,8 @@ def delete_user_tags_with_http_info(body, opts = {}) end return data, status_code, headers end - # List User Tags - # List all User Tags within an Organization + # List user tags + # List all user tags within an organization. # @param body # @param [Hash] opts the optional parameters # @return [ListUserTagsResponse] @@ -141,8 +141,8 @@ def list_user_tags(body, opts = {}) data end - # List User Tags - # List all User Tags within an Organization + # List user tags + # List all user tags within an organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ListUserTagsResponse, Integer, Hash)>] ListUserTagsResponse data, response status code and response headers @@ -189,7 +189,7 @@ def list_user_tags_with_http_info(body, opts = {}) end return data, status_code, headers end - # Update User Tag + # Update user tag # Update human-readable name or associated users. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. # @param body # @param [Hash] opts the optional parameters @@ -199,7 +199,7 @@ def update_user_tag(body, opts = {}) data end - # Update User Tag + # Update user tag # Update human-readable name or associated users. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. # @param body # @param [Hash] opts the optional parameters diff --git a/turnkey_client/lib/turnkey_client/api/user_verification_api.rb b/turnkey_client/lib/turnkey_client/api/user_verification_api.rb new file mode 100644 index 0000000..01137f6 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/api/user_verification_api.rb @@ -0,0 +1,135 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +module TurnkeyClient + class UserVerificationApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Init generic OTP + # Initiate a generic OTP activity. + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def init_otp(body, opts = {}) + data, _status_code, _headers = init_otp_with_http_info(body, opts) + data + end + + # Init generic OTP + # Initiate a generic OTP activity. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def init_otp_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserVerificationApi.init_otp ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling UserVerificationApi.init_otp" + end + # resource path + local_var_path = '/public/v1/submit/init_otp' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + return_type = opts[:return_type] || 'ActivityResponse' + + auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type) + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserVerificationApi#init_otp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Verify generic OTP + # Verify a generic OTP. + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def verify_otp(body, opts = {}) + data, _status_code, _headers = verify_otp_with_http_info(body, opts) + data + end + + # Verify generic OTP + # Verify a generic OTP. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def verify_otp_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserVerificationApi.verify_otp ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling UserVerificationApi.verify_otp" + end + # resource path + local_var_path = '/public/v1/submit/verify_otp' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + return_type = opts[:return_type] || 'ActivityResponse' + + auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type) + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserVerificationApi#verify_otp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/turnkey_client/lib/turnkey_client/api/users_api.rb b/turnkey_client/lib/turnkey_client/api/users_api.rb index 74ad51a..b1a8350 100644 --- a/turnkey_client/lib/turnkey_client/api/users_api.rb +++ b/turnkey_client/lib/turnkey_client/api/users_api.rb @@ -15,8 +15,8 @@ class UsersApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create Users - # Create Users in an existing Organization + # Create users + # Create users in an existing organization. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -25,8 +25,8 @@ def create_users(body, opts = {}) data end - # Create Users - # Create Users in an existing Organization + # Create users + # Create users in an existing organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -73,8 +73,8 @@ def create_users_with_http_info(body, opts = {}) end return data, status_code, headers end - # Delete Users - # Delete Users within an Organization + # Delete users + # Delete users within an organization. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -83,8 +83,8 @@ def delete_users(body, opts = {}) data end - # Delete Users - # Delete Users within an Organization + # Delete users + # Delete users within an organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -131,8 +131,8 @@ def delete_users_with_http_info(body, opts = {}) end return data, status_code, headers end - # Get User - # Get details about a User + # Get user + # Get details about a user. # @param body # @param [Hash] opts the optional parameters # @return [GetUserResponse] @@ -141,8 +141,8 @@ def get_user(body, opts = {}) data end - # Get User - # Get details about a User + # Get user + # Get details about a user. # @param body # @param [Hash] opts the optional parameters # @return [Array<(GetUserResponse, Integer, Hash)>] GetUserResponse data, response status code and response headers @@ -189,8 +189,8 @@ def get_user_with_http_info(body, opts = {}) end return data, status_code, headers end - # List Users - # List all Users within an Organization + # List users + # List all users within an organization. # @param body # @param [Hash] opts the optional parameters # @return [GetUsersResponse] @@ -199,8 +199,8 @@ def get_users(body, opts = {}) data end - # List Users - # List all Users within an Organization + # List users + # List all users within an organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(GetUsersResponse, Integer, Hash)>] GetUsersResponse data, response status code and response headers @@ -247,8 +247,8 @@ def get_users_with_http_info(body, opts = {}) end return data, status_code, headers end - # Update User - # Update a User in an existing Organization + # Update user + # Update a user in an existing organization. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -257,8 +257,8 @@ def update_user(body, opts = {}) data end - # Update User - # Update a User in an existing Organization + # Update user + # Update a user in an existing organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -305,5 +305,179 @@ def update_user_with_http_info(body, opts = {}) end return data, status_code, headers end + # Update user's email + # Update a user's email in an existing organization. + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def update_user_email(body, opts = {}) + data, _status_code, _headers = update_user_email_with_http_info(body, opts) + data + end + + # Update user's email + # Update a user's email in an existing organization. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def update_user_email_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UsersApi.update_user_email ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.update_user_email" + end + # resource path + local_var_path = '/public/v1/submit/update_user_email' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + return_type = opts[:return_type] || 'ActivityResponse' + + auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type) + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UsersApi#update_user_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update user's name + # Update a user's name in an existing organization. + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def update_user_name(body, opts = {}) + data, _status_code, _headers = update_user_name_with_http_info(body, opts) + data + end + + # Update user's name + # Update a user's name in an existing organization. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def update_user_name_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UsersApi.update_user_name ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.update_user_name" + end + # resource path + local_var_path = '/public/v1/submit/update_user_name' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + return_type = opts[:return_type] || 'ActivityResponse' + + auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type) + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UsersApi#update_user_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update user's phone number + # Update a user's phone number in an existing organization. + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def update_user_phone_number(body, opts = {}) + data, _status_code, _headers = update_user_phone_number_with_http_info(body, opts) + data + end + + # Update user's phone number + # Update a user's phone number in an existing organization. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def update_user_phone_number_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UsersApi.update_user_phone_number ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.update_user_phone_number" + end + # resource path + local_var_path = '/public/v1/submit/update_user_phone_number' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + return_type = opts[:return_type] || 'ActivityResponse' + + auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type) + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UsersApi#update_user_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/turnkey_client/lib/turnkey_client/api/wallets_api.rb b/turnkey_client/lib/turnkey_client/api/wallets_api.rb index c77d8ab..8733e9f 100644 --- a/turnkey_client/lib/turnkey_client/api/wallets_api.rb +++ b/turnkey_client/lib/turnkey_client/api/wallets_api.rb @@ -15,8 +15,8 @@ class WalletsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create Wallet - # Create a Wallet and derive addresses + # Create wallet + # Create a wallet and derive addresses. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -25,8 +25,8 @@ def create_wallet(body, opts = {}) data end - # Create Wallet - # Create a Wallet and derive addresses + # Create wallet + # Create a wallet and derive addresses. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -73,8 +73,8 @@ def create_wallet_with_http_info(body, opts = {}) end return data, status_code, headers end - # Create Wallet Accounts - # Derive additional addresses using an existing wallet + # Create wallet accounts + # Derive additional addresses using an existing wallet. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -83,8 +83,8 @@ def create_wallet_accounts(body, opts = {}) data end - # Create Wallet Accounts - # Derive additional addresses using an existing wallet + # Create wallet accounts + # Derive additional addresses using an existing wallet. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -131,8 +131,8 @@ def create_wallet_accounts_with_http_info(body, opts = {}) end return data, status_code, headers end - # Delete Wallets - # Deletes wallets for an organization + # Delete wallets + # Delete wallets for an organization. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -141,8 +141,8 @@ def delete_wallets(body, opts = {}) data end - # Delete Wallets - # Deletes wallets for an organization + # Delete wallets + # Delete wallets for an organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -189,8 +189,8 @@ def delete_wallets_with_http_info(body, opts = {}) end return data, status_code, headers end - # Export Wallet - # Exports a Wallet + # Export wallet + # Export a wallet. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -199,8 +199,8 @@ def export_wallet(body, opts = {}) data end - # Export Wallet - # Exports a Wallet + # Export wallet + # Export a wallet. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -247,8 +247,8 @@ def export_wallet_with_http_info(body, opts = {}) end return data, status_code, headers end - # Export Wallet Account - # Exports a Wallet Account + # Export wallet account + # Export a wallet account. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -257,8 +257,8 @@ def export_wallet_account(body, opts = {}) data end - # Export Wallet Account - # Exports a Wallet Account + # Export wallet account + # Export a wallet account. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -305,8 +305,8 @@ def export_wallet_account_with_http_info(body, opts = {}) end return data, status_code, headers end - # Get Wallet - # Get details about a Wallet + # Get wallet + # Get details about a wallet. # @param body # @param [Hash] opts the optional parameters # @return [GetWalletResponse] @@ -315,8 +315,8 @@ def get_wallet(body, opts = {}) data end - # Get Wallet - # Get details about a Wallet + # Get wallet + # Get details about a wallet. # @param body # @param [Hash] opts the optional parameters # @return [Array<(GetWalletResponse, Integer, Hash)>] GetWalletResponse data, response status code and response headers @@ -363,8 +363,8 @@ def get_wallet_with_http_info(body, opts = {}) end return data, status_code, headers end - # Get Wallet Account - # Get a single wallet account + # Get wallet account + # Get a single wallet account. # @param body # @param [Hash] opts the optional parameters # @return [GetWalletAccountResponse] @@ -373,8 +373,8 @@ def get_wallet_account(body, opts = {}) data end - # Get Wallet Account - # Get a single wallet account + # Get wallet account + # Get a single wallet account. # @param body # @param [Hash] opts the optional parameters # @return [Array<(GetWalletAccountResponse, Integer, Hash)>] GetWalletAccountResponse data, response status code and response headers @@ -421,8 +421,8 @@ def get_wallet_account_with_http_info(body, opts = {}) end return data, status_code, headers end - # List Wallets Accounts - # List all Accounts within a Wallet + # List wallets accounts + # List all accounts within a wallet. # @param body # @param [Hash] opts the optional parameters # @return [GetWalletAccountsResponse] @@ -431,8 +431,8 @@ def get_wallet_accounts(body, opts = {}) data end - # List Wallets Accounts - # List all Accounts within a Wallet + # List wallets accounts + # List all accounts within a wallet. # @param body # @param [Hash] opts the optional parameters # @return [Array<(GetWalletAccountsResponse, Integer, Hash)>] GetWalletAccountsResponse data, response status code and response headers @@ -479,8 +479,8 @@ def get_wallet_accounts_with_http_info(body, opts = {}) end return data, status_code, headers end - # List Wallets - # List all Wallets within an Organization + # List wallets + # List all wallets within an organization. # @param body # @param [Hash] opts the optional parameters # @return [GetWalletsResponse] @@ -489,8 +489,8 @@ def get_wallets(body, opts = {}) data end - # List Wallets - # List all Wallets within an Organization + # List wallets + # List all wallets within an organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(GetWalletsResponse, Integer, Hash)>] GetWalletsResponse data, response status code and response headers @@ -537,8 +537,8 @@ def get_wallets_with_http_info(body, opts = {}) end return data, status_code, headers end - # Import Wallet - # Imports a wallet + # Import wallet + # Import a wallet. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -547,8 +547,8 @@ def import_wallet(body, opts = {}) data end - # Import Wallet - # Imports a wallet + # Import wallet + # Import a wallet. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -595,8 +595,8 @@ def import_wallet_with_http_info(body, opts = {}) end return data, status_code, headers end - # Init Import Wallet - # Initializes a new wallet import + # Init import wallet + # Initialize a new wallet import. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -605,8 +605,8 @@ def init_import_wallet(body, opts = {}) data end - # Init Import Wallet - # Initializes a new wallet import + # Init import wallet + # Initialize a new wallet import. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers @@ -653,8 +653,8 @@ def init_import_wallet_with_http_info(body, opts = {}) end return data, status_code, headers end - # Update Wallet - # Update a wallet for an organization + # Update wallet + # Update a wallet for an organization. # @param body # @param [Hash] opts the optional parameters # @return [ActivityResponse] @@ -663,8 +663,8 @@ def update_wallet(body, opts = {}) data end - # Update Wallet - # Update a wallet for an organization + # Update wallet + # Update a wallet for an organization. # @param body # @param [Hash] opts the optional parameters # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers diff --git a/turnkey_client/lib/turnkey_client/models/activity_type.rb b/turnkey_client/lib/turnkey_client/models/activity_type.rb index 6d99a81..cf9e980 100644 --- a/turnkey_client/lib/turnkey_client/models/activity_type.rb +++ b/turnkey_client/lib/turnkey_client/models/activity_type.rb @@ -92,6 +92,20 @@ class ActivityType OTP_AUTH = 'ACTIVITY_TYPE_OTP_AUTH'.freeze CREATE_SUB_ORGANIZATION_V7 = 'ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7'.freeze UPDATE_WALLET = 'ACTIVITY_TYPE_UPDATE_WALLET'.freeze + UPDATE_POLICY_V2 = 'ACTIVITY_TYPE_UPDATE_POLICY_V2'.freeze + CREATE_USERS_V3 = 'ACTIVITY_TYPE_CREATE_USERS_V3'.freeze + INIT_OTP_AUTH_V2 = 'ACTIVITY_TYPE_INIT_OTP_AUTH_V2'.freeze + INIT_OTP = 'ACTIVITY_TYPE_INIT_OTP'.freeze + VERIFY_OTP = 'ACTIVITY_TYPE_VERIFY_OTP'.freeze + OTP_LOGIN = 'ACTIVITY_TYPE_OTP_LOGIN'.freeze + STAMP_LOGIN = 'ACTIVITY_TYPE_STAMP_LOGIN'.freeze + OAUTH_LOGIN = 'ACTIVITY_TYPE_OAUTH_LOGIN'.freeze + UPDATE_USER_NAME = 'ACTIVITY_TYPE_UPDATE_USER_NAME'.freeze + UPDATE_USER_EMAIL = 'ACTIVITY_TYPE_UPDATE_USER_EMAIL'.freeze + UPDATE_USER_PHONE_NUMBER = 'ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER'.freeze + INIT_FIAT_ON_RAMP = 'ACTIVITY_TYPE_INIT_FIAT_ON_RAMP'.freeze + CREATE_SMART_CONTRACT_INTERFACE = 'ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE'.freeze + DELETE_SMART_CONTRACT_INTERFACE = 'ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE'.freeze # Builds the enum from string # @param [String] The enum value in the form of the string diff --git a/turnkey_client/lib/turnkey_client/models/activity_v1_policy_evaluation.rb b/turnkey_client/lib/turnkey_client/models/activity_v1_policy_evaluation.rb new file mode 100644 index 0000000..3ec77d7 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/activity_v1_policy_evaluation.rb @@ -0,0 +1,287 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class ActivityV1PolicyEvaluation + # Unique identifier for a given policy evaluation. + attr_accessor :id + + # Unique identifier for a given Activity. + attr_accessor :activity_id + + # Unique identifier for the Organization the Activity belongs to. + attr_accessor :organization_id + + # Unique identifier for the Vote associated with this policy evaluation. + attr_accessor :vote_id + + # Detailed evaluation result for each Policy that was run. + attr_accessor :policy_evaluations + + attr_accessor :created_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'activity_id' => :'activityId', + :'organization_id' => :'organizationId', + :'vote_id' => :'voteId', + :'policy_evaluations' => :'policyEvaluations', + :'created_at' => :'createdAt' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'Object', + :'activity_id' => :'Object', + :'organization_id' => :'Object', + :'vote_id' => :'Object', + :'policy_evaluations' => :'Object', + :'created_at' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::ActivityV1PolicyEvaluation` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::ActivityV1PolicyEvaluation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'activity_id') + self.activity_id = attributes[:'activity_id'] + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'vote_id') + self.vote_id = attributes[:'vote_id'] + end + + if attributes.key?(:'policy_evaluations') + if (value = attributes[:'policy_evaluations']).is_a?(Array) + self.policy_evaluations = value + end + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @activity_id.nil? + invalid_properties.push('invalid value for "activity_id", activity_id cannot be nil.') + end + + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @vote_id.nil? + invalid_properties.push('invalid value for "vote_id", vote_id cannot be nil.') + end + + if @policy_evaluations.nil? + invalid_properties.push('invalid value for "policy_evaluations", policy_evaluations cannot be nil.') + end + + if @created_at.nil? + invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @id.nil? + return false if @activity_id.nil? + return false if @organization_id.nil? + return false if @vote_id.nil? + return false if @policy_evaluations.nil? + return false if @created_at.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + activity_id == o.activity_id && + organization_id == o.organization_id && + vote_id == o.vote_id && + policy_evaluations == o.policy_evaluations && + created_at == o.created_at + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, activity_id, organization_id, vote_id, policy_evaluations, created_at].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/address_format.rb b/turnkey_client/lib/turnkey_client/models/address_format.rb index 959d093..00d0b78 100644 --- a/turnkey_client/lib/turnkey_client/models/address_format.rb +++ b/turnkey_client/lib/turnkey_client/models/address_format.rb @@ -46,6 +46,7 @@ class AddressFormat DOGE_TESTNET = 'ADDRESS_FORMAT_DOGE_TESTNET'.freeze TON_V3_R2 = 'ADDRESS_FORMAT_TON_V3R2'.freeze TON_V4_R2 = 'ADDRESS_FORMAT_TON_V4R2'.freeze + TON_V5_R1 = 'ADDRESS_FORMAT_TON_V5R1'.freeze XRP = 'ADDRESS_FORMAT_XRP'.freeze # Builds the enum from string diff --git a/turnkey_client/lib/turnkey_client/models/api_key.rb b/turnkey_client/lib/turnkey_client/models/api_key.rb index 00a417b..0a8cf3e 100644 --- a/turnkey_client/lib/turnkey_client/models/api_key.rb +++ b/turnkey_client/lib/turnkey_client/models/api_key.rb @@ -54,6 +54,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'expiration_seconds' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/api_key_params.rb b/turnkey_client/lib/turnkey_client/models/api_key_params.rb index 8536ee7..8e72206 100644 --- a/turnkey_client/lib/turnkey_client/models/api_key_params.rb +++ b/turnkey_client/lib/turnkey_client/models/api_key_params.rb @@ -42,6 +42,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'expiration_seconds' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/api_key_params_v2.rb b/turnkey_client/lib/turnkey_client/models/api_key_params_v2.rb index b23a471..576c8c4 100644 --- a/turnkey_client/lib/turnkey_client/models/api_key_params_v2.rb +++ b/turnkey_client/lib/turnkey_client/models/api_key_params_v2.rb @@ -46,6 +46,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'expiration_seconds' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/api_only_user_params.rb b/turnkey_client/lib/turnkey_client/models/api_only_user_params.rb index 97e8556..c74df52 100644 --- a/turnkey_client/lib/turnkey_client/models/api_only_user_params.rb +++ b/turnkey_client/lib/turnkey_client/models/api_only_user_params.rb @@ -18,10 +18,10 @@ class ApiOnlyUserParams # The email address for this API-only User (optional). attr_accessor :user_email - # A list of tags assigned to the new API-only User. + # A list of tags assigned to the new API-only User. This field, if not needed, should be an empty array in your request body. attr_accessor :user_tags - # A list of API Key parameters. + # A list of API Key parameters. This field, if not needed, should be an empty array in your request body. attr_accessor :api_keys # Attribute mapping from ruby-style variable name to JSON key. @@ -47,6 +47,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'user_email', ]) end diff --git a/turnkey_client/lib/turnkey_client/models/create_organization_intent.rb b/turnkey_client/lib/turnkey_client/models/create_organization_intent.rb index c46c5b5..46329b4 100644 --- a/turnkey_client/lib/turnkey_client/models/create_organization_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/create_organization_intent.rb @@ -46,6 +46,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'root_user_id' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/create_organization_intent_v2.rb b/turnkey_client/lib/turnkey_client/models/create_organization_intent_v2.rb index d0b0b18..1a1ac31 100644 --- a/turnkey_client/lib/turnkey_client/models/create_organization_intent_v2.rb +++ b/turnkey_client/lib/turnkey_client/models/create_organization_intent_v2.rb @@ -46,6 +46,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'root_user_id' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/create_policy_intent_v3.rb b/turnkey_client/lib/turnkey_client/models/create_policy_intent_v3.rb index 38d047a..d225176 100644 --- a/turnkey_client/lib/turnkey_client/models/create_policy_intent_v3.rb +++ b/turnkey_client/lib/turnkey_client/models/create_policy_intent_v3.rb @@ -50,6 +50,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'condition', + :'consensus', ]) end diff --git a/turnkey_client/lib/turnkey_client/models/create_read_write_session_intent.rb b/turnkey_client/lib/turnkey_client/models/create_read_write_session_intent.rb index 336a5c1..890b399 100644 --- a/turnkey_client/lib/turnkey_client/models/create_read_write_session_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/create_read_write_session_intent.rb @@ -21,7 +21,7 @@ class CreateReadWriteSessionIntent # Optional human-readable name for an API Key. If none provided, default to Read Write Session - attr_accessor :api_key_name - # Expiration window (in seconds) indicating how long the API key is valid. If not provided, a default of 15 minutes will be used. + # Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. attr_accessor :expiration_seconds # Attribute mapping from ruby-style variable name to JSON key. @@ -47,6 +47,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'api_key_name', + :'expiration_seconds' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/create_read_write_session_intent_v2.rb b/turnkey_client/lib/turnkey_client/models/create_read_write_session_intent_v2.rb index 4f10acd..31fe1de 100644 --- a/turnkey_client/lib/turnkey_client/models/create_read_write_session_intent_v2.rb +++ b/turnkey_client/lib/turnkey_client/models/create_read_write_session_intent_v2.rb @@ -21,16 +21,20 @@ class CreateReadWriteSessionIntentV2 # Optional human-readable name for an API Key. If none provided, default to Read Write Session - attr_accessor :api_key_name - # Expiration window (in seconds) indicating how long the API key is valid. If not provided, a default of 15 minutes will be used. + # Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. attr_accessor :expiration_seconds + # Invalidate all other previously generated ReadWriteSession API keys + attr_accessor :invalidate_existing + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'target_public_key' => :'targetPublicKey', :'user_id' => :'userId', :'api_key_name' => :'apiKeyName', - :'expiration_seconds' => :'expirationSeconds' + :'expiration_seconds' => :'expirationSeconds', + :'invalidate_existing' => :'invalidateExisting' } end @@ -40,13 +44,18 @@ def self.openapi_types :'target_public_key' => :'Object', :'user_id' => :'Object', :'api_key_name' => :'Object', - :'expiration_seconds' => :'Object' + :'expiration_seconds' => :'Object', + :'invalidate_existing' => :'Object' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'user_id', + :'api_key_name', + :'expiration_seconds', + :'invalidate_existing' ]) end @@ -80,6 +89,10 @@ def initialize(attributes = {}) if attributes.key?(:'expiration_seconds') self.expiration_seconds = attributes[:'expiration_seconds'] end + + if attributes.key?(:'invalidate_existing') + self.invalidate_existing = attributes[:'invalidate_existing'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -108,7 +121,8 @@ def ==(o) target_public_key == o.target_public_key && user_id == o.user_id && api_key_name == o.api_key_name && - expiration_seconds == o.expiration_seconds + expiration_seconds == o.expiration_seconds && + invalidate_existing == o.invalidate_existing end # @see the `==` method @@ -120,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [target_public_key, user_id, api_key_name, expiration_seconds].hash + [target_public_key, user_id, api_key_name, expiration_seconds, invalidate_existing].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/create_smart_contract_interface_intent.rb b/turnkey_client/lib/turnkey_client/models/create_smart_contract_interface_intent.rb new file mode 100644 index 0000000..ab9ce8f --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/create_smart_contract_interface_intent.rb @@ -0,0 +1,265 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class CreateSmartContractInterfaceIntent + # Corresponding contract address or program ID + attr_accessor :smart_contract_address + + # ABI/IDL as a JSON string + attr_accessor :smart_contract_interface + + attr_accessor :type + + # Human-readable name for a Smart Contract Interface. + attr_accessor :label + + # Notes for a Smart Contract Interface. + attr_accessor :notes + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'smart_contract_address' => :'smartContractAddress', + :'smart_contract_interface' => :'smartContractInterface', + :'type' => :'type', + :'label' => :'label', + :'notes' => :'notes' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'smart_contract_address' => :'Object', + :'smart_contract_interface' => :'Object', + :'type' => :'Object', + :'label' => :'Object', + :'notes' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::CreateSmartContractInterfaceIntent` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::CreateSmartContractInterfaceIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'smart_contract_address') + self.smart_contract_address = attributes[:'smart_contract_address'] + end + + if attributes.key?(:'smart_contract_interface') + self.smart_contract_interface = attributes[:'smart_contract_interface'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'label') + self.label = attributes[:'label'] + end + + if attributes.key?(:'notes') + self.notes = attributes[:'notes'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @smart_contract_address.nil? + invalid_properties.push('invalid value for "smart_contract_address", smart_contract_address cannot be nil.') + end + + if @smart_contract_interface.nil? + invalid_properties.push('invalid value for "smart_contract_interface", smart_contract_interface cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @label.nil? + invalid_properties.push('invalid value for "label", label cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @smart_contract_address.nil? + return false if @smart_contract_interface.nil? + return false if @type.nil? + return false if @label.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + smart_contract_address == o.smart_contract_address && + smart_contract_interface == o.smart_contract_interface && + type == o.type && + label == o.label && + notes == o.notes + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [smart_contract_address, smart_contract_interface, type, label, notes].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/create_smart_contract_interface_request.rb b/turnkey_client/lib/turnkey_client/models/create_smart_contract_interface_request.rb new file mode 100644 index 0000000..2de35b9 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/create_smart_contract_interface_request.rb @@ -0,0 +1,288 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class CreateSmartContractInterfaceRequest + attr_accessor :type + + # Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + attr_accessor :timestamp_ms + + # Unique identifier for a given Organization. + attr_accessor :organization_id + + attr_accessor :parameters + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'timestamp_ms' => :'timestampMs', + :'organization_id' => :'organizationId', + :'parameters' => :'parameters' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'Object', + :'timestamp_ms' => :'Object', + :'organization_id' => :'Object', + :'parameters' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::CreateSmartContractInterfaceRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::CreateSmartContractInterfaceRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'timestamp_ms') + self.timestamp_ms = attributes[:'timestamp_ms'] + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @timestamp_ms.nil? + invalid_properties.push('invalid value for "timestamp_ms", timestamp_ms cannot be nil.') + end + + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @parameters.nil? + invalid_properties.push('invalid value for "parameters", parameters cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE']) + return false unless type_validator.valid?(@type) + return false if @timestamp_ms.nil? + return false if @organization_id.nil? + return false if @parameters.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE']) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + timestamp_ms == o.timestamp_ms && + organization_id == o.organization_id && + parameters == o.parameters + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, timestamp_ms, organization_id, parameters].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/create_smart_contract_interface_result.rb b/turnkey_client/lib/turnkey_client/models/create_smart_contract_interface_result.rb new file mode 100644 index 0000000..d6dd5a8 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/create_smart_contract_interface_result.rb @@ -0,0 +1,211 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class CreateSmartContractInterfaceResult + # The ID of the created Smart Contract Interface. + attr_accessor :smart_contract_interface_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'smart_contract_interface_id' => :'smartContractInterfaceId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'smart_contract_interface_id' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::CreateSmartContractInterfaceResult` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::CreateSmartContractInterfaceResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'smart_contract_interface_id') + self.smart_contract_interface_id = attributes[:'smart_contract_interface_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @smart_contract_interface_id.nil? + invalid_properties.push('invalid value for "smart_contract_interface_id", smart_contract_interface_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @smart_contract_interface_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + smart_contract_interface_id == o.smart_contract_interface_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [smart_contract_interface_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/create_sub_organization_intent_v4.rb b/turnkey_client/lib/turnkey_client/models/create_sub_organization_intent_v4.rb index af6c343..ba8a4db 100644 --- a/turnkey_client/lib/turnkey_client/models/create_sub_organization_intent_v4.rb +++ b/turnkey_client/lib/turnkey_client/models/create_sub_organization_intent_v4.rb @@ -56,6 +56,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'disable_email_recovery', + :'disable_email_auth' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/create_sub_organization_intent_v5.rb b/turnkey_client/lib/turnkey_client/models/create_sub_organization_intent_v5.rb index e7ac97c..9aa91a9 100644 --- a/turnkey_client/lib/turnkey_client/models/create_sub_organization_intent_v5.rb +++ b/turnkey_client/lib/turnkey_client/models/create_sub_organization_intent_v5.rb @@ -56,6 +56,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'disable_email_recovery', + :'disable_email_auth' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/create_sub_organization_intent_v6.rb b/turnkey_client/lib/turnkey_client/models/create_sub_organization_intent_v6.rb index 6094701..1882f19 100644 --- a/turnkey_client/lib/turnkey_client/models/create_sub_organization_intent_v6.rb +++ b/turnkey_client/lib/turnkey_client/models/create_sub_organization_intent_v6.rb @@ -56,6 +56,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'disable_email_recovery', + :'disable_email_auth' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/create_sub_organization_intent_v7.rb b/turnkey_client/lib/turnkey_client/models/create_sub_organization_intent_v7.rb index 2c21f54..d41bcfe 100644 --- a/turnkey_client/lib/turnkey_client/models/create_sub_organization_intent_v7.rb +++ b/turnkey_client/lib/turnkey_client/models/create_sub_organization_intent_v7.rb @@ -66,6 +66,10 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'disable_email_recovery', + :'disable_email_auth', + :'disable_sms_auth', + :'disable_otp_email_auth' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/create_users_intent_v3.rb b/turnkey_client/lib/turnkey_client/models/create_users_intent_v3.rb new file mode 100644 index 0000000..1c3d0b0 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/create_users_intent_v3.rb @@ -0,0 +1,213 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class CreateUsersIntentV3 + # A list of Users. + attr_accessor :users + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'users' => :'users' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'users' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::CreateUsersIntentV3` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::CreateUsersIntentV3`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'users') + if (value = attributes[:'users']).is_a?(Array) + self.users = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @users.nil? + invalid_properties.push('invalid value for "users", users cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @users.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + users == o.users + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [users].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/create_users_request.rb b/turnkey_client/lib/turnkey_client/models/create_users_request.rb index 4728495..7e0f9b5 100644 --- a/turnkey_client/lib/turnkey_client/models/create_users_request.rb +++ b/turnkey_client/lib/turnkey_client/models/create_users_request.rb @@ -129,7 +129,7 @@ def list_invalid_properties # @return true if the model is valid def valid? return false if @type.nil? - type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_USERS_V2']) + type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_USERS_V3']) return false unless type_validator.valid?(@type) return false if @timestamp_ms.nil? return false if @organization_id.nil? @@ -140,7 +140,7 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_USERS_V2']) + validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_USERS_V3']) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end diff --git a/turnkey_client/lib/turnkey_client/models/create_wallet_intent.rb b/turnkey_client/lib/turnkey_client/models/create_wallet_intent.rb index 9746b58..ec23243 100644 --- a/turnkey_client/lib/turnkey_client/models/create_wallet_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/create_wallet_intent.rb @@ -15,7 +15,7 @@ class CreateWalletIntent # Human-readable name for a Wallet. attr_accessor :wallet_name - # A list of wallet Accounts. + # A list of wallet Accounts. This field, if not needed, should be an empty array in your request body. attr_accessor :accounts # Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24. @@ -42,6 +42,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'mnemonic_length' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/credential_type.rb b/turnkey_client/lib/turnkey_client/models/credential_type.rb index 349ed1f..4e0e610 100644 --- a/turnkey_client/lib/turnkey_client/models/credential_type.rb +++ b/turnkey_client/lib/turnkey_client/models/credential_type.rb @@ -19,6 +19,9 @@ class CredentialType EMAIL_AUTH_KEY_P256 = 'CREDENTIAL_TYPE_EMAIL_AUTH_KEY_P256'.freeze API_KEY_ED25519 = 'CREDENTIAL_TYPE_API_KEY_ED25519'.freeze OTP_AUTH_KEY_P256 = 'CREDENTIAL_TYPE_OTP_AUTH_KEY_P256'.freeze + READ_WRITE_SESSION_KEY_P256 = 'CREDENTIAL_TYPE_READ_WRITE_SESSION_KEY_P256'.freeze + OAUTH_KEY_P256 = 'CREDENTIAL_TYPE_OAUTH_KEY_P256'.freeze + LOGIN = 'CREDENTIAL_TYPE_LOGIN'.freeze # Builds the enum from string # @param [String] The enum value in the form of the string diff --git a/turnkey_client/lib/turnkey_client/models/data_v1_smart_contract_interface.rb b/turnkey_client/lib/turnkey_client/models/data_v1_smart_contract_interface.rb new file mode 100644 index 0000000..60c41aa --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/data_v1_smart_contract_interface.rb @@ -0,0 +1,329 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class DataV1SmartContractInterface + # The Organization the Smart Contract Interface belongs to. + attr_accessor :organization_id + + # Unique identifier for a given Smart Contract Interface (ABI or IDL). + attr_accessor :smart_contract_interface_id + + # The address corresponding to the Smart Contract or Program. + attr_accessor :smart_contract_address + + # The JSON corresponding to the Smart Contract Interface (ABI or IDL). + attr_accessor :smart_contract_interface + + # The type corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA). + attr_accessor :type + + # The label corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA). + attr_accessor :label + + # The notes corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA). + attr_accessor :notes + + attr_accessor :created_at + + attr_accessor :updated_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'organization_id' => :'organizationId', + :'smart_contract_interface_id' => :'smartContractInterfaceId', + :'smart_contract_address' => :'smartContractAddress', + :'smart_contract_interface' => :'smartContractInterface', + :'type' => :'type', + :'label' => :'label', + :'notes' => :'notes', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'organization_id' => :'Object', + :'smart_contract_interface_id' => :'Object', + :'smart_contract_address' => :'Object', + :'smart_contract_interface' => :'Object', + :'type' => :'Object', + :'label' => :'Object', + :'notes' => :'Object', + :'created_at' => :'Object', + :'updated_at' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::DataV1SmartContractInterface` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::DataV1SmartContractInterface`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'smart_contract_interface_id') + self.smart_contract_interface_id = attributes[:'smart_contract_interface_id'] + end + + if attributes.key?(:'smart_contract_address') + self.smart_contract_address = attributes[:'smart_contract_address'] + end + + if attributes.key?(:'smart_contract_interface') + self.smart_contract_interface = attributes[:'smart_contract_interface'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'label') + self.label = attributes[:'label'] + end + + if attributes.key?(:'notes') + self.notes = attributes[:'notes'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @smart_contract_interface_id.nil? + invalid_properties.push('invalid value for "smart_contract_interface_id", smart_contract_interface_id cannot be nil.') + end + + if @smart_contract_address.nil? + invalid_properties.push('invalid value for "smart_contract_address", smart_contract_address cannot be nil.') + end + + if @smart_contract_interface.nil? + invalid_properties.push('invalid value for "smart_contract_interface", smart_contract_interface cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @label.nil? + invalid_properties.push('invalid value for "label", label cannot be nil.') + end + + if @notes.nil? + invalid_properties.push('invalid value for "notes", notes cannot be nil.') + end + + if @created_at.nil? + invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') + end + + if @updated_at.nil? + invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @organization_id.nil? + return false if @smart_contract_interface_id.nil? + return false if @smart_contract_address.nil? + return false if @smart_contract_interface.nil? + return false if @type.nil? + return false if @label.nil? + return false if @notes.nil? + return false if @created_at.nil? + return false if @updated_at.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + organization_id == o.organization_id && + smart_contract_interface_id == o.smart_contract_interface_id && + smart_contract_address == o.smart_contract_address && + smart_contract_interface == o.smart_contract_interface && + type == o.type && + label == o.label && + notes == o.notes && + created_at == o.created_at && + updated_at == o.updated_at + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [organization_id, smart_contract_interface_id, smart_contract_address, smart_contract_interface, type, label, notes, created_at, updated_at].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/delete_payment_method_intent.rb b/turnkey_client/lib/turnkey_client/models/delete_payment_method_intent.rb index 095393f..393ef5e 100644 --- a/turnkey_client/lib/turnkey_client/models/delete_payment_method_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/delete_payment_method_intent.rb @@ -32,6 +32,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'payment_method_id' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/delete_private_keys_intent.rb b/turnkey_client/lib/turnkey_client/models/delete_private_keys_intent.rb index 3ea9757..c600ac0 100644 --- a/turnkey_client/lib/turnkey_client/models/delete_private_keys_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/delete_private_keys_intent.rb @@ -37,6 +37,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'delete_without_export' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/delete_smart_contract_interface_intent.rb b/turnkey_client/lib/turnkey_client/models/delete_smart_contract_interface_intent.rb new file mode 100644 index 0000000..96fb2b7 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/delete_smart_contract_interface_intent.rb @@ -0,0 +1,211 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class DeleteSmartContractInterfaceIntent + # The ID of a Smart Contract Interface intended for deletion. + attr_accessor :smart_contract_interface_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'smart_contract_interface_id' => :'smartContractInterfaceId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'smart_contract_interface_id' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::DeleteSmartContractInterfaceIntent` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::DeleteSmartContractInterfaceIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'smart_contract_interface_id') + self.smart_contract_interface_id = attributes[:'smart_contract_interface_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @smart_contract_interface_id.nil? + invalid_properties.push('invalid value for "smart_contract_interface_id", smart_contract_interface_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @smart_contract_interface_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + smart_contract_interface_id == o.smart_contract_interface_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [smart_contract_interface_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/delete_smart_contract_interface_request.rb b/turnkey_client/lib/turnkey_client/models/delete_smart_contract_interface_request.rb new file mode 100644 index 0000000..adad47a --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/delete_smart_contract_interface_request.rb @@ -0,0 +1,288 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class DeleteSmartContractInterfaceRequest + attr_accessor :type + + # Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + attr_accessor :timestamp_ms + + # Unique identifier for a given Organization. + attr_accessor :organization_id + + attr_accessor :parameters + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'timestamp_ms' => :'timestampMs', + :'organization_id' => :'organizationId', + :'parameters' => :'parameters' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'Object', + :'timestamp_ms' => :'Object', + :'organization_id' => :'Object', + :'parameters' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::DeleteSmartContractInterfaceRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::DeleteSmartContractInterfaceRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'timestamp_ms') + self.timestamp_ms = attributes[:'timestamp_ms'] + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @timestamp_ms.nil? + invalid_properties.push('invalid value for "timestamp_ms", timestamp_ms cannot be nil.') + end + + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @parameters.nil? + invalid_properties.push('invalid value for "parameters", parameters cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE']) + return false unless type_validator.valid?(@type) + return false if @timestamp_ms.nil? + return false if @organization_id.nil? + return false if @parameters.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE']) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + timestamp_ms == o.timestamp_ms && + organization_id == o.organization_id && + parameters == o.parameters + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, timestamp_ms, organization_id, parameters].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/delete_smart_contract_interface_result.rb b/turnkey_client/lib/turnkey_client/models/delete_smart_contract_interface_result.rb new file mode 100644 index 0000000..e80fd82 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/delete_smart_contract_interface_result.rb @@ -0,0 +1,211 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class DeleteSmartContractInterfaceResult + # The ID of the deleted Smart Contract Interface. + attr_accessor :smart_contract_interface_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'smart_contract_interface_id' => :'smartContractInterfaceId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'smart_contract_interface_id' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::DeleteSmartContractInterfaceResult` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::DeleteSmartContractInterfaceResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'smart_contract_interface_id') + self.smart_contract_interface_id = attributes[:'smart_contract_interface_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @smart_contract_interface_id.nil? + invalid_properties.push('invalid value for "smart_contract_interface_id", smart_contract_interface_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @smart_contract_interface_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + smart_contract_interface_id == o.smart_contract_interface_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [smart_contract_interface_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/delete_sub_organization_intent.rb b/turnkey_client/lib/turnkey_client/models/delete_sub_organization_intent.rb index 54a6029..77e8713 100644 --- a/turnkey_client/lib/turnkey_client/models/delete_sub_organization_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/delete_sub_organization_intent.rb @@ -32,6 +32,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'delete_without_export' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/delete_wallets_intent.rb b/turnkey_client/lib/turnkey_client/models/delete_wallets_intent.rb index 4e25891..25016b0 100644 --- a/turnkey_client/lib/turnkey_client/models/delete_wallets_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/delete_wallets_intent.rb @@ -37,6 +37,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'delete_without_export' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/email_auth_intent.rb b/turnkey_client/lib/turnkey_client/models/email_auth_intent.rb index 4241129..1fdc639 100644 --- a/turnkey_client/lib/turnkey_client/models/email_auth_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/email_auth_intent.rb @@ -21,7 +21,7 @@ class EmailAuthIntent # Optional human-readable name for an API Key. If none provided, default to Email Auth - attr_accessor :api_key_name - # Expiration window (in seconds) indicating how long the API key is valid. If not provided, a default of 15 minutes will be used. + # Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. attr_accessor :expiration_seconds attr_accessor :email_customization @@ -32,6 +32,12 @@ class EmailAuthIntent # Optional custom email address from which to send the email attr_accessor :send_from_email_address + # Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' + attr_accessor :send_from_email_sender_name + + # Optional custom email address to use as reply-to + attr_accessor :reply_to_email_address + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -41,7 +47,9 @@ def self.attribute_map :'expiration_seconds' => :'expirationSeconds', :'email_customization' => :'emailCustomization', :'invalidate_existing' => :'invalidateExisting', - :'send_from_email_address' => :'sendFromEmailAddress' + :'send_from_email_address' => :'sendFromEmailAddress', + :'send_from_email_sender_name' => :'sendFromEmailSenderName', + :'reply_to_email_address' => :'replyToEmailAddress' } end @@ -54,13 +62,21 @@ def self.openapi_types :'expiration_seconds' => :'Object', :'email_customization' => :'Object', :'invalidate_existing' => :'Object', - :'send_from_email_address' => :'Object' + :'send_from_email_address' => :'Object', + :'send_from_email_sender_name' => :'Object', + :'reply_to_email_address' => :'Object' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'api_key_name', + :'expiration_seconds', + :'invalidate_existing', + :'send_from_email_address', + :'send_from_email_sender_name', + :'reply_to_email_address' ]) end @@ -106,6 +122,14 @@ def initialize(attributes = {}) if attributes.key?(:'send_from_email_address') self.send_from_email_address = attributes[:'send_from_email_address'] end + + if attributes.key?(:'send_from_email_sender_name') + self.send_from_email_sender_name = attributes[:'send_from_email_sender_name'] + end + + if attributes.key?(:'reply_to_email_address') + self.reply_to_email_address = attributes[:'reply_to_email_address'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -142,7 +166,9 @@ def ==(o) expiration_seconds == o.expiration_seconds && email_customization == o.email_customization && invalidate_existing == o.invalidate_existing && - send_from_email_address == o.send_from_email_address + send_from_email_address == o.send_from_email_address && + send_from_email_sender_name == o.send_from_email_sender_name && + reply_to_email_address == o.reply_to_email_address end # @see the `==` method @@ -154,7 +180,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [email, target_public_key, api_key_name, expiration_seconds, email_customization, invalidate_existing, send_from_email_address].hash + [email, target_public_key, api_key_name, expiration_seconds, email_customization, invalidate_existing, send_from_email_address, send_from_email_sender_name, reply_to_email_address].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/email_auth_intent_v2.rb b/turnkey_client/lib/turnkey_client/models/email_auth_intent_v2.rb index 0392339..80a5acc 100644 --- a/turnkey_client/lib/turnkey_client/models/email_auth_intent_v2.rb +++ b/turnkey_client/lib/turnkey_client/models/email_auth_intent_v2.rb @@ -21,7 +21,7 @@ class EmailAuthIntentV2 # Optional human-readable name for an API Key. If none provided, default to Email Auth - attr_accessor :api_key_name - # Expiration window (in seconds) indicating how long the API key is valid. If not provided, a default of 15 minutes will be used. + # Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. attr_accessor :expiration_seconds attr_accessor :email_customization @@ -32,6 +32,12 @@ class EmailAuthIntentV2 # Optional custom email address from which to send the email attr_accessor :send_from_email_address + # Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' + attr_accessor :send_from_email_sender_name + + # Optional custom email address to use as reply-to + attr_accessor :reply_to_email_address + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -41,7 +47,9 @@ def self.attribute_map :'expiration_seconds' => :'expirationSeconds', :'email_customization' => :'emailCustomization', :'invalidate_existing' => :'invalidateExisting', - :'send_from_email_address' => :'sendFromEmailAddress' + :'send_from_email_address' => :'sendFromEmailAddress', + :'send_from_email_sender_name' => :'sendFromEmailSenderName', + :'reply_to_email_address' => :'replyToEmailAddress' } end @@ -54,13 +62,21 @@ def self.openapi_types :'expiration_seconds' => :'Object', :'email_customization' => :'Object', :'invalidate_existing' => :'Object', - :'send_from_email_address' => :'Object' + :'send_from_email_address' => :'Object', + :'send_from_email_sender_name' => :'Object', + :'reply_to_email_address' => :'Object' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'api_key_name', + :'expiration_seconds', + :'invalidate_existing', + :'send_from_email_address', + :'send_from_email_sender_name', + :'reply_to_email_address' ]) end @@ -106,6 +122,14 @@ def initialize(attributes = {}) if attributes.key?(:'send_from_email_address') self.send_from_email_address = attributes[:'send_from_email_address'] end + + if attributes.key?(:'send_from_email_sender_name') + self.send_from_email_sender_name = attributes[:'send_from_email_sender_name'] + end + + if attributes.key?(:'reply_to_email_address') + self.reply_to_email_address = attributes[:'reply_to_email_address'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -142,7 +166,9 @@ def ==(o) expiration_seconds == o.expiration_seconds && email_customization == o.email_customization && invalidate_existing == o.invalidate_existing && - send_from_email_address == o.send_from_email_address + send_from_email_address == o.send_from_email_address && + send_from_email_sender_name == o.send_from_email_sender_name && + reply_to_email_address == o.reply_to_email_address end # @see the `==` method @@ -154,7 +180,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [email, target_public_key, api_key_name, expiration_seconds, email_customization, invalidate_existing, send_from_email_address].hash + [email, target_public_key, api_key_name, expiration_seconds, email_customization, invalidate_existing, send_from_email_address, send_from_email_sender_name, reply_to_email_address].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/email_customization_params.rb b/turnkey_client/lib/turnkey_client/models/email_customization_params.rb index d533542..12f61c5 100644 --- a/turnkey_client/lib/turnkey_client/models/email_customization_params.rb +++ b/turnkey_client/lib/turnkey_client/models/email_customization_params.rb @@ -52,6 +52,11 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'app_name', + :'logo_url', + :'magic_link_template', + :'template_variables', + :'template_id' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/feature.rb b/turnkey_client/lib/turnkey_client/models/feature.rb index 0706a28..f24aa2c 100644 --- a/turnkey_client/lib/turnkey_client/models/feature.rb +++ b/turnkey_client/lib/turnkey_client/models/feature.rb @@ -35,6 +35,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'value' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/fiat_on_ramp_blockchain_network.rb b/turnkey_client/lib/turnkey_client/models/fiat_on_ramp_blockchain_network.rb new file mode 100644 index 0000000..db39631 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/fiat_on_ramp_blockchain_network.rb @@ -0,0 +1,29 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class FiatOnRampBlockchainNetwork + BITCOIN = 'FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_BITCOIN'.freeze + ETHEREUM = 'FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_ETHEREUM'.freeze + SOLANA = 'FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_SOLANA'.freeze + BASE = 'FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_BASE'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = FiatOnRampBlockchainNetwork.constants.select { |c| FiatOnRampBlockchainNetwork::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #FiatOnRampBlockchainNetwork" if constantValues.empty? + value + end + end +end diff --git a/turnkey_client/lib/turnkey_client/models/fiat_on_ramp_crypto_currency.rb b/turnkey_client/lib/turnkey_client/models/fiat_on_ramp_crypto_currency.rb new file mode 100644 index 0000000..12be2da --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/fiat_on_ramp_crypto_currency.rb @@ -0,0 +1,29 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class FiatOnRampCryptoCurrency + BTC = 'FIAT_ON_RAMP_CRYPTO_CURRENCY_BTC'.freeze + ETH = 'FIAT_ON_RAMP_CRYPTO_CURRENCY_ETH'.freeze + SOL = 'FIAT_ON_RAMP_CRYPTO_CURRENCY_SOL'.freeze + USDC = 'FIAT_ON_RAMP_CRYPTO_CURRENCY_USDC'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = FiatOnRampCryptoCurrency.constants.select { |c| FiatOnRampCryptoCurrency::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #FiatOnRampCryptoCurrency" if constantValues.empty? + value + end + end +end diff --git a/turnkey_client/lib/turnkey_client/models/fiat_on_ramp_currency.rb b/turnkey_client/lib/turnkey_client/models/fiat_on_ramp_currency.rb new file mode 100644 index 0000000..007eadd --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/fiat_on_ramp_currency.rb @@ -0,0 +1,59 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class FiatOnRampCurrency + AUD = 'FIAT_ON_RAMP_CURRENCY_AUD'.freeze + BGN = 'FIAT_ON_RAMP_CURRENCY_BGN'.freeze + BRL = 'FIAT_ON_RAMP_CURRENCY_BRL'.freeze + CAD = 'FIAT_ON_RAMP_CURRENCY_CAD'.freeze + CHF = 'FIAT_ON_RAMP_CURRENCY_CHF'.freeze + COP = 'FIAT_ON_RAMP_CURRENCY_COP'.freeze + CZK = 'FIAT_ON_RAMP_CURRENCY_CZK'.freeze + DKK = 'FIAT_ON_RAMP_CURRENCY_DKK'.freeze + DOP = 'FIAT_ON_RAMP_CURRENCY_DOP'.freeze + EGP = 'FIAT_ON_RAMP_CURRENCY_EGP'.freeze + EUR = 'FIAT_ON_RAMP_CURRENCY_EUR'.freeze + GBP = 'FIAT_ON_RAMP_CURRENCY_GBP'.freeze + HKD = 'FIAT_ON_RAMP_CURRENCY_HKD'.freeze + IDR = 'FIAT_ON_RAMP_CURRENCY_IDR'.freeze + ILS = 'FIAT_ON_RAMP_CURRENCY_ILS'.freeze + JOD = 'FIAT_ON_RAMP_CURRENCY_JOD'.freeze + KES = 'FIAT_ON_RAMP_CURRENCY_KES'.freeze + KWD = 'FIAT_ON_RAMP_CURRENCY_KWD'.freeze + LKR = 'FIAT_ON_RAMP_CURRENCY_LKR'.freeze + MXN = 'FIAT_ON_RAMP_CURRENCY_MXN'.freeze + NGN = 'FIAT_ON_RAMP_CURRENCY_NGN'.freeze + NOK = 'FIAT_ON_RAMP_CURRENCY_NOK'.freeze + NZD = 'FIAT_ON_RAMP_CURRENCY_NZD'.freeze + OMR = 'FIAT_ON_RAMP_CURRENCY_OMR'.freeze + PEN = 'FIAT_ON_RAMP_CURRENCY_PEN'.freeze + PLN = 'FIAT_ON_RAMP_CURRENCY_PLN'.freeze + RON = 'FIAT_ON_RAMP_CURRENCY_RON'.freeze + SEK = 'FIAT_ON_RAMP_CURRENCY_SEK'.freeze + THB = 'FIAT_ON_RAMP_CURRENCY_THB'.freeze + TRY = 'FIAT_ON_RAMP_CURRENCY_TRY'.freeze + TWD = 'FIAT_ON_RAMP_CURRENCY_TWD'.freeze + USD = 'FIAT_ON_RAMP_CURRENCY_USD'.freeze + VND = 'FIAT_ON_RAMP_CURRENCY_VND'.freeze + ZAR = 'FIAT_ON_RAMP_CURRENCY_ZAR'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = FiatOnRampCurrency.constants.select { |c| FiatOnRampCurrency::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #FiatOnRampCurrency" if constantValues.empty? + value + end + end +end diff --git a/turnkey_client/lib/turnkey_client/models/fiat_on_ramp_payment_method.rb b/turnkey_client/lib/turnkey_client/models/fiat_on_ramp_payment_method.rb new file mode 100644 index 0000000..10b1d5b --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/fiat_on_ramp_payment_method.rb @@ -0,0 +1,38 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class FiatOnRampPaymentMethod + CREDIT_DEBIT_CARD = 'FIAT_ON_RAMP_PAYMENT_METHOD_CREDIT_DEBIT_CARD'.freeze + APPLE_PAY = 'FIAT_ON_RAMP_PAYMENT_METHOD_APPLE_PAY'.freeze + GBP_BANK_TRANSFER = 'FIAT_ON_RAMP_PAYMENT_METHOD_GBP_BANK_TRANSFER'.freeze + GBP_OPEN_BANKING_PAYMENT = 'FIAT_ON_RAMP_PAYMENT_METHOD_GBP_OPEN_BANKING_PAYMENT'.freeze + GOOGLE_PAY = 'FIAT_ON_RAMP_PAYMENT_METHOD_GOOGLE_PAY'.freeze + SEPA_BANK_TRANSFER = 'FIAT_ON_RAMP_PAYMENT_METHOD_SEPA_BANK_TRANSFER'.freeze + PIX_INSTANT_PAYMENT = 'FIAT_ON_RAMP_PAYMENT_METHOD_PIX_INSTANT_PAYMENT'.freeze + PAYPAL = 'FIAT_ON_RAMP_PAYMENT_METHOD_PAYPAL'.freeze + VENMO = 'FIAT_ON_RAMP_PAYMENT_METHOD_VENMO'.freeze + MOONPAY_BALANCE = 'FIAT_ON_RAMP_PAYMENT_METHOD_MOONPAY_BALANCE'.freeze + CRYPTO_ACCOUNT = 'FIAT_ON_RAMP_PAYMENT_METHOD_CRYPTO_ACCOUNT'.freeze + FIAT_WALLET = 'FIAT_ON_RAMP_PAYMENT_METHOD_FIAT_WALLET'.freeze + ACH_BANK_ACCOUNT = 'FIAT_ON_RAMP_PAYMENT_METHOD_ACH_BANK_ACCOUNT'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = FiatOnRampPaymentMethod.constants.select { |c| FiatOnRampPaymentMethod::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #FiatOnRampPaymentMethod" if constantValues.empty? + value + end + end +end diff --git a/turnkey_client/lib/turnkey_client/models/fiat_on_ramp_provider.rb b/turnkey_client/lib/turnkey_client/models/fiat_on_ramp_provider.rb new file mode 100644 index 0000000..b88078d --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/fiat_on_ramp_provider.rb @@ -0,0 +1,27 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class FiatOnRampProvider + COINBASE = 'FIAT_ON_RAMP_PROVIDER_COINBASE'.freeze + MOONPAY = 'FIAT_ON_RAMP_PROVIDER_MOONPAY'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = FiatOnRampProvider.constants.select { |c| FiatOnRampProvider::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #FiatOnRampProvider" if constantValues.empty? + value + end + end +end diff --git a/turnkey_client/lib/turnkey_client/models/get_activities_request.rb b/turnkey_client/lib/turnkey_client/models/get_activities_request.rb index 73f54b7..1e7aadd 100644 --- a/turnkey_client/lib/turnkey_client/models/get_activities_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_activities_request.rb @@ -12,15 +12,15 @@ module TurnkeyClient class GetActivitiesRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id - # Array of Activity Statuses filtering which Activities will be listed in the response. + # Array of activity statuses filtering which activities will be listed in the response. attr_accessor :filter_by_status attr_accessor :pagination_options - # Array of Activity Types filtering which Activities will be listed in the response. + # Array of activity types filtering which activities will be listed in the response. attr_accessor :filter_by_type # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_activities_response.rb b/turnkey_client/lib/turnkey_client/models/get_activities_response.rb index 62a361d..0475f88 100644 --- a/turnkey_client/lib/turnkey_client/models/get_activities_response.rb +++ b/turnkey_client/lib/turnkey_client/models/get_activities_response.rb @@ -12,7 +12,7 @@ module TurnkeyClient class GetActivitiesResponse - # A list of Activities. + # A list of activities. attr_accessor :activities # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_activity_request.rb b/turnkey_client/lib/turnkey_client/models/get_activity_request.rb index 7cd2d41..03bf343 100644 --- a/turnkey_client/lib/turnkey_client/models/get_activity_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_activity_request.rb @@ -12,10 +12,10 @@ module TurnkeyClient class GetActivityRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id - # Unique identifier for a given Activity object. + # Unique identifier for a given activity object. attr_accessor :activity_id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_api_key_request.rb b/turnkey_client/lib/turnkey_client/models/get_api_key_request.rb index 510231e..cddb2a8 100644 --- a/turnkey_client/lib/turnkey_client/models/get_api_key_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_api_key_request.rb @@ -12,7 +12,7 @@ module TurnkeyClient class GetApiKeyRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id # Unique identifier for a given API key. diff --git a/turnkey_client/lib/turnkey_client/models/get_api_keys_request.rb b/turnkey_client/lib/turnkey_client/models/get_api_keys_request.rb index f53f905..f02481e 100644 --- a/turnkey_client/lib/turnkey_client/models/get_api_keys_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_api_keys_request.rb @@ -12,10 +12,10 @@ module TurnkeyClient class GetApiKeysRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id - # Unique identifier for a given User. + # Unique identifier for a given user. attr_accessor :user_id # Attribute mapping from ruby-style variable name to JSON key. @@ -37,6 +37,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'user_id' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/get_authenticator_request.rb b/turnkey_client/lib/turnkey_client/models/get_authenticator_request.rb index eee5f12..fc0ed1d 100644 --- a/turnkey_client/lib/turnkey_client/models/get_authenticator_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_authenticator_request.rb @@ -12,10 +12,10 @@ module TurnkeyClient class GetAuthenticatorRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id - # Unique identifier for a given Authenticator. + # Unique identifier for a given authenticator. attr_accessor :authenticator_id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_authenticators_request.rb b/turnkey_client/lib/turnkey_client/models/get_authenticators_request.rb index 335497a..8be7a1e 100644 --- a/turnkey_client/lib/turnkey_client/models/get_authenticators_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_authenticators_request.rb @@ -12,10 +12,10 @@ module TurnkeyClient class GetAuthenticatorsRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id - # Unique identifier for a given User. + # Unique identifier for a given user. attr_accessor :user_id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_oauth_providers_request.rb b/turnkey_client/lib/turnkey_client/models/get_oauth_providers_request.rb index 27eafaa..7d33522 100644 --- a/turnkey_client/lib/turnkey_client/models/get_oauth_providers_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_oauth_providers_request.rb @@ -12,10 +12,10 @@ module TurnkeyClient class GetOauthProvidersRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id - # Unique identifier for a given User. + # Unique identifier for a given user. attr_accessor :user_id # Attribute mapping from ruby-style variable name to JSON key. @@ -37,6 +37,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'user_id' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/get_oauth_providers_response.rb b/turnkey_client/lib/turnkey_client/models/get_oauth_providers_response.rb index 563bbb6..56620bc 100644 --- a/turnkey_client/lib/turnkey_client/models/get_oauth_providers_response.rb +++ b/turnkey_client/lib/turnkey_client/models/get_oauth_providers_response.rb @@ -12,7 +12,7 @@ module TurnkeyClient class GetOauthProvidersResponse - # A list of Oauth Providers + # A list of Oauth providers. attr_accessor :oauth_providers # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_organization_configs_request.rb b/turnkey_client/lib/turnkey_client/models/get_organization_configs_request.rb index 4a2c925..7e84e47 100644 --- a/turnkey_client/lib/turnkey_client/models/get_organization_configs_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_organization_configs_request.rb @@ -12,7 +12,7 @@ module TurnkeyClient class GetOrganizationConfigsRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_policies_request.rb b/turnkey_client/lib/turnkey_client/models/get_policies_request.rb index 3eb158d..c24ec49 100644 --- a/turnkey_client/lib/turnkey_client/models/get_policies_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_policies_request.rb @@ -12,7 +12,7 @@ module TurnkeyClient class GetPoliciesRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_policies_response.rb b/turnkey_client/lib/turnkey_client/models/get_policies_response.rb index c9412a6..84e006c 100644 --- a/turnkey_client/lib/turnkey_client/models/get_policies_response.rb +++ b/turnkey_client/lib/turnkey_client/models/get_policies_response.rb @@ -12,7 +12,7 @@ module TurnkeyClient class GetPoliciesResponse - # A list of Policies. + # A list of policies. attr_accessor :policies # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_policy_evaluations_request.rb b/turnkey_client/lib/turnkey_client/models/get_policy_evaluations_request.rb new file mode 100644 index 0000000..d61f31b --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/get_policy_evaluations_request.rb @@ -0,0 +1,226 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class GetPolicyEvaluationsRequest + # Unique identifier for a given organization. + attr_accessor :organization_id + + # Unique identifier for a given activity. + attr_accessor :activity_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'organization_id' => :'organizationId', + :'activity_id' => :'activityId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'organization_id' => :'Object', + :'activity_id' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::GetPolicyEvaluationsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::GetPolicyEvaluationsRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'activity_id') + self.activity_id = attributes[:'activity_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @activity_id.nil? + invalid_properties.push('invalid value for "activity_id", activity_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @organization_id.nil? + return false if @activity_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + organization_id == o.organization_id && + activity_id == o.activity_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [organization_id, activity_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/get_policy_evaluations_response.rb b/turnkey_client/lib/turnkey_client/models/get_policy_evaluations_response.rb new file mode 100644 index 0000000..dac290e --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/get_policy_evaluations_response.rb @@ -0,0 +1,212 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class GetPolicyEvaluationsResponse + attr_accessor :policy_evaluations + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'policy_evaluations' => :'policyEvaluations' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'policy_evaluations' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::GetPolicyEvaluationsResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::GetPolicyEvaluationsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'policy_evaluations') + if (value = attributes[:'policy_evaluations']).is_a?(Array) + self.policy_evaluations = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @policy_evaluations.nil? + invalid_properties.push('invalid value for "policy_evaluations", policy_evaluations cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @policy_evaluations.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + policy_evaluations == o.policy_evaluations + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [policy_evaluations].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/get_policy_request.rb b/turnkey_client/lib/turnkey_client/models/get_policy_request.rb index 63d1fe7..d160db4 100644 --- a/turnkey_client/lib/turnkey_client/models/get_policy_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_policy_request.rb @@ -12,10 +12,10 @@ module TurnkeyClient class GetPolicyRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id - # Unique identifier for a given Policy. + # Unique identifier for a given policy. attr_accessor :policy_id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_private_key_request.rb b/turnkey_client/lib/turnkey_client/models/get_private_key_request.rb index 2c49202..2e9ccff 100644 --- a/turnkey_client/lib/turnkey_client/models/get_private_key_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_private_key_request.rb @@ -12,10 +12,10 @@ module TurnkeyClient class GetPrivateKeyRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id - # Unique identifier for a given Private Key. + # Unique identifier for a given private key. attr_accessor :private_key_id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_private_keys_request.rb b/turnkey_client/lib/turnkey_client/models/get_private_keys_request.rb index 30868e7..1312ebc 100644 --- a/turnkey_client/lib/turnkey_client/models/get_private_keys_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_private_keys_request.rb @@ -12,7 +12,7 @@ module TurnkeyClient class GetPrivateKeysRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_private_keys_response.rb b/turnkey_client/lib/turnkey_client/models/get_private_keys_response.rb index 8ab7c01..1e77382 100644 --- a/turnkey_client/lib/turnkey_client/models/get_private_keys_response.rb +++ b/turnkey_client/lib/turnkey_client/models/get_private_keys_response.rb @@ -12,7 +12,7 @@ module TurnkeyClient class GetPrivateKeysResponse - # A list of Private Keys. + # A list of private keys. attr_accessor :private_keys # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_smart_contract_interface_request.rb b/turnkey_client/lib/turnkey_client/models/get_smart_contract_interface_request.rb new file mode 100644 index 0000000..039342c --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/get_smart_contract_interface_request.rb @@ -0,0 +1,226 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class GetSmartContractInterfaceRequest + # Unique identifier for a given organization. + attr_accessor :organization_id + + # Unique identifier for a given smart contract interface. + attr_accessor :smart_contract_interface_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'organization_id' => :'organizationId', + :'smart_contract_interface_id' => :'smartContractInterfaceId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'organization_id' => :'Object', + :'smart_contract_interface_id' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::GetSmartContractInterfaceRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::GetSmartContractInterfaceRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'smart_contract_interface_id') + self.smart_contract_interface_id = attributes[:'smart_contract_interface_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @smart_contract_interface_id.nil? + invalid_properties.push('invalid value for "smart_contract_interface_id", smart_contract_interface_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @organization_id.nil? + return false if @smart_contract_interface_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + organization_id == o.organization_id && + smart_contract_interface_id == o.smart_contract_interface_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [organization_id, smart_contract_interface_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/get_smart_contract_interface_response.rb b/turnkey_client/lib/turnkey_client/models/get_smart_contract_interface_response.rb new file mode 100644 index 0000000..58ad5de --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/get_smart_contract_interface_response.rb @@ -0,0 +1,210 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class GetSmartContractInterfaceResponse + attr_accessor :smart_contract_interface + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'smart_contract_interface' => :'smartContractInterface' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'smart_contract_interface' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::GetSmartContractInterfaceResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::GetSmartContractInterfaceResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'smart_contract_interface') + self.smart_contract_interface = attributes[:'smart_contract_interface'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @smart_contract_interface.nil? + invalid_properties.push('invalid value for "smart_contract_interface", smart_contract_interface cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @smart_contract_interface.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + smart_contract_interface == o.smart_contract_interface + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [smart_contract_interface].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/get_smart_contract_interfaces_request.rb b/turnkey_client/lib/turnkey_client/models/get_smart_contract_interfaces_request.rb new file mode 100644 index 0000000..23c0989 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/get_smart_contract_interfaces_request.rb @@ -0,0 +1,211 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class GetSmartContractInterfacesRequest + # Unique identifier for a given organization. + attr_accessor :organization_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'organization_id' => :'organizationId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'organization_id' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::GetSmartContractInterfacesRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::GetSmartContractInterfacesRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @organization_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + organization_id == o.organization_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [organization_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/get_smart_contract_interfaces_response.rb b/turnkey_client/lib/turnkey_client/models/get_smart_contract_interfaces_response.rb new file mode 100644 index 0000000..3ed74ac --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/get_smart_contract_interfaces_response.rb @@ -0,0 +1,213 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class GetSmartContractInterfacesResponse + # A list of smart contract interfaces. + attr_accessor :smart_contract_interfaces + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'smart_contract_interfaces' => :'smartContractInterfaces' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'smart_contract_interfaces' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::GetSmartContractInterfacesResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::GetSmartContractInterfacesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'smart_contract_interfaces') + if (value = attributes[:'smart_contract_interfaces']).is_a?(Array) + self.smart_contract_interfaces = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @smart_contract_interfaces.nil? + invalid_properties.push('invalid value for "smart_contract_interfaces", smart_contract_interfaces cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @smart_contract_interfaces.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + smart_contract_interfaces == o.smart_contract_interfaces + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [smart_contract_interfaces].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/get_sub_org_ids_request.rb b/turnkey_client/lib/turnkey_client/models/get_sub_org_ids_request.rb index bafba1f..ab26bd8 100644 --- a/turnkey_client/lib/turnkey_client/models/get_sub_org_ids_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_sub_org_ids_request.rb @@ -12,10 +12,10 @@ module TurnkeyClient class GetSubOrgIdsRequest - # Unique identifier for the parent Organization. This is used to find sub-organizations within it. + # Unique identifier for the parent organization. This is used to find sub-organizations within it. attr_accessor :organization_id - # Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN' or 'PUBLIC_KEY' + # Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN', 'WALLET_ACCOUNT_ADDRESS' or 'PUBLIC_KEY' attr_accessor :filter_type # The value of the filter to apply for the specified type. For example, a specific email or name string. diff --git a/turnkey_client/lib/turnkey_client/models/get_user_request.rb b/turnkey_client/lib/turnkey_client/models/get_user_request.rb index d914dd0..80163e4 100644 --- a/turnkey_client/lib/turnkey_client/models/get_user_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_user_request.rb @@ -12,10 +12,10 @@ module TurnkeyClient class GetUserRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id - # Unique identifier for a given User. + # Unique identifier for a given user. attr_accessor :user_id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_users_request.rb b/turnkey_client/lib/turnkey_client/models/get_users_request.rb index 7fae6e6..e97bf82 100644 --- a/turnkey_client/lib/turnkey_client/models/get_users_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_users_request.rb @@ -12,7 +12,7 @@ module TurnkeyClient class GetUsersRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_users_response.rb b/turnkey_client/lib/turnkey_client/models/get_users_response.rb index ac134ed..e4a2799 100644 --- a/turnkey_client/lib/turnkey_client/models/get_users_response.rb +++ b/turnkey_client/lib/turnkey_client/models/get_users_response.rb @@ -12,7 +12,7 @@ module TurnkeyClient class GetUsersResponse - # A list of Users. + # A list of users. attr_accessor :users # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_verified_sub_org_ids_request.rb b/turnkey_client/lib/turnkey_client/models/get_verified_sub_org_ids_request.rb index 9bc21a3..5398add 100644 --- a/turnkey_client/lib/turnkey_client/models/get_verified_sub_org_ids_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_verified_sub_org_ids_request.rb @@ -12,10 +12,10 @@ module TurnkeyClient class GetVerifiedSubOrgIdsRequest - # Unique identifier for the parent Organization. This is used to find sub-organizations within it. + # Unique identifier for the parent organization. This is used to find sub-organizations within it. attr_accessor :organization_id - # Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER' + # Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER'. attr_accessor :filter_type # The value of the filter to apply for the specified type. For example, a specific email or phone number string. diff --git a/turnkey_client/lib/turnkey_client/models/get_wallet_account_request.rb b/turnkey_client/lib/turnkey_client/models/get_wallet_account_request.rb index e76a38e..4e3589e 100644 --- a/turnkey_client/lib/turnkey_client/models/get_wallet_account_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_wallet_account_request.rb @@ -12,16 +12,16 @@ module TurnkeyClient class GetWalletAccountRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id - # Unique identifier for a given Wallet. + # Unique identifier for a given wallet. attr_accessor :wallet_id - # Address corresponding to a Wallet Account. + # Address corresponding to a wallet account. attr_accessor :address - # Path corresponding to a Wallet Account. + # Path corresponding to a wallet account. attr_accessor :path # Attribute mapping from ruby-style variable name to JSON key. @@ -47,6 +47,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'address', + :'path' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/get_wallet_accounts_request.rb b/turnkey_client/lib/turnkey_client/models/get_wallet_accounts_request.rb index 7244cb2..50050a9 100644 --- a/turnkey_client/lib/turnkey_client/models/get_wallet_accounts_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_wallet_accounts_request.rb @@ -12,10 +12,10 @@ module TurnkeyClient class GetWalletAccountsRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id - # Unique identifier for a given Wallet. + # Unique identifier for a given wallet. If not provided, all accounts for the organization will be returned. attr_accessor :wallet_id attr_accessor :pagination_options @@ -41,6 +41,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'wallet_id', ]) end @@ -80,10 +81,6 @@ def list_invalid_properties invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') end - if @wallet_id.nil? - invalid_properties.push('invalid value for "wallet_id", wallet_id cannot be nil.') - end - invalid_properties end @@ -91,7 +88,6 @@ def list_invalid_properties # @return true if the model is valid def valid? return false if @organization_id.nil? - return false if @wallet_id.nil? true end diff --git a/turnkey_client/lib/turnkey_client/models/get_wallet_accounts_response.rb b/turnkey_client/lib/turnkey_client/models/get_wallet_accounts_response.rb index facb390..4dc4cd2 100644 --- a/turnkey_client/lib/turnkey_client/models/get_wallet_accounts_response.rb +++ b/turnkey_client/lib/turnkey_client/models/get_wallet_accounts_response.rb @@ -12,7 +12,7 @@ module TurnkeyClient class GetWalletAccountsResponse - # A list of Accounts generated from a Wallet that share a common seed. + # A list of accounts generated from a wallet that share a common seed. attr_accessor :accounts # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_wallet_request.rb b/turnkey_client/lib/turnkey_client/models/get_wallet_request.rb index 743f9cc..e28218f 100644 --- a/turnkey_client/lib/turnkey_client/models/get_wallet_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_wallet_request.rb @@ -12,10 +12,10 @@ module TurnkeyClient class GetWalletRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id - # Unique identifier for a given Wallet. + # Unique identifier for a given wallet. attr_accessor :wallet_id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_wallets_request.rb b/turnkey_client/lib/turnkey_client/models/get_wallets_request.rb index 717dc82..6396ec4 100644 --- a/turnkey_client/lib/turnkey_client/models/get_wallets_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_wallets_request.rb @@ -12,7 +12,7 @@ module TurnkeyClient class GetWalletsRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_wallets_response.rb b/turnkey_client/lib/turnkey_client/models/get_wallets_response.rb index a40b1e8..5aeaefa 100644 --- a/turnkey_client/lib/turnkey_client/models/get_wallets_response.rb +++ b/turnkey_client/lib/turnkey_client/models/get_wallets_response.rb @@ -12,7 +12,7 @@ module TurnkeyClient class GetWalletsResponse - # A list of Wallets. + # A list of wallets. attr_accessor :wallets # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_whoami_request.rb b/turnkey_client/lib/turnkey_client/models/get_whoami_request.rb index ed9d272..d823822 100644 --- a/turnkey_client/lib/turnkey_client/models/get_whoami_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_whoami_request.rb @@ -12,7 +12,7 @@ module TurnkeyClient class GetWhoamiRequest - # Unique identifier for a given Organization. If the request is being made by a WebAuthN user and their Sub-Organization ID is unknown, this can be the Parent Organization ID; using the Sub-Organization ID when possible is preferred due to performance reasons. + # Unique identifier for a given organization. If the request is being made by a WebAuthN user and their sub-organization ID is unknown, this can be the parent organization ID; using the sub-organization ID when possible is preferred due to performance reasons. attr_accessor :organization_id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/get_whoami_response.rb b/turnkey_client/lib/turnkey_client/models/get_whoami_response.rb index 75a7af5..2259f66 100644 --- a/turnkey_client/lib/turnkey_client/models/get_whoami_response.rb +++ b/turnkey_client/lib/turnkey_client/models/get_whoami_response.rb @@ -12,16 +12,16 @@ module TurnkeyClient class GetWhoamiResponse - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id - # Human-readable name for an Organization. + # Human-readable name for an organization. attr_accessor :organization_name - # Unique identifier for a given User. + # Unique identifier for a given user. attr_accessor :user_id - # Human-readable name for a User. + # Human-readable name for a user. attr_accessor :username # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/init_fiat_on_ramp_intent.rb b/turnkey_client/lib/turnkey_client/models/init_fiat_on_ramp_intent.rb new file mode 100644 index 0000000..0ba8901 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/init_fiat_on_ramp_intent.rb @@ -0,0 +1,315 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class InitFiatOnRampIntent + attr_accessor :onramp_provider + + # Destination wallet address for the buy transaction. + attr_accessor :wallet_address + + attr_accessor :network + + attr_accessor :crypto_currency_code + + attr_accessor :fiat_currency_code + + # Specifies a preset fiat amount for the transaction, e.g., '100'. Must be greater than '20'. If not provided, the user will be prompted to enter an amount. + attr_accessor :fiat_currency_amount + + attr_accessor :payment_method + + # ISO 3166-1 two-digit country code for Coinbase representing the purchasing user’s country of residence, e.g., US, GB. + attr_accessor :country_code + + # ISO 3166-2 two-digit country subdivision code for Coinbase representing the purchasing user’s subdivision of residence within their country, e.g. NY. Required if country_code=US. + attr_accessor :country_subdivision_code + + # Optional flag to indicate whether to use the sandbox mode to simulate transactions for the on-ramp provider. Default is false. + attr_accessor :sandbox_mode + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'onramp_provider' => :'onrampProvider', + :'wallet_address' => :'walletAddress', + :'network' => :'network', + :'crypto_currency_code' => :'cryptoCurrencyCode', + :'fiat_currency_code' => :'fiatCurrencyCode', + :'fiat_currency_amount' => :'fiatCurrencyAmount', + :'payment_method' => :'paymentMethod', + :'country_code' => :'countryCode', + :'country_subdivision_code' => :'countrySubdivisionCode', + :'sandbox_mode' => :'sandboxMode' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'onramp_provider' => :'Object', + :'wallet_address' => :'Object', + :'network' => :'Object', + :'crypto_currency_code' => :'Object', + :'fiat_currency_code' => :'Object', + :'fiat_currency_amount' => :'Object', + :'payment_method' => :'Object', + :'country_code' => :'Object', + :'country_subdivision_code' => :'Object', + :'sandbox_mode' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'fiat_currency_amount', + :'country_code', + :'country_subdivision_code', + :'sandbox_mode' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::InitFiatOnRampIntent` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::InitFiatOnRampIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'onramp_provider') + self.onramp_provider = attributes[:'onramp_provider'] + end + + if attributes.key?(:'wallet_address') + self.wallet_address = attributes[:'wallet_address'] + end + + if attributes.key?(:'network') + self.network = attributes[:'network'] + end + + if attributes.key?(:'crypto_currency_code') + self.crypto_currency_code = attributes[:'crypto_currency_code'] + end + + if attributes.key?(:'fiat_currency_code') + self.fiat_currency_code = attributes[:'fiat_currency_code'] + end + + if attributes.key?(:'fiat_currency_amount') + self.fiat_currency_amount = attributes[:'fiat_currency_amount'] + end + + if attributes.key?(:'payment_method') + self.payment_method = attributes[:'payment_method'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.key?(:'country_subdivision_code') + self.country_subdivision_code = attributes[:'country_subdivision_code'] + end + + if attributes.key?(:'sandbox_mode') + self.sandbox_mode = attributes[:'sandbox_mode'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @onramp_provider.nil? + invalid_properties.push('invalid value for "onramp_provider", onramp_provider cannot be nil.') + end + + if @wallet_address.nil? + invalid_properties.push('invalid value for "wallet_address", wallet_address cannot be nil.') + end + + if @network.nil? + invalid_properties.push('invalid value for "network", network cannot be nil.') + end + + if @crypto_currency_code.nil? + invalid_properties.push('invalid value for "crypto_currency_code", crypto_currency_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @onramp_provider.nil? + return false if @wallet_address.nil? + return false if @network.nil? + return false if @crypto_currency_code.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + onramp_provider == o.onramp_provider && + wallet_address == o.wallet_address && + network == o.network && + crypto_currency_code == o.crypto_currency_code && + fiat_currency_code == o.fiat_currency_code && + fiat_currency_amount == o.fiat_currency_amount && + payment_method == o.payment_method && + country_code == o.country_code && + country_subdivision_code == o.country_subdivision_code && + sandbox_mode == o.sandbox_mode + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [onramp_provider, wallet_address, network, crypto_currency_code, fiat_currency_code, fiat_currency_amount, payment_method, country_code, country_subdivision_code, sandbox_mode].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/init_fiat_on_ramp_request.rb b/turnkey_client/lib/turnkey_client/models/init_fiat_on_ramp_request.rb new file mode 100644 index 0000000..45d1eb8 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/init_fiat_on_ramp_request.rb @@ -0,0 +1,288 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class InitFiatOnRampRequest + attr_accessor :type + + # Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + attr_accessor :timestamp_ms + + # Unique identifier for a given Organization. + attr_accessor :organization_id + + attr_accessor :parameters + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'timestamp_ms' => :'timestampMs', + :'organization_id' => :'organizationId', + :'parameters' => :'parameters' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'Object', + :'timestamp_ms' => :'Object', + :'organization_id' => :'Object', + :'parameters' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::InitFiatOnRampRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::InitFiatOnRampRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'timestamp_ms') + self.timestamp_ms = attributes[:'timestamp_ms'] + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @timestamp_ms.nil? + invalid_properties.push('invalid value for "timestamp_ms", timestamp_ms cannot be nil.') + end + + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @parameters.nil? + invalid_properties.push('invalid value for "parameters", parameters cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_INIT_FIAT_ON_RAMP']) + return false unless type_validator.valid?(@type) + return false if @timestamp_ms.nil? + return false if @organization_id.nil? + return false if @parameters.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_INIT_FIAT_ON_RAMP']) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + timestamp_ms == o.timestamp_ms && + organization_id == o.organization_id && + parameters == o.parameters + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, timestamp_ms, organization_id, parameters].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/init_fiat_on_ramp_result.rb b/turnkey_client/lib/turnkey_client/models/init_fiat_on_ramp_result.rb new file mode 100644 index 0000000..0132b04 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/init_fiat_on_ramp_result.rb @@ -0,0 +1,226 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class InitFiatOnRampResult + # Unique URL for a given fiat on-ramp flow. + attr_accessor :on_ramp_url + + # Unique identifier used to retrieve transaction statuses for a given fiat on-ramp flow. + attr_accessor :on_ramp_transaction_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'on_ramp_url' => :'onRampUrl', + :'on_ramp_transaction_id' => :'onRampTransactionId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'on_ramp_url' => :'Object', + :'on_ramp_transaction_id' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::InitFiatOnRampResult` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::InitFiatOnRampResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'on_ramp_url') + self.on_ramp_url = attributes[:'on_ramp_url'] + end + + if attributes.key?(:'on_ramp_transaction_id') + self.on_ramp_transaction_id = attributes[:'on_ramp_transaction_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @on_ramp_url.nil? + invalid_properties.push('invalid value for "on_ramp_url", on_ramp_url cannot be nil.') + end + + if @on_ramp_transaction_id.nil? + invalid_properties.push('invalid value for "on_ramp_transaction_id", on_ramp_transaction_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @on_ramp_url.nil? + return false if @on_ramp_transaction_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + on_ramp_url == o.on_ramp_url && + on_ramp_transaction_id == o.on_ramp_transaction_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [on_ramp_url, on_ramp_transaction_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/init_otp_auth_intent.rb b/turnkey_client/lib/turnkey_client/models/init_otp_auth_intent.rb index e3a2dad..ec23982 100644 --- a/turnkey_client/lib/turnkey_client/models/init_otp_auth_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/init_otp_auth_intent.rb @@ -28,6 +28,12 @@ class InitOtpAuthIntent # Optional custom email address from which to send the OTP email attr_accessor :send_from_email_address + # Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' + attr_accessor :send_from_email_sender_name + + # Optional custom email address to use as reply-to + attr_accessor :reply_to_email_address + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -36,7 +42,9 @@ def self.attribute_map :'email_customization' => :'emailCustomization', :'sms_customization' => :'smsCustomization', :'user_identifier' => :'userIdentifier', - :'send_from_email_address' => :'sendFromEmailAddress' + :'send_from_email_address' => :'sendFromEmailAddress', + :'send_from_email_sender_name' => :'sendFromEmailSenderName', + :'reply_to_email_address' => :'replyToEmailAddress' } end @@ -48,13 +56,19 @@ def self.openapi_types :'email_customization' => :'Object', :'sms_customization' => :'Object', :'user_identifier' => :'Object', - :'send_from_email_address' => :'Object' + :'send_from_email_address' => :'Object', + :'send_from_email_sender_name' => :'Object', + :'reply_to_email_address' => :'Object' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'user_identifier', + :'send_from_email_address', + :'send_from_email_sender_name', + :'reply_to_email_address' ]) end @@ -96,6 +110,14 @@ def initialize(attributes = {}) if attributes.key?(:'send_from_email_address') self.send_from_email_address = attributes[:'send_from_email_address'] end + + if attributes.key?(:'send_from_email_sender_name') + self.send_from_email_sender_name = attributes[:'send_from_email_sender_name'] + end + + if attributes.key?(:'reply_to_email_address') + self.reply_to_email_address = attributes[:'reply_to_email_address'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -131,7 +153,9 @@ def ==(o) email_customization == o.email_customization && sms_customization == o.sms_customization && user_identifier == o.user_identifier && - send_from_email_address == o.send_from_email_address + send_from_email_address == o.send_from_email_address && + send_from_email_sender_name == o.send_from_email_sender_name && + reply_to_email_address == o.reply_to_email_address end # @see the `==` method @@ -143,7 +167,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [otp_type, contact, email_customization, sms_customization, user_identifier, send_from_email_address].hash + [otp_type, contact, email_customization, sms_customization, user_identifier, send_from_email_address, send_from_email_sender_name, reply_to_email_address].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/init_otp_auth_intent_v2.rb b/turnkey_client/lib/turnkey_client/models/init_otp_auth_intent_v2.rb new file mode 100644 index 0000000..c2200b7 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/init_otp_auth_intent_v2.rb @@ -0,0 +1,310 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class InitOtpAuthIntentV2 + # Enum to specifiy whether to send OTP via SMS or email + attr_accessor :otp_type + + # Email or phone number to send the OTP code to + attr_accessor :contact + + # Optional length of the OTP code. Default = 9 + attr_accessor :otp_length + + attr_accessor :email_customization + + attr_accessor :sms_customization + + # Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. + attr_accessor :user_identifier + + # Optional custom email address from which to send the OTP email + attr_accessor :send_from_email_address + + # Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true + attr_accessor :alphanumeric + + # Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' + attr_accessor :send_from_email_sender_name + + # Optional custom email address to use as reply-to + attr_accessor :reply_to_email_address + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'otp_type' => :'otpType', + :'contact' => :'contact', + :'otp_length' => :'otpLength', + :'email_customization' => :'emailCustomization', + :'sms_customization' => :'smsCustomization', + :'user_identifier' => :'userIdentifier', + :'send_from_email_address' => :'sendFromEmailAddress', + :'alphanumeric' => :'alphanumeric', + :'send_from_email_sender_name' => :'sendFromEmailSenderName', + :'reply_to_email_address' => :'replyToEmailAddress' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'otp_type' => :'Object', + :'contact' => :'Object', + :'otp_length' => :'Object', + :'email_customization' => :'Object', + :'sms_customization' => :'Object', + :'user_identifier' => :'Object', + :'send_from_email_address' => :'Object', + :'alphanumeric' => :'Object', + :'send_from_email_sender_name' => :'Object', + :'reply_to_email_address' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'otp_length', + :'user_identifier', + :'send_from_email_address', + :'alphanumeric', + :'send_from_email_sender_name', + :'reply_to_email_address' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::InitOtpAuthIntentV2` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::InitOtpAuthIntentV2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'otp_type') + self.otp_type = attributes[:'otp_type'] + end + + if attributes.key?(:'contact') + self.contact = attributes[:'contact'] + end + + if attributes.key?(:'otp_length') + self.otp_length = attributes[:'otp_length'] + end + + if attributes.key?(:'email_customization') + self.email_customization = attributes[:'email_customization'] + end + + if attributes.key?(:'sms_customization') + self.sms_customization = attributes[:'sms_customization'] + end + + if attributes.key?(:'user_identifier') + self.user_identifier = attributes[:'user_identifier'] + end + + if attributes.key?(:'send_from_email_address') + self.send_from_email_address = attributes[:'send_from_email_address'] + end + + if attributes.key?(:'alphanumeric') + self.alphanumeric = attributes[:'alphanumeric'] + end + + if attributes.key?(:'send_from_email_sender_name') + self.send_from_email_sender_name = attributes[:'send_from_email_sender_name'] + end + + if attributes.key?(:'reply_to_email_address') + self.reply_to_email_address = attributes[:'reply_to_email_address'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @otp_type.nil? + invalid_properties.push('invalid value for "otp_type", otp_type cannot be nil.') + end + + if @contact.nil? + invalid_properties.push('invalid value for "contact", contact cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @otp_type.nil? + return false if @contact.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + otp_type == o.otp_type && + contact == o.contact && + otp_length == o.otp_length && + email_customization == o.email_customization && + sms_customization == o.sms_customization && + user_identifier == o.user_identifier && + send_from_email_address == o.send_from_email_address && + alphanumeric == o.alphanumeric && + send_from_email_sender_name == o.send_from_email_sender_name && + reply_to_email_address == o.reply_to_email_address + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [otp_type, contact, otp_length, email_customization, sms_customization, user_identifier, send_from_email_address, alphanumeric, send_from_email_sender_name, reply_to_email_address].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/init_otp_auth_request.rb b/turnkey_client/lib/turnkey_client/models/init_otp_auth_request.rb index 82c8935..7eefac0 100644 --- a/turnkey_client/lib/turnkey_client/models/init_otp_auth_request.rb +++ b/turnkey_client/lib/turnkey_client/models/init_otp_auth_request.rb @@ -129,7 +129,7 @@ def list_invalid_properties # @return true if the model is valid def valid? return false if @type.nil? - type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_INIT_OTP_AUTH']) + type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_INIT_OTP_AUTH_V2']) return false unless type_validator.valid?(@type) return false if @timestamp_ms.nil? return false if @organization_id.nil? @@ -140,7 +140,7 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_INIT_OTP_AUTH']) + validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_INIT_OTP_AUTH_V2']) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end diff --git a/turnkey_client/lib/turnkey_client/models/init_otp_auth_result_v2.rb b/turnkey_client/lib/turnkey_client/models/init_otp_auth_result_v2.rb new file mode 100644 index 0000000..43c10e0 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/init_otp_auth_result_v2.rb @@ -0,0 +1,211 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class InitOtpAuthResultV2 + # Unique identifier for an OTP authentication + attr_accessor :otp_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'otp_id' => :'otpId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'otp_id' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::InitOtpAuthResultV2` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::InitOtpAuthResultV2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'otp_id') + self.otp_id = attributes[:'otp_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @otp_id.nil? + invalid_properties.push('invalid value for "otp_id", otp_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @otp_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + otp_id == o.otp_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [otp_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/init_otp_intent.rb b/turnkey_client/lib/turnkey_client/models/init_otp_intent.rb new file mode 100644 index 0000000..dfadc5d --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/init_otp_intent.rb @@ -0,0 +1,321 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class InitOtpIntent + # Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL + attr_accessor :otp_type + + # Email or phone number to send the OTP code to + attr_accessor :contact + + # Optional length of the OTP code. Default = 9 + attr_accessor :otp_length + + attr_accessor :email_customization + + attr_accessor :sms_customization + + # Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. + attr_accessor :user_identifier + + # Optional custom email address from which to send the OTP email + attr_accessor :send_from_email_address + + # Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true + attr_accessor :alphanumeric + + # Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' + attr_accessor :send_from_email_sender_name + + # Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes) + attr_accessor :expiration_seconds + + # Optional custom email address to use as reply-to + attr_accessor :reply_to_email_address + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'otp_type' => :'otpType', + :'contact' => :'contact', + :'otp_length' => :'otpLength', + :'email_customization' => :'emailCustomization', + :'sms_customization' => :'smsCustomization', + :'user_identifier' => :'userIdentifier', + :'send_from_email_address' => :'sendFromEmailAddress', + :'alphanumeric' => :'alphanumeric', + :'send_from_email_sender_name' => :'sendFromEmailSenderName', + :'expiration_seconds' => :'expirationSeconds', + :'reply_to_email_address' => :'replyToEmailAddress' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'otp_type' => :'Object', + :'contact' => :'Object', + :'otp_length' => :'Object', + :'email_customization' => :'Object', + :'sms_customization' => :'Object', + :'user_identifier' => :'Object', + :'send_from_email_address' => :'Object', + :'alphanumeric' => :'Object', + :'send_from_email_sender_name' => :'Object', + :'expiration_seconds' => :'Object', + :'reply_to_email_address' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'otp_length', + :'user_identifier', + :'send_from_email_address', + :'alphanumeric', + :'send_from_email_sender_name', + :'expiration_seconds', + :'reply_to_email_address' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::InitOtpIntent` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::InitOtpIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'otp_type') + self.otp_type = attributes[:'otp_type'] + end + + if attributes.key?(:'contact') + self.contact = attributes[:'contact'] + end + + if attributes.key?(:'otp_length') + self.otp_length = attributes[:'otp_length'] + end + + if attributes.key?(:'email_customization') + self.email_customization = attributes[:'email_customization'] + end + + if attributes.key?(:'sms_customization') + self.sms_customization = attributes[:'sms_customization'] + end + + if attributes.key?(:'user_identifier') + self.user_identifier = attributes[:'user_identifier'] + end + + if attributes.key?(:'send_from_email_address') + self.send_from_email_address = attributes[:'send_from_email_address'] + end + + if attributes.key?(:'alphanumeric') + self.alphanumeric = attributes[:'alphanumeric'] + end + + if attributes.key?(:'send_from_email_sender_name') + self.send_from_email_sender_name = attributes[:'send_from_email_sender_name'] + end + + if attributes.key?(:'expiration_seconds') + self.expiration_seconds = attributes[:'expiration_seconds'] + end + + if attributes.key?(:'reply_to_email_address') + self.reply_to_email_address = attributes[:'reply_to_email_address'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @otp_type.nil? + invalid_properties.push('invalid value for "otp_type", otp_type cannot be nil.') + end + + if @contact.nil? + invalid_properties.push('invalid value for "contact", contact cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @otp_type.nil? + return false if @contact.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + otp_type == o.otp_type && + contact == o.contact && + otp_length == o.otp_length && + email_customization == o.email_customization && + sms_customization == o.sms_customization && + user_identifier == o.user_identifier && + send_from_email_address == o.send_from_email_address && + alphanumeric == o.alphanumeric && + send_from_email_sender_name == o.send_from_email_sender_name && + expiration_seconds == o.expiration_seconds && + reply_to_email_address == o.reply_to_email_address + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [otp_type, contact, otp_length, email_customization, sms_customization, user_identifier, send_from_email_address, alphanumeric, send_from_email_sender_name, expiration_seconds, reply_to_email_address].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/init_otp_request.rb b/turnkey_client/lib/turnkey_client/models/init_otp_request.rb new file mode 100644 index 0000000..bc0e8ef --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/init_otp_request.rb @@ -0,0 +1,288 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class InitOtpRequest + attr_accessor :type + + # Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + attr_accessor :timestamp_ms + + # Unique identifier for a given Organization. + attr_accessor :organization_id + + attr_accessor :parameters + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'timestamp_ms' => :'timestampMs', + :'organization_id' => :'organizationId', + :'parameters' => :'parameters' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'Object', + :'timestamp_ms' => :'Object', + :'organization_id' => :'Object', + :'parameters' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::InitOtpRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::InitOtpRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'timestamp_ms') + self.timestamp_ms = attributes[:'timestamp_ms'] + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @timestamp_ms.nil? + invalid_properties.push('invalid value for "timestamp_ms", timestamp_ms cannot be nil.') + end + + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @parameters.nil? + invalid_properties.push('invalid value for "parameters", parameters cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_INIT_OTP']) + return false unless type_validator.valid?(@type) + return false if @timestamp_ms.nil? + return false if @organization_id.nil? + return false if @parameters.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_INIT_OTP']) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + timestamp_ms == o.timestamp_ms && + organization_id == o.organization_id && + parameters == o.parameters + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, timestamp_ms, organization_id, parameters].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/init_otp_result.rb b/turnkey_client/lib/turnkey_client/models/init_otp_result.rb new file mode 100644 index 0000000..deaedf0 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/init_otp_result.rb @@ -0,0 +1,211 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class InitOtpResult + # Unique identifier for an OTP authentication + attr_accessor :otp_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'otp_id' => :'otpId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'otp_id' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::InitOtpResult` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::InitOtpResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'otp_id') + self.otp_id = attributes[:'otp_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @otp_id.nil? + invalid_properties.push('invalid value for "otp_id", otp_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @otp_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + otp_id == o.otp_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [otp_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/init_user_email_recovery_intent.rb b/turnkey_client/lib/turnkey_client/models/init_user_email_recovery_intent.rb index 9767a23..64f4583 100644 --- a/turnkey_client/lib/turnkey_client/models/init_user_email_recovery_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/init_user_email_recovery_intent.rb @@ -18,7 +18,7 @@ class InitUserEmailRecoveryIntent # Client-side public key generated by the user, to which the recovery bundle will be encrypted. attr_accessor :target_public_key - # Expiration window (in seconds) indicating how long the recovery credential is valid. If not provided, a default of 15 minutes will be used. + # Expiration window (in seconds) indicating how long the recovery credential is valid for. If not provided, a default of 15 minutes will be used. attr_accessor :expiration_seconds attr_accessor :email_customization @@ -46,6 +46,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'expiration_seconds', ]) end diff --git a/turnkey_client/lib/turnkey_client/models/intent.rb b/turnkey_client/lib/turnkey_client/models/intent.rb index dd406d7..e1713b0 100644 --- a/turnkey_client/lib/turnkey_client/models/intent.rb +++ b/turnkey_client/lib/turnkey_client/models/intent.rb @@ -172,6 +172,34 @@ class Intent attr_accessor :update_wallet_intent + attr_accessor :update_policy_intent_v2 + + attr_accessor :create_users_intent_v3 + + attr_accessor :init_otp_auth_intent_v2 + + attr_accessor :init_otp_intent + + attr_accessor :verify_otp_intent + + attr_accessor :otp_login_intent + + attr_accessor :stamp_login_intent + + attr_accessor :oauth_login_intent + + attr_accessor :update_user_name_intent + + attr_accessor :update_user_email_intent + + attr_accessor :update_user_phone_number_intent + + attr_accessor :init_fiat_on_ramp_intent + + attr_accessor :create_smart_contract_interface_intent + + attr_accessor :delete_smart_contract_interface_intent + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -254,7 +282,21 @@ def self.attribute_map :'init_otp_auth_intent' => :'initOtpAuthIntent', :'otp_auth_intent' => :'otpAuthIntent', :'create_sub_organization_intent_v7' => :'createSubOrganizationIntentV7', - :'update_wallet_intent' => :'updateWalletIntent' + :'update_wallet_intent' => :'updateWalletIntent', + :'update_policy_intent_v2' => :'updatePolicyIntentV2', + :'create_users_intent_v3' => :'createUsersIntentV3', + :'init_otp_auth_intent_v2' => :'initOtpAuthIntentV2', + :'init_otp_intent' => :'initOtpIntent', + :'verify_otp_intent' => :'verifyOtpIntent', + :'otp_login_intent' => :'otpLoginIntent', + :'stamp_login_intent' => :'stampLoginIntent', + :'oauth_login_intent' => :'oauthLoginIntent', + :'update_user_name_intent' => :'updateUserNameIntent', + :'update_user_email_intent' => :'updateUserEmailIntent', + :'update_user_phone_number_intent' => :'updateUserPhoneNumberIntent', + :'init_fiat_on_ramp_intent' => :'initFiatOnRampIntent', + :'create_smart_contract_interface_intent' => :'createSmartContractInterfaceIntent', + :'delete_smart_contract_interface_intent' => :'deleteSmartContractInterfaceIntent' } end @@ -340,7 +382,21 @@ def self.openapi_types :'init_otp_auth_intent' => :'Object', :'otp_auth_intent' => :'Object', :'create_sub_organization_intent_v7' => :'Object', - :'update_wallet_intent' => :'Object' + :'update_wallet_intent' => :'Object', + :'update_policy_intent_v2' => :'Object', + :'create_users_intent_v3' => :'Object', + :'init_otp_auth_intent_v2' => :'Object', + :'init_otp_intent' => :'Object', + :'verify_otp_intent' => :'Object', + :'otp_login_intent' => :'Object', + :'stamp_login_intent' => :'Object', + :'oauth_login_intent' => :'Object', + :'update_user_name_intent' => :'Object', + :'update_user_email_intent' => :'Object', + :'update_user_phone_number_intent' => :'Object', + :'init_fiat_on_ramp_intent' => :'Object', + :'create_smart_contract_interface_intent' => :'Object', + :'delete_smart_contract_interface_intent' => :'Object' } end @@ -684,6 +740,62 @@ def initialize(attributes = {}) if attributes.key?(:'update_wallet_intent') self.update_wallet_intent = attributes[:'update_wallet_intent'] end + + if attributes.key?(:'update_policy_intent_v2') + self.update_policy_intent_v2 = attributes[:'update_policy_intent_v2'] + end + + if attributes.key?(:'create_users_intent_v3') + self.create_users_intent_v3 = attributes[:'create_users_intent_v3'] + end + + if attributes.key?(:'init_otp_auth_intent_v2') + self.init_otp_auth_intent_v2 = attributes[:'init_otp_auth_intent_v2'] + end + + if attributes.key?(:'init_otp_intent') + self.init_otp_intent = attributes[:'init_otp_intent'] + end + + if attributes.key?(:'verify_otp_intent') + self.verify_otp_intent = attributes[:'verify_otp_intent'] + end + + if attributes.key?(:'otp_login_intent') + self.otp_login_intent = attributes[:'otp_login_intent'] + end + + if attributes.key?(:'stamp_login_intent') + self.stamp_login_intent = attributes[:'stamp_login_intent'] + end + + if attributes.key?(:'oauth_login_intent') + self.oauth_login_intent = attributes[:'oauth_login_intent'] + end + + if attributes.key?(:'update_user_name_intent') + self.update_user_name_intent = attributes[:'update_user_name_intent'] + end + + if attributes.key?(:'update_user_email_intent') + self.update_user_email_intent = attributes[:'update_user_email_intent'] + end + + if attributes.key?(:'update_user_phone_number_intent') + self.update_user_phone_number_intent = attributes[:'update_user_phone_number_intent'] + end + + if attributes.key?(:'init_fiat_on_ramp_intent') + self.init_fiat_on_ramp_intent = attributes[:'init_fiat_on_ramp_intent'] + end + + if attributes.key?(:'create_smart_contract_interface_intent') + self.create_smart_contract_interface_intent = attributes[:'create_smart_contract_interface_intent'] + end + + if attributes.key?(:'delete_smart_contract_interface_intent') + self.delete_smart_contract_interface_intent = attributes[:'delete_smart_contract_interface_intent'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -783,7 +895,21 @@ def ==(o) init_otp_auth_intent == o.init_otp_auth_intent && otp_auth_intent == o.otp_auth_intent && create_sub_organization_intent_v7 == o.create_sub_organization_intent_v7 && - update_wallet_intent == o.update_wallet_intent + update_wallet_intent == o.update_wallet_intent && + update_policy_intent_v2 == o.update_policy_intent_v2 && + create_users_intent_v3 == o.create_users_intent_v3 && + init_otp_auth_intent_v2 == o.init_otp_auth_intent_v2 && + init_otp_intent == o.init_otp_intent && + verify_otp_intent == o.verify_otp_intent && + otp_login_intent == o.otp_login_intent && + stamp_login_intent == o.stamp_login_intent && + oauth_login_intent == o.oauth_login_intent && + update_user_name_intent == o.update_user_name_intent && + update_user_email_intent == o.update_user_email_intent && + update_user_phone_number_intent == o.update_user_phone_number_intent && + init_fiat_on_ramp_intent == o.init_fiat_on_ramp_intent && + create_smart_contract_interface_intent == o.create_smart_contract_interface_intent && + delete_smart_contract_interface_intent == o.delete_smart_contract_interface_intent end # @see the `==` method @@ -795,7 +921,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [create_organization_intent, create_authenticators_intent, create_users_intent, create_private_keys_intent, sign_raw_payload_intent, create_invitations_intent, accept_invitation_intent, create_policy_intent, disable_private_key_intent, delete_users_intent, delete_authenticators_intent, delete_invitation_intent, delete_organization_intent, delete_policy_intent, create_user_tag_intent, delete_user_tags_intent, sign_transaction_intent, create_api_keys_intent, delete_api_keys_intent, approve_activity_intent, reject_activity_intent, create_private_key_tag_intent, delete_private_key_tags_intent, create_policy_intent_v2, set_payment_method_intent, activate_billing_tier_intent, delete_payment_method_intent, create_policy_intent_v3, create_api_only_users_intent, update_root_quorum_intent, update_user_tag_intent, update_private_key_tag_intent, create_authenticators_intent_v2, accept_invitation_intent_v2, create_organization_intent_v2, create_users_intent_v2, create_sub_organization_intent, create_sub_organization_intent_v2, update_allowed_origins_intent, create_private_keys_intent_v2, update_user_intent, update_policy_intent, set_payment_method_intent_v2, create_sub_organization_intent_v3, create_wallet_intent, create_wallet_accounts_intent, init_user_email_recovery_intent, recover_user_intent, set_organization_feature_intent, remove_organization_feature_intent, sign_raw_payload_intent_v2, sign_transaction_intent_v2, export_private_key_intent, export_wallet_intent, create_sub_organization_intent_v4, email_auth_intent, export_wallet_account_intent, init_import_wallet_intent, import_wallet_intent, init_import_private_key_intent, import_private_key_intent, create_policies_intent, sign_raw_payloads_intent, create_read_only_session_intent, create_oauth_providers_intent, delete_oauth_providers_intent, create_sub_organization_intent_v5, oauth_intent, create_api_keys_intent_v2, create_read_write_session_intent, email_auth_intent_v2, create_sub_organization_intent_v6, delete_private_keys_intent, delete_wallets_intent, create_read_write_session_intent_v2, delete_sub_organization_intent, init_otp_auth_intent, otp_auth_intent, create_sub_organization_intent_v7, update_wallet_intent].hash + [create_organization_intent, create_authenticators_intent, create_users_intent, create_private_keys_intent, sign_raw_payload_intent, create_invitations_intent, accept_invitation_intent, create_policy_intent, disable_private_key_intent, delete_users_intent, delete_authenticators_intent, delete_invitation_intent, delete_organization_intent, delete_policy_intent, create_user_tag_intent, delete_user_tags_intent, sign_transaction_intent, create_api_keys_intent, delete_api_keys_intent, approve_activity_intent, reject_activity_intent, create_private_key_tag_intent, delete_private_key_tags_intent, create_policy_intent_v2, set_payment_method_intent, activate_billing_tier_intent, delete_payment_method_intent, create_policy_intent_v3, create_api_only_users_intent, update_root_quorum_intent, update_user_tag_intent, update_private_key_tag_intent, create_authenticators_intent_v2, accept_invitation_intent_v2, create_organization_intent_v2, create_users_intent_v2, create_sub_organization_intent, create_sub_organization_intent_v2, update_allowed_origins_intent, create_private_keys_intent_v2, update_user_intent, update_policy_intent, set_payment_method_intent_v2, create_sub_organization_intent_v3, create_wallet_intent, create_wallet_accounts_intent, init_user_email_recovery_intent, recover_user_intent, set_organization_feature_intent, remove_organization_feature_intent, sign_raw_payload_intent_v2, sign_transaction_intent_v2, export_private_key_intent, export_wallet_intent, create_sub_organization_intent_v4, email_auth_intent, export_wallet_account_intent, init_import_wallet_intent, import_wallet_intent, init_import_private_key_intent, import_private_key_intent, create_policies_intent, sign_raw_payloads_intent, create_read_only_session_intent, create_oauth_providers_intent, delete_oauth_providers_intent, create_sub_organization_intent_v5, oauth_intent, create_api_keys_intent_v2, create_read_write_session_intent, email_auth_intent_v2, create_sub_organization_intent_v6, delete_private_keys_intent, delete_wallets_intent, create_read_write_session_intent_v2, delete_sub_organization_intent, init_otp_auth_intent, otp_auth_intent, create_sub_organization_intent_v7, update_wallet_intent, update_policy_intent_v2, create_users_intent_v3, init_otp_auth_intent_v2, init_otp_intent, verify_otp_intent, otp_login_intent, stamp_login_intent, oauth_login_intent, update_user_name_intent, update_user_email_intent, update_user_phone_number_intent, init_fiat_on_ramp_intent, create_smart_contract_interface_intent, delete_smart_contract_interface_intent].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/invitation_params.rb b/turnkey_client/lib/turnkey_client/models/invitation_params.rb index bcc58f0..2de70fd 100644 --- a/turnkey_client/lib/turnkey_client/models/invitation_params.rb +++ b/turnkey_client/lib/turnkey_client/models/invitation_params.rb @@ -18,7 +18,7 @@ class InvitationParams # The email address of the intended Invitation recipient. attr_accessor :receiver_user_email - # A list of tags assigned to the Invitation recipient. + # A list of tags assigned to the Invitation recipient. This field, if not needed, should be an empty array in your request body. attr_accessor :receiver_user_tags attr_accessor :access_type diff --git a/turnkey_client/lib/turnkey_client/models/list_private_key_tags_request.rb b/turnkey_client/lib/turnkey_client/models/list_private_key_tags_request.rb index 950d076..378db59 100644 --- a/turnkey_client/lib/turnkey_client/models/list_private_key_tags_request.rb +++ b/turnkey_client/lib/turnkey_client/models/list_private_key_tags_request.rb @@ -12,7 +12,7 @@ module TurnkeyClient class ListPrivateKeyTagsRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/list_private_key_tags_response.rb b/turnkey_client/lib/turnkey_client/models/list_private_key_tags_response.rb index 004ac8e..07df95b 100644 --- a/turnkey_client/lib/turnkey_client/models/list_private_key_tags_response.rb +++ b/turnkey_client/lib/turnkey_client/models/list_private_key_tags_response.rb @@ -12,7 +12,7 @@ module TurnkeyClient class ListPrivateKeyTagsResponse - # A list of Private Key Tags + # A list of private key tags. attr_accessor :private_key_tags # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/list_user_tags_request.rb b/turnkey_client/lib/turnkey_client/models/list_user_tags_request.rb index 3f4a75a..6c62400 100644 --- a/turnkey_client/lib/turnkey_client/models/list_user_tags_request.rb +++ b/turnkey_client/lib/turnkey_client/models/list_user_tags_request.rb @@ -12,7 +12,7 @@ module TurnkeyClient class ListUserTagsRequest - # Unique identifier for a given Organization. + # Unique identifier for a given organization. attr_accessor :organization_id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/list_user_tags_response.rb b/turnkey_client/lib/turnkey_client/models/list_user_tags_response.rb index 2b3ba85..de60e31 100644 --- a/turnkey_client/lib/turnkey_client/models/list_user_tags_response.rb +++ b/turnkey_client/lib/turnkey_client/models/list_user_tags_response.rb @@ -12,7 +12,7 @@ module TurnkeyClient class ListUserTagsResponse - # A list of User Tags + # A list of user tags. attr_accessor :user_tags # Attribute mapping from ruby-style variable name to JSON key. diff --git a/turnkey_client/lib/turnkey_client/models/oauth_intent.rb b/turnkey_client/lib/turnkey_client/models/oauth_intent.rb index 146e1e5..ac8a819 100644 --- a/turnkey_client/lib/turnkey_client/models/oauth_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/oauth_intent.rb @@ -21,16 +21,20 @@ class OauthIntent # Optional human-readable name for an API Key. If none provided, default to Oauth - attr_accessor :api_key_name - # Expiration window (in seconds) indicating how long the API key is valid. If not provided, a default of 15 minutes will be used. + # Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. attr_accessor :expiration_seconds + # Invalidate all other previously generated Oauth API keys + attr_accessor :invalidate_existing + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'oidc_token' => :'oidcToken', :'target_public_key' => :'targetPublicKey', :'api_key_name' => :'apiKeyName', - :'expiration_seconds' => :'expirationSeconds' + :'expiration_seconds' => :'expirationSeconds', + :'invalidate_existing' => :'invalidateExisting' } end @@ -40,13 +44,17 @@ def self.openapi_types :'oidc_token' => :'Object', :'target_public_key' => :'Object', :'api_key_name' => :'Object', - :'expiration_seconds' => :'Object' + :'expiration_seconds' => :'Object', + :'invalidate_existing' => :'Object' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'api_key_name', + :'expiration_seconds', + :'invalidate_existing' ]) end @@ -80,6 +88,10 @@ def initialize(attributes = {}) if attributes.key?(:'expiration_seconds') self.expiration_seconds = attributes[:'expiration_seconds'] end + + if attributes.key?(:'invalidate_existing') + self.invalidate_existing = attributes[:'invalidate_existing'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -113,7 +125,8 @@ def ==(o) oidc_token == o.oidc_token && target_public_key == o.target_public_key && api_key_name == o.api_key_name && - expiration_seconds == o.expiration_seconds + expiration_seconds == o.expiration_seconds && + invalidate_existing == o.invalidate_existing end # @see the `==` method @@ -125,7 +138,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [oidc_token, target_public_key, api_key_name, expiration_seconds].hash + [oidc_token, target_public_key, api_key_name, expiration_seconds, invalidate_existing].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/oauth_login_intent.rb b/turnkey_client/lib/turnkey_client/models/oauth_login_intent.rb new file mode 100644 index 0000000..fa23d5b --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/oauth_login_intent.rb @@ -0,0 +1,248 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class OauthLoginIntent + # Base64 encoded OIDC token + attr_accessor :oidc_token + + # Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the oidc token associated with this request + attr_accessor :public_key + + # Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used. + attr_accessor :expiration_seconds + + # Invalidate all other previously generated Login API keys + attr_accessor :invalidate_existing + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'oidc_token' => :'oidcToken', + :'public_key' => :'publicKey', + :'expiration_seconds' => :'expirationSeconds', + :'invalidate_existing' => :'invalidateExisting' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'oidc_token' => :'Object', + :'public_key' => :'Object', + :'expiration_seconds' => :'Object', + :'invalidate_existing' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'expiration_seconds', + :'invalidate_existing' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::OauthLoginIntent` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::OauthLoginIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'oidc_token') + self.oidc_token = attributes[:'oidc_token'] + end + + if attributes.key?(:'public_key') + self.public_key = attributes[:'public_key'] + end + + if attributes.key?(:'expiration_seconds') + self.expiration_seconds = attributes[:'expiration_seconds'] + end + + if attributes.key?(:'invalidate_existing') + self.invalidate_existing = attributes[:'invalidate_existing'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @oidc_token.nil? + invalid_properties.push('invalid value for "oidc_token", oidc_token cannot be nil.') + end + + if @public_key.nil? + invalid_properties.push('invalid value for "public_key", public_key cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @oidc_token.nil? + return false if @public_key.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + oidc_token == o.oidc_token && + public_key == o.public_key && + expiration_seconds == o.expiration_seconds && + invalidate_existing == o.invalidate_existing + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [oidc_token, public_key, expiration_seconds, invalidate_existing].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/oauth_login_request.rb b/turnkey_client/lib/turnkey_client/models/oauth_login_request.rb new file mode 100644 index 0000000..9d3ef47 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/oauth_login_request.rb @@ -0,0 +1,288 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class OauthLoginRequest + attr_accessor :type + + # Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + attr_accessor :timestamp_ms + + # Unique identifier for a given Organization. + attr_accessor :organization_id + + attr_accessor :parameters + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'timestamp_ms' => :'timestampMs', + :'organization_id' => :'organizationId', + :'parameters' => :'parameters' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'Object', + :'timestamp_ms' => :'Object', + :'organization_id' => :'Object', + :'parameters' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::OauthLoginRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::OauthLoginRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'timestamp_ms') + self.timestamp_ms = attributes[:'timestamp_ms'] + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @timestamp_ms.nil? + invalid_properties.push('invalid value for "timestamp_ms", timestamp_ms cannot be nil.') + end + + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @parameters.nil? + invalid_properties.push('invalid value for "parameters", parameters cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_OAUTH_LOGIN']) + return false unless type_validator.valid?(@type) + return false if @timestamp_ms.nil? + return false if @organization_id.nil? + return false if @parameters.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_OAUTH_LOGIN']) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + timestamp_ms == o.timestamp_ms && + organization_id == o.organization_id && + parameters == o.parameters + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, timestamp_ms, organization_id, parameters].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/oauth_login_result.rb b/turnkey_client/lib/turnkey_client/models/oauth_login_result.rb new file mode 100644 index 0000000..bb3d7ac --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/oauth_login_result.rb @@ -0,0 +1,211 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class OauthLoginResult + # Signed JWT containing an expiry, public key, session type, user id, and organization id + attr_accessor :session + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'session' => :'session' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'session' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::OauthLoginResult` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::OauthLoginResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'session') + self.session = attributes[:'session'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @session.nil? + invalid_properties.push('invalid value for "session", session cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @session.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + session == o.session + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [session].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/otp_auth_intent.rb b/turnkey_client/lib/turnkey_client/models/otp_auth_intent.rb index 9cab56c..3941788 100644 --- a/turnkey_client/lib/turnkey_client/models/otp_auth_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/otp_auth_intent.rb @@ -15,7 +15,7 @@ class OtpAuthIntent # ID representing the result of an init OTP activity. attr_accessor :otp_id - # 6 digit OTP code sent out to a user's contact (email or SMS) + # OTP sent out to a user's contact (email or SMS) attr_accessor :otp_code # Client-side public key generated by the user, to which the OTP bundle (credentials) will be encrypted. @@ -24,7 +24,7 @@ class OtpAuthIntent # Optional human-readable name for an API Key. If none provided, default to OTP Auth - attr_accessor :api_key_name - # Expiration window (in seconds) indicating how long the API key is valid. If not provided, a default of 15 minutes will be used. + # Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. attr_accessor :expiration_seconds # Invalidate all other previously generated OTP Auth API keys @@ -57,6 +57,9 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'api_key_name', + :'expiration_seconds', + :'invalidate_existing' ]) end @@ -112,6 +115,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "otp_code", otp_code cannot be nil.') end + if @target_public_key.nil? + invalid_properties.push('invalid value for "target_public_key", target_public_key cannot be nil.') + end + invalid_properties end @@ -120,6 +127,7 @@ def list_invalid_properties def valid? return false if @otp_id.nil? return false if @otp_code.nil? + return false if @target_public_key.nil? true end diff --git a/turnkey_client/lib/turnkey_client/models/otp_login_intent.rb b/turnkey_client/lib/turnkey_client/models/otp_login_intent.rb new file mode 100644 index 0000000..7565ddf --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/otp_login_intent.rb @@ -0,0 +1,248 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class OtpLoginIntent + # Signed JWT containing a unique id, expiry, verification type, contact + attr_accessor :verification_token + + # Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the verification token + attr_accessor :public_key + + # Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used. + attr_accessor :expiration_seconds + + # Invalidate all other previously generated Login API keys + attr_accessor :invalidate_existing + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'verification_token' => :'verificationToken', + :'public_key' => :'publicKey', + :'expiration_seconds' => :'expirationSeconds', + :'invalidate_existing' => :'invalidateExisting' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'verification_token' => :'Object', + :'public_key' => :'Object', + :'expiration_seconds' => :'Object', + :'invalidate_existing' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'expiration_seconds', + :'invalidate_existing' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::OtpLoginIntent` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::OtpLoginIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'verification_token') + self.verification_token = attributes[:'verification_token'] + end + + if attributes.key?(:'public_key') + self.public_key = attributes[:'public_key'] + end + + if attributes.key?(:'expiration_seconds') + self.expiration_seconds = attributes[:'expiration_seconds'] + end + + if attributes.key?(:'invalidate_existing') + self.invalidate_existing = attributes[:'invalidate_existing'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @verification_token.nil? + invalid_properties.push('invalid value for "verification_token", verification_token cannot be nil.') + end + + if @public_key.nil? + invalid_properties.push('invalid value for "public_key", public_key cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @verification_token.nil? + return false if @public_key.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + verification_token == o.verification_token && + public_key == o.public_key && + expiration_seconds == o.expiration_seconds && + invalidate_existing == o.invalidate_existing + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [verification_token, public_key, expiration_seconds, invalidate_existing].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/otp_login_request.rb b/turnkey_client/lib/turnkey_client/models/otp_login_request.rb new file mode 100644 index 0000000..229c24a --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/otp_login_request.rb @@ -0,0 +1,288 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class OtpLoginRequest + attr_accessor :type + + # Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + attr_accessor :timestamp_ms + + # Unique identifier for a given Organization. + attr_accessor :organization_id + + attr_accessor :parameters + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'timestamp_ms' => :'timestampMs', + :'organization_id' => :'organizationId', + :'parameters' => :'parameters' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'Object', + :'timestamp_ms' => :'Object', + :'organization_id' => :'Object', + :'parameters' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::OtpLoginRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::OtpLoginRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'timestamp_ms') + self.timestamp_ms = attributes[:'timestamp_ms'] + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @timestamp_ms.nil? + invalid_properties.push('invalid value for "timestamp_ms", timestamp_ms cannot be nil.') + end + + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @parameters.nil? + invalid_properties.push('invalid value for "parameters", parameters cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_OTP_LOGIN']) + return false unless type_validator.valid?(@type) + return false if @timestamp_ms.nil? + return false if @organization_id.nil? + return false if @parameters.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_OTP_LOGIN']) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + timestamp_ms == o.timestamp_ms && + organization_id == o.organization_id && + parameters == o.parameters + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, timestamp_ms, organization_id, parameters].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/otp_login_result.rb b/turnkey_client/lib/turnkey_client/models/otp_login_result.rb new file mode 100644 index 0000000..3fa6f7a --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/otp_login_result.rb @@ -0,0 +1,211 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class OtpLoginResult + # Signed JWT containing an expiry, public key, session type, user id, and organization id + attr_accessor :session + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'session' => :'session' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'session' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::OtpLoginResult` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::OtpLoginResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'session') + self.session = attributes[:'session'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @session.nil? + invalid_properties.push('invalid value for "session", session cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @session.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + session == o.session + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [session].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/outcome.rb b/turnkey_client/lib/turnkey_client/models/outcome.rb new file mode 100644 index 0000000..853b8e9 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/outcome.rb @@ -0,0 +1,31 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class Outcome + ALLOW = 'OUTCOME_ALLOW'.freeze + DENY_EXPLICIT = 'OUTCOME_DENY_EXPLICIT'.freeze + DENY_IMPLICIT = 'OUTCOME_DENY_IMPLICIT'.freeze + REQUIRES_CONSENSUS = 'OUTCOME_REQUIRES_CONSENSUS'.freeze + REJECTED = 'OUTCOME_REJECTED'.freeze + ERROR = 'OUTCOME_ERROR'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = Outcome.constants.select { |c| Outcome::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #Outcome" if constantValues.empty? + value + end + end +end diff --git a/turnkey_client/lib/turnkey_client/models/payload_encoding.rb b/turnkey_client/lib/turnkey_client/models/payload_encoding.rb index 216a912..645339a 100644 --- a/turnkey_client/lib/turnkey_client/models/payload_encoding.rb +++ b/turnkey_client/lib/turnkey_client/models/payload_encoding.rb @@ -14,6 +14,7 @@ module TurnkeyClient class PayloadEncoding HEXADECIMAL = 'PAYLOAD_ENCODING_HEXADECIMAL'.freeze TEXT_UTF8 = 'PAYLOAD_ENCODING_TEXT_UTF8'.freeze + EIP712 = 'PAYLOAD_ENCODING_EIP712'.freeze # Builds the enum from string # @param [String] The enum value in the form of the string diff --git a/turnkey_client/lib/turnkey_client/models/policy.rb b/turnkey_client/lib/turnkey_client/models/policy.rb index 66923e1..994b54e 100644 --- a/turnkey_client/lib/turnkey_client/models/policy.rb +++ b/turnkey_client/lib/turnkey_client/models/policy.rb @@ -64,6 +64,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'consensus', + :'condition' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/private_key_params.rb b/turnkey_client/lib/turnkey_client/models/private_key_params.rb index ea57e54..682935a 100644 --- a/turnkey_client/lib/turnkey_client/models/private_key_params.rb +++ b/turnkey_client/lib/turnkey_client/models/private_key_params.rb @@ -17,7 +17,7 @@ class PrivateKeyParams attr_accessor :curve - # A list of Private Key Tag IDs. + # A list of Private Key Tag IDs. This field, if not needed, should be an empty array in your request body. attr_accessor :private_key_tags # Cryptocurrency-specific formats for a derived address (e.g., Ethereum). diff --git a/turnkey_client/lib/turnkey_client/models/result.rb b/turnkey_client/lib/turnkey_client/models/result.rb index 58b5ae2..3246e5b 100644 --- a/turnkey_client/lib/turnkey_client/models/result.rb +++ b/turnkey_client/lib/turnkey_client/models/result.rb @@ -144,6 +144,32 @@ class Result attr_accessor :update_wallet_result + attr_accessor :update_policy_result_v2 + + attr_accessor :init_otp_auth_result_v2 + + attr_accessor :init_otp_result + + attr_accessor :verify_otp_result + + attr_accessor :otp_login_result + + attr_accessor :stamp_login_result + + attr_accessor :oauth_login_result + + attr_accessor :update_user_name_result + + attr_accessor :update_user_email_result + + attr_accessor :update_user_phone_number_result + + attr_accessor :init_fiat_on_ramp_result + + attr_accessor :create_smart_contract_interface_result + + attr_accessor :delete_smart_contract_interface_result + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -212,7 +238,20 @@ def self.attribute_map :'init_otp_auth_result' => :'initOtpAuthResult', :'otp_auth_result' => :'otpAuthResult', :'create_sub_organization_result_v7' => :'createSubOrganizationResultV7', - :'update_wallet_result' => :'updateWalletResult' + :'update_wallet_result' => :'updateWalletResult', + :'update_policy_result_v2' => :'updatePolicyResultV2', + :'init_otp_auth_result_v2' => :'initOtpAuthResultV2', + :'init_otp_result' => :'initOtpResult', + :'verify_otp_result' => :'verifyOtpResult', + :'otp_login_result' => :'otpLoginResult', + :'stamp_login_result' => :'stampLoginResult', + :'oauth_login_result' => :'oauthLoginResult', + :'update_user_name_result' => :'updateUserNameResult', + :'update_user_email_result' => :'updateUserEmailResult', + :'update_user_phone_number_result' => :'updateUserPhoneNumberResult', + :'init_fiat_on_ramp_result' => :'initFiatOnRampResult', + :'create_smart_contract_interface_result' => :'createSmartContractInterfaceResult', + :'delete_smart_contract_interface_result' => :'deleteSmartContractInterfaceResult' } end @@ -284,7 +323,20 @@ def self.openapi_types :'init_otp_auth_result' => :'Object', :'otp_auth_result' => :'Object', :'create_sub_organization_result_v7' => :'Object', - :'update_wallet_result' => :'Object' + :'update_wallet_result' => :'Object', + :'update_policy_result_v2' => :'Object', + :'init_otp_auth_result_v2' => :'Object', + :'init_otp_result' => :'Object', + :'verify_otp_result' => :'Object', + :'otp_login_result' => :'Object', + :'stamp_login_result' => :'Object', + :'oauth_login_result' => :'Object', + :'update_user_name_result' => :'Object', + :'update_user_email_result' => :'Object', + :'update_user_phone_number_result' => :'Object', + :'init_fiat_on_ramp_result' => :'Object', + :'create_smart_contract_interface_result' => :'Object', + :'delete_smart_contract_interface_result' => :'Object' } end @@ -572,6 +624,58 @@ def initialize(attributes = {}) if attributes.key?(:'update_wallet_result') self.update_wallet_result = attributes[:'update_wallet_result'] end + + if attributes.key?(:'update_policy_result_v2') + self.update_policy_result_v2 = attributes[:'update_policy_result_v2'] + end + + if attributes.key?(:'init_otp_auth_result_v2') + self.init_otp_auth_result_v2 = attributes[:'init_otp_auth_result_v2'] + end + + if attributes.key?(:'init_otp_result') + self.init_otp_result = attributes[:'init_otp_result'] + end + + if attributes.key?(:'verify_otp_result') + self.verify_otp_result = attributes[:'verify_otp_result'] + end + + if attributes.key?(:'otp_login_result') + self.otp_login_result = attributes[:'otp_login_result'] + end + + if attributes.key?(:'stamp_login_result') + self.stamp_login_result = attributes[:'stamp_login_result'] + end + + if attributes.key?(:'oauth_login_result') + self.oauth_login_result = attributes[:'oauth_login_result'] + end + + if attributes.key?(:'update_user_name_result') + self.update_user_name_result = attributes[:'update_user_name_result'] + end + + if attributes.key?(:'update_user_email_result') + self.update_user_email_result = attributes[:'update_user_email_result'] + end + + if attributes.key?(:'update_user_phone_number_result') + self.update_user_phone_number_result = attributes[:'update_user_phone_number_result'] + end + + if attributes.key?(:'init_fiat_on_ramp_result') + self.init_fiat_on_ramp_result = attributes[:'init_fiat_on_ramp_result'] + end + + if attributes.key?(:'create_smart_contract_interface_result') + self.create_smart_contract_interface_result = attributes[:'create_smart_contract_interface_result'] + end + + if attributes.key?(:'delete_smart_contract_interface_result') + self.delete_smart_contract_interface_result = attributes[:'delete_smart_contract_interface_result'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -657,7 +761,20 @@ def ==(o) init_otp_auth_result == o.init_otp_auth_result && otp_auth_result == o.otp_auth_result && create_sub_organization_result_v7 == o.create_sub_organization_result_v7 && - update_wallet_result == o.update_wallet_result + update_wallet_result == o.update_wallet_result && + update_policy_result_v2 == o.update_policy_result_v2 && + init_otp_auth_result_v2 == o.init_otp_auth_result_v2 && + init_otp_result == o.init_otp_result && + verify_otp_result == o.verify_otp_result && + otp_login_result == o.otp_login_result && + stamp_login_result == o.stamp_login_result && + oauth_login_result == o.oauth_login_result && + update_user_name_result == o.update_user_name_result && + update_user_email_result == o.update_user_email_result && + update_user_phone_number_result == o.update_user_phone_number_result && + init_fiat_on_ramp_result == o.init_fiat_on_ramp_result && + create_smart_contract_interface_result == o.create_smart_contract_interface_result && + delete_smart_contract_interface_result == o.delete_smart_contract_interface_result end # @see the `==` method @@ -669,7 +786,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [create_organization_result, create_authenticators_result, create_users_result, create_private_keys_result, create_invitations_result, accept_invitation_result, sign_raw_payload_result, create_policy_result, disable_private_key_result, delete_users_result, delete_authenticators_result, delete_invitation_result, delete_organization_result, delete_policy_result, create_user_tag_result, delete_user_tags_result, sign_transaction_result, delete_api_keys_result, create_api_keys_result, create_private_key_tag_result, delete_private_key_tags_result, set_payment_method_result, activate_billing_tier_result, delete_payment_method_result, create_api_only_users_result, update_root_quorum_result, update_user_tag_result, update_private_key_tag_result, create_sub_organization_result, update_allowed_origins_result, create_private_keys_result_v2, update_user_result, update_policy_result, create_sub_organization_result_v3, create_wallet_result, create_wallet_accounts_result, init_user_email_recovery_result, recover_user_result, set_organization_feature_result, remove_organization_feature_result, export_private_key_result, export_wallet_result, create_sub_organization_result_v4, email_auth_result, export_wallet_account_result, init_import_wallet_result, import_wallet_result, init_import_private_key_result, import_private_key_result, create_policies_result, sign_raw_payloads_result, create_read_only_session_result, create_oauth_providers_result, delete_oauth_providers_result, create_sub_organization_result_v5, oauth_result, create_read_write_session_result, create_sub_organization_result_v6, delete_private_keys_result, delete_wallets_result, create_read_write_session_result_v2, delete_sub_organization_result, init_otp_auth_result, otp_auth_result, create_sub_organization_result_v7, update_wallet_result].hash + [create_organization_result, create_authenticators_result, create_users_result, create_private_keys_result, create_invitations_result, accept_invitation_result, sign_raw_payload_result, create_policy_result, disable_private_key_result, delete_users_result, delete_authenticators_result, delete_invitation_result, delete_organization_result, delete_policy_result, create_user_tag_result, delete_user_tags_result, sign_transaction_result, delete_api_keys_result, create_api_keys_result, create_private_key_tag_result, delete_private_key_tags_result, set_payment_method_result, activate_billing_tier_result, delete_payment_method_result, create_api_only_users_result, update_root_quorum_result, update_user_tag_result, update_private_key_tag_result, create_sub_organization_result, update_allowed_origins_result, create_private_keys_result_v2, update_user_result, update_policy_result, create_sub_organization_result_v3, create_wallet_result, create_wallet_accounts_result, init_user_email_recovery_result, recover_user_result, set_organization_feature_result, remove_organization_feature_result, export_private_key_result, export_wallet_result, create_sub_organization_result_v4, email_auth_result, export_wallet_account_result, init_import_wallet_result, import_wallet_result, init_import_private_key_result, import_private_key_result, create_policies_result, sign_raw_payloads_result, create_read_only_session_result, create_oauth_providers_result, delete_oauth_providers_result, create_sub_organization_result_v5, oauth_result, create_read_write_session_result, create_sub_organization_result_v6, delete_private_keys_result, delete_wallets_result, create_read_write_session_result_v2, delete_sub_organization_result, init_otp_auth_result, otp_auth_result, create_sub_organization_result_v7, update_wallet_result, update_policy_result_v2, init_otp_auth_result_v2, init_otp_result, verify_otp_result, otp_login_result, stamp_login_result, oauth_login_result, update_user_name_result, update_user_email_result, update_user_phone_number_result, init_fiat_on_ramp_result, create_smart_contract_interface_result, delete_smart_contract_interface_result].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/root_user_params.rb b/turnkey_client/lib/turnkey_client/models/root_user_params.rb index 048b6a4..dca977f 100644 --- a/turnkey_client/lib/turnkey_client/models/root_user_params.rb +++ b/turnkey_client/lib/turnkey_client/models/root_user_params.rb @@ -18,10 +18,10 @@ class RootUserParams # The user's email address. attr_accessor :user_email - # A list of API Key parameters. + # A list of API Key parameters. This field, if not needed, should be an empty array in your request body. attr_accessor :api_keys - # A list of Authenticator parameters. + # A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. attr_accessor :authenticators # Attribute mapping from ruby-style variable name to JSON key. @@ -47,6 +47,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'user_email', ]) end diff --git a/turnkey_client/lib/turnkey_client/models/root_user_params_v2.rb b/turnkey_client/lib/turnkey_client/models/root_user_params_v2.rb index 0e9c819..c882701 100644 --- a/turnkey_client/lib/turnkey_client/models/root_user_params_v2.rb +++ b/turnkey_client/lib/turnkey_client/models/root_user_params_v2.rb @@ -18,13 +18,13 @@ class RootUserParamsV2 # The user's email address. attr_accessor :user_email - # A list of API Key parameters. + # A list of API Key parameters. This field, if not needed, should be an empty array in your request body. attr_accessor :api_keys - # A list of Authenticator parameters. + # A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. attr_accessor :authenticators - # A list of Oauth providers. + # A list of Oauth providers. This field, if not needed, should be an empty array in your request body. attr_accessor :oauth_providers # Attribute mapping from ruby-style variable name to JSON key. @@ -52,6 +52,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'user_email', ]) end diff --git a/turnkey_client/lib/turnkey_client/models/root_user_params_v3.rb b/turnkey_client/lib/turnkey_client/models/root_user_params_v3.rb index f5fbf47..39c6369 100644 --- a/turnkey_client/lib/turnkey_client/models/root_user_params_v3.rb +++ b/turnkey_client/lib/turnkey_client/models/root_user_params_v3.rb @@ -18,13 +18,13 @@ class RootUserParamsV3 # The user's email address. attr_accessor :user_email - # A list of API Key parameters. + # A list of API Key parameters. This field, if not needed, should be an empty array in your request body. attr_accessor :api_keys - # A list of Authenticator parameters. + # A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. attr_accessor :authenticators - # A list of Oauth providers. + # A list of Oauth providers. This field, if not needed, should be an empty array in your request body. attr_accessor :oauth_providers # Attribute mapping from ruby-style variable name to JSON key. @@ -52,6 +52,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'user_email', ]) end diff --git a/turnkey_client/lib/turnkey_client/models/root_user_params_v4.rb b/turnkey_client/lib/turnkey_client/models/root_user_params_v4.rb index ee16d55..dab22b5 100644 --- a/turnkey_client/lib/turnkey_client/models/root_user_params_v4.rb +++ b/turnkey_client/lib/turnkey_client/models/root_user_params_v4.rb @@ -21,13 +21,13 @@ class RootUserParamsV4 # The user's phone number in E.164 format e.g. +13214567890 attr_accessor :user_phone_number - # A list of API Key parameters. + # A list of API Key parameters. This field, if not needed, should be an empty array in your request body. attr_accessor :api_keys - # A list of Authenticator parameters. + # A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. attr_accessor :authenticators - # A list of Oauth providers. + # A list of Oauth providers. This field, if not needed, should be an empty array in your request body. attr_accessor :oauth_providers # Attribute mapping from ruby-style variable name to JSON key. @@ -57,6 +57,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'user_email', + :'user_phone_number', ]) end diff --git a/turnkey_client/lib/turnkey_client/models/set_organization_feature_intent.rb b/turnkey_client/lib/turnkey_client/models/set_organization_feature_intent.rb index 48ce69e..b6e390c 100644 --- a/turnkey_client/lib/turnkey_client/models/set_organization_feature_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/set_organization_feature_intent.rb @@ -36,6 +36,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'value' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/simple_client_extension_results.rb b/turnkey_client/lib/turnkey_client/models/simple_client_extension_results.rb index 64070c6..42d70a6 100644 --- a/turnkey_client/lib/turnkey_client/models/simple_client_extension_results.rb +++ b/turnkey_client/lib/turnkey_client/models/simple_client_extension_results.rb @@ -39,6 +39,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'appid', + :'appid_exclude', ]) end diff --git a/turnkey_client/lib/turnkey_client/models/smart_contract_interface_type.rb b/turnkey_client/lib/turnkey_client/models/smart_contract_interface_type.rb new file mode 100644 index 0000000..5a153a2 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/smart_contract_interface_type.rb @@ -0,0 +1,27 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class SmartContractInterfaceType + ETHEREUM = 'SMART_CONTRACT_INTERFACE_TYPE_ETHEREUM'.freeze + SOLANA = 'SMART_CONTRACT_INTERFACE_TYPE_SOLANA'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = SmartContractInterfaceType.constants.select { |c| SmartContractInterfaceType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #SmartContractInterfaceType" if constantValues.empty? + value + end + end +end diff --git a/turnkey_client/lib/turnkey_client/models/sms_customization_params.rb b/turnkey_client/lib/turnkey_client/models/sms_customization_params.rb index 4797236..7c19c7c 100644 --- a/turnkey_client/lib/turnkey_client/models/sms_customization_params.rb +++ b/turnkey_client/lib/turnkey_client/models/sms_customization_params.rb @@ -32,6 +32,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'template' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/stamp_login_intent.rb b/turnkey_client/lib/turnkey_client/models/stamp_login_intent.rb new file mode 100644 index 0000000..7f267bf --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/stamp_login_intent.rb @@ -0,0 +1,233 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class StampLoginIntent + # Client-side public key generated by the user, which will be conditionally added to org data based on the passkey stamp associated with this request + attr_accessor :public_key + + # Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used. + attr_accessor :expiration_seconds + + # Invalidate all other previously generated Login API keys + attr_accessor :invalidate_existing + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'public_key' => :'publicKey', + :'expiration_seconds' => :'expirationSeconds', + :'invalidate_existing' => :'invalidateExisting' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'public_key' => :'Object', + :'expiration_seconds' => :'Object', + :'invalidate_existing' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'expiration_seconds', + :'invalidate_existing' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::StampLoginIntent` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::StampLoginIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'public_key') + self.public_key = attributes[:'public_key'] + end + + if attributes.key?(:'expiration_seconds') + self.expiration_seconds = attributes[:'expiration_seconds'] + end + + if attributes.key?(:'invalidate_existing') + self.invalidate_existing = attributes[:'invalidate_existing'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @public_key.nil? + invalid_properties.push('invalid value for "public_key", public_key cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @public_key.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + public_key == o.public_key && + expiration_seconds == o.expiration_seconds && + invalidate_existing == o.invalidate_existing + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [public_key, expiration_seconds, invalidate_existing].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/stamp_login_request.rb b/turnkey_client/lib/turnkey_client/models/stamp_login_request.rb new file mode 100644 index 0000000..539397d --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/stamp_login_request.rb @@ -0,0 +1,288 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class StampLoginRequest + attr_accessor :type + + # Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + attr_accessor :timestamp_ms + + # Unique identifier for a given Organization. + attr_accessor :organization_id + + attr_accessor :parameters + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'timestamp_ms' => :'timestampMs', + :'organization_id' => :'organizationId', + :'parameters' => :'parameters' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'Object', + :'timestamp_ms' => :'Object', + :'organization_id' => :'Object', + :'parameters' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::StampLoginRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::StampLoginRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'timestamp_ms') + self.timestamp_ms = attributes[:'timestamp_ms'] + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @timestamp_ms.nil? + invalid_properties.push('invalid value for "timestamp_ms", timestamp_ms cannot be nil.') + end + + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @parameters.nil? + invalid_properties.push('invalid value for "parameters", parameters cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_STAMP_LOGIN']) + return false unless type_validator.valid?(@type) + return false if @timestamp_ms.nil? + return false if @organization_id.nil? + return false if @parameters.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_STAMP_LOGIN']) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + timestamp_ms == o.timestamp_ms && + organization_id == o.organization_id && + parameters == o.parameters + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, timestamp_ms, organization_id, parameters].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/stamp_login_result.rb b/turnkey_client/lib/turnkey_client/models/stamp_login_result.rb new file mode 100644 index 0000000..3d3b29c --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/stamp_login_result.rb @@ -0,0 +1,211 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class StampLoginResult + # Signed JWT containing an expiry, public key, session type, user id, and organization id + attr_accessor :session + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'session' => :'session' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'session' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::StampLoginResult` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::StampLoginResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'session') + self.session = attributes[:'session'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @session.nil? + invalid_properties.push('invalid value for "session", session cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @session.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + session == o.session + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [session].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/transaction_type.rb b/turnkey_client/lib/turnkey_client/models/transaction_type.rb index a287934..9223dce 100644 --- a/turnkey_client/lib/turnkey_client/models/transaction_type.rb +++ b/turnkey_client/lib/turnkey_client/models/transaction_type.rb @@ -14,6 +14,7 @@ module TurnkeyClient class TransactionType ETHEREUM = 'TRANSACTION_TYPE_ETHEREUM'.freeze SOLANA = 'TRANSACTION_TYPE_SOLANA'.freeze + TRON = 'TRANSACTION_TYPE_TRON'.freeze # Builds the enum from string # @param [String] The enum value in the form of the string diff --git a/turnkey_client/lib/turnkey_client/models/ump_v1_policy_evaluation.rb b/turnkey_client/lib/turnkey_client/models/ump_v1_policy_evaluation.rb new file mode 100644 index 0000000..883a387 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/ump_v1_policy_evaluation.rb @@ -0,0 +1,214 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class UmpV1PolicyEvaluation + attr_accessor :policy_id + + attr_accessor :outcome + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'policy_id' => :'policyId', + :'outcome' => :'outcome' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'policy_id' => :'Object', + :'outcome' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::UmpV1PolicyEvaluation` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::UmpV1PolicyEvaluation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'policy_id') + self.policy_id = attributes[:'policy_id'] + end + + if attributes.key?(:'outcome') + self.outcome = attributes[:'outcome'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + policy_id == o.policy_id && + outcome == o.outcome + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [policy_id, outcome].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/update_policy_intent.rb b/turnkey_client/lib/turnkey_client/models/update_policy_intent.rb index 69d8f6b..5236aff 100644 --- a/turnkey_client/lib/turnkey_client/models/update_policy_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/update_policy_intent.rb @@ -56,6 +56,10 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'policy_name', + :'policy_condition', + :'policy_consensus', + :'policy_notes' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/update_policy_intent_v2.rb b/turnkey_client/lib/turnkey_client/models/update_policy_intent_v2.rb new file mode 100644 index 0000000..9d69656 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_policy_intent_v2.rb @@ -0,0 +1,264 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class UpdatePolicyIntentV2 + # Unique identifier for a given Policy. + attr_accessor :policy_id + + # Human-readable name for a Policy. + attr_accessor :policy_name + + attr_accessor :policy_effect + + # The condition expression that triggers the Effect (optional). + attr_accessor :policy_condition + + # The consensus expression that triggers the Effect (optional). + attr_accessor :policy_consensus + + # Accompanying notes for a Policy (optional). + attr_accessor :policy_notes + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'policy_id' => :'policyId', + :'policy_name' => :'policyName', + :'policy_effect' => :'policyEffect', + :'policy_condition' => :'policyCondition', + :'policy_consensus' => :'policyConsensus', + :'policy_notes' => :'policyNotes' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'policy_id' => :'Object', + :'policy_name' => :'Object', + :'policy_effect' => :'Object', + :'policy_condition' => :'Object', + :'policy_consensus' => :'Object', + :'policy_notes' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'policy_name', + :'policy_condition', + :'policy_consensus', + :'policy_notes' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::UpdatePolicyIntentV2` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::UpdatePolicyIntentV2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'policy_id') + self.policy_id = attributes[:'policy_id'] + end + + if attributes.key?(:'policy_name') + self.policy_name = attributes[:'policy_name'] + end + + if attributes.key?(:'policy_effect') + self.policy_effect = attributes[:'policy_effect'] + end + + if attributes.key?(:'policy_condition') + self.policy_condition = attributes[:'policy_condition'] + end + + if attributes.key?(:'policy_consensus') + self.policy_consensus = attributes[:'policy_consensus'] + end + + if attributes.key?(:'policy_notes') + self.policy_notes = attributes[:'policy_notes'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @policy_id.nil? + invalid_properties.push('invalid value for "policy_id", policy_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @policy_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + policy_id == o.policy_id && + policy_name == o.policy_name && + policy_effect == o.policy_effect && + policy_condition == o.policy_condition && + policy_consensus == o.policy_consensus && + policy_notes == o.policy_notes + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [policy_id, policy_name, policy_effect, policy_condition, policy_consensus, policy_notes].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/update_policy_request.rb b/turnkey_client/lib/turnkey_client/models/update_policy_request.rb index c88f54e..02c21ad 100644 --- a/turnkey_client/lib/turnkey_client/models/update_policy_request.rb +++ b/turnkey_client/lib/turnkey_client/models/update_policy_request.rb @@ -129,7 +129,7 @@ def list_invalid_properties # @return true if the model is valid def valid? return false if @type.nil? - type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_UPDATE_POLICY']) + type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_UPDATE_POLICY_V2']) return false unless type_validator.valid?(@type) return false if @timestamp_ms.nil? return false if @organization_id.nil? @@ -140,7 +140,7 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_UPDATE_POLICY']) + validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_UPDATE_POLICY_V2']) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end diff --git a/turnkey_client/lib/turnkey_client/models/update_policy_result_v2.rb b/turnkey_client/lib/turnkey_client/models/update_policy_result_v2.rb new file mode 100644 index 0000000..98a3a57 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_policy_result_v2.rb @@ -0,0 +1,211 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class UpdatePolicyResultV2 + # Unique identifier for a given Policy. + attr_accessor :policy_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'policy_id' => :'policyId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'policy_id' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::UpdatePolicyResultV2` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::UpdatePolicyResultV2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'policy_id') + self.policy_id = attributes[:'policy_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @policy_id.nil? + invalid_properties.push('invalid value for "policy_id", policy_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @policy_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + policy_id == o.policy_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [policy_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/update_private_key_tag_intent.rb b/turnkey_client/lib/turnkey_client/models/update_private_key_tag_intent.rb index c360d60..91af8f0 100644 --- a/turnkey_client/lib/turnkey_client/models/update_private_key_tag_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/update_private_key_tag_intent.rb @@ -47,6 +47,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'new_private_key_tag_name', ]) end diff --git a/turnkey_client/lib/turnkey_client/models/update_user_email_intent.rb b/turnkey_client/lib/turnkey_client/models/update_user_email_intent.rb new file mode 100644 index 0000000..251cea1 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_user_email_intent.rb @@ -0,0 +1,237 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class UpdateUserEmailIntent + # Unique identifier for a given User. + attr_accessor :user_id + + # The user's email address. Setting this to an empty string will remove the user's email. + attr_accessor :user_email + + # Signed JWT containing a unique id, expiry, verification type, contact + attr_accessor :verification_token + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId', + :'user_email' => :'userEmail', + :'verification_token' => :'verificationToken' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'Object', + :'user_email' => :'Object', + :'verification_token' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'verification_token' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::UpdateUserEmailIntent` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::UpdateUserEmailIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'user_email') + self.user_email = attributes[:'user_email'] + end + + if attributes.key?(:'verification_token') + self.verification_token = attributes[:'verification_token'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + if @user_email.nil? + invalid_properties.push('invalid value for "user_email", user_email cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @user_id.nil? + return false if @user_email.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + user_email == o.user_email && + verification_token == o.verification_token + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, user_email, verification_token].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/update_user_email_request.rb b/turnkey_client/lib/turnkey_client/models/update_user_email_request.rb new file mode 100644 index 0000000..c3429aa --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_user_email_request.rb @@ -0,0 +1,288 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class UpdateUserEmailRequest + attr_accessor :type + + # Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + attr_accessor :timestamp_ms + + # Unique identifier for a given Organization. + attr_accessor :organization_id + + attr_accessor :parameters + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'timestamp_ms' => :'timestampMs', + :'organization_id' => :'organizationId', + :'parameters' => :'parameters' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'Object', + :'timestamp_ms' => :'Object', + :'organization_id' => :'Object', + :'parameters' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::UpdateUserEmailRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::UpdateUserEmailRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'timestamp_ms') + self.timestamp_ms = attributes[:'timestamp_ms'] + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @timestamp_ms.nil? + invalid_properties.push('invalid value for "timestamp_ms", timestamp_ms cannot be nil.') + end + + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @parameters.nil? + invalid_properties.push('invalid value for "parameters", parameters cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_UPDATE_USER_EMAIL']) + return false unless type_validator.valid?(@type) + return false if @timestamp_ms.nil? + return false if @organization_id.nil? + return false if @parameters.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_UPDATE_USER_EMAIL']) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + timestamp_ms == o.timestamp_ms && + organization_id == o.organization_id && + parameters == o.parameters + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, timestamp_ms, organization_id, parameters].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/update_user_email_result.rb b/turnkey_client/lib/turnkey_client/models/update_user_email_result.rb new file mode 100644 index 0000000..f1d816e --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_user_email_result.rb @@ -0,0 +1,211 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class UpdateUserEmailResult + # Unique identifier of the User whose email was updated. + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::UpdateUserEmailResult` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::UpdateUserEmailResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @user_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/update_user_intent.rb b/turnkey_client/lib/turnkey_client/models/update_user_intent.rb index fd59d8f..fdfb4e7 100644 --- a/turnkey_client/lib/turnkey_client/models/update_user_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/update_user_intent.rb @@ -21,7 +21,7 @@ class UpdateUserIntent # The user's email address. attr_accessor :user_email - # An updated list of User Tags to apply to this User. + # An updated list of User Tags to apply to this User. This field, if not needed, should be an empty array in your request body. attr_accessor :user_tag_ids # The user's phone number in E.164 format e.g. +13214567890 @@ -52,6 +52,9 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'user_name', + :'user_email', + :'user_phone_number' ]) end diff --git a/turnkey_client/lib/turnkey_client/models/update_user_name_intent.rb b/turnkey_client/lib/turnkey_client/models/update_user_name_intent.rb new file mode 100644 index 0000000..1d98c94 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_user_name_intent.rb @@ -0,0 +1,226 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class UpdateUserNameIntent + # Unique identifier for a given User. + attr_accessor :user_id + + # Human-readable name for a User. + attr_accessor :user_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId', + :'user_name' => :'userName' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'Object', + :'user_name' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::UpdateUserNameIntent` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::UpdateUserNameIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'user_name') + self.user_name = attributes[:'user_name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + if @user_name.nil? + invalid_properties.push('invalid value for "user_name", user_name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @user_id.nil? + return false if @user_name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + user_name == o.user_name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, user_name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/update_user_name_request.rb b/turnkey_client/lib/turnkey_client/models/update_user_name_request.rb new file mode 100644 index 0000000..50f5bc6 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_user_name_request.rb @@ -0,0 +1,288 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class UpdateUserNameRequest + attr_accessor :type + + # Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + attr_accessor :timestamp_ms + + # Unique identifier for a given Organization. + attr_accessor :organization_id + + attr_accessor :parameters + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'timestamp_ms' => :'timestampMs', + :'organization_id' => :'organizationId', + :'parameters' => :'parameters' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'Object', + :'timestamp_ms' => :'Object', + :'organization_id' => :'Object', + :'parameters' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::UpdateUserNameRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::UpdateUserNameRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'timestamp_ms') + self.timestamp_ms = attributes[:'timestamp_ms'] + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @timestamp_ms.nil? + invalid_properties.push('invalid value for "timestamp_ms", timestamp_ms cannot be nil.') + end + + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @parameters.nil? + invalid_properties.push('invalid value for "parameters", parameters cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_UPDATE_USER_NAME']) + return false unless type_validator.valid?(@type) + return false if @timestamp_ms.nil? + return false if @organization_id.nil? + return false if @parameters.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_UPDATE_USER_NAME']) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + timestamp_ms == o.timestamp_ms && + organization_id == o.organization_id && + parameters == o.parameters + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, timestamp_ms, organization_id, parameters].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/update_user_name_result.rb b/turnkey_client/lib/turnkey_client/models/update_user_name_result.rb new file mode 100644 index 0000000..c5d1aa6 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_user_name_result.rb @@ -0,0 +1,211 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class UpdateUserNameResult + # Unique identifier of the User whose name was updated. + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::UpdateUserNameResult` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::UpdateUserNameResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @user_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/update_user_phone_number_intent.rb b/turnkey_client/lib/turnkey_client/models/update_user_phone_number_intent.rb new file mode 100644 index 0000000..a999255 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_user_phone_number_intent.rb @@ -0,0 +1,237 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class UpdateUserPhoneNumberIntent + # Unique identifier for a given User. + attr_accessor :user_id + + # The user's phone number in E.164 format e.g. +13214567890. Setting this to an empty string will remove the user's phone number. + attr_accessor :user_phone_number + + # Signed JWT containing a unique id, expiry, verification type, contact + attr_accessor :verification_token + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId', + :'user_phone_number' => :'userPhoneNumber', + :'verification_token' => :'verificationToken' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'Object', + :'user_phone_number' => :'Object', + :'verification_token' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'verification_token' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::UpdateUserPhoneNumberIntent` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::UpdateUserPhoneNumberIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'user_phone_number') + self.user_phone_number = attributes[:'user_phone_number'] + end + + if attributes.key?(:'verification_token') + self.verification_token = attributes[:'verification_token'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + if @user_phone_number.nil? + invalid_properties.push('invalid value for "user_phone_number", user_phone_number cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @user_id.nil? + return false if @user_phone_number.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + user_phone_number == o.user_phone_number && + verification_token == o.verification_token + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, user_phone_number, verification_token].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/update_user_phone_number_request.rb b/turnkey_client/lib/turnkey_client/models/update_user_phone_number_request.rb new file mode 100644 index 0000000..85b234c --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_user_phone_number_request.rb @@ -0,0 +1,288 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class UpdateUserPhoneNumberRequest + attr_accessor :type + + # Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + attr_accessor :timestamp_ms + + # Unique identifier for a given Organization. + attr_accessor :organization_id + + attr_accessor :parameters + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'timestamp_ms' => :'timestampMs', + :'organization_id' => :'organizationId', + :'parameters' => :'parameters' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'Object', + :'timestamp_ms' => :'Object', + :'organization_id' => :'Object', + :'parameters' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::UpdateUserPhoneNumberRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::UpdateUserPhoneNumberRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'timestamp_ms') + self.timestamp_ms = attributes[:'timestamp_ms'] + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @timestamp_ms.nil? + invalid_properties.push('invalid value for "timestamp_ms", timestamp_ms cannot be nil.') + end + + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @parameters.nil? + invalid_properties.push('invalid value for "parameters", parameters cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER']) + return false unless type_validator.valid?(@type) + return false if @timestamp_ms.nil? + return false if @organization_id.nil? + return false if @parameters.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER']) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + timestamp_ms == o.timestamp_ms && + organization_id == o.organization_id && + parameters == o.parameters + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, timestamp_ms, organization_id, parameters].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/update_user_phone_number_result.rb b/turnkey_client/lib/turnkey_client/models/update_user_phone_number_result.rb new file mode 100644 index 0000000..eb8ae89 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_user_phone_number_result.rb @@ -0,0 +1,211 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class UpdateUserPhoneNumberResult + # Unique identifier of the User whose phone number was updated. + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::UpdateUserPhoneNumberResult` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::UpdateUserPhoneNumberResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @user_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/update_user_tag_intent.rb b/turnkey_client/lib/turnkey_client/models/update_user_tag_intent.rb index 05e2e39..9197628 100644 --- a/turnkey_client/lib/turnkey_client/models/update_user_tag_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/update_user_tag_intent.rb @@ -47,6 +47,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'new_user_tag_name', ]) end diff --git a/turnkey_client/lib/turnkey_client/models/user.rb b/turnkey_client/lib/turnkey_client/models/user.rb index 53a411d..06e8f6c 100644 --- a/turnkey_client/lib/turnkey_client/models/user.rb +++ b/turnkey_client/lib/turnkey_client/models/user.rb @@ -27,7 +27,7 @@ class User # A list of Authenticator parameters. attr_accessor :authenticators - # A list of API Key parameters. + # A list of API Key parameters. This field, if not needed, should be an empty array in your request body. attr_accessor :api_keys # A list of User Tag IDs. @@ -75,6 +75,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'user_email', + :'user_phone_number', ]) end diff --git a/turnkey_client/lib/turnkey_client/models/user_params.rb b/turnkey_client/lib/turnkey_client/models/user_params.rb index f4800f0..48150fe 100644 --- a/turnkey_client/lib/turnkey_client/models/user_params.rb +++ b/turnkey_client/lib/turnkey_client/models/user_params.rb @@ -20,13 +20,13 @@ class UserParams attr_accessor :access_type - # A list of API Key parameters. + # A list of API Key parameters. This field, if not needed, should be an empty array in your request body. attr_accessor :api_keys - # A list of Authenticator parameters. + # A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. attr_accessor :authenticators - # A list of User Tag IDs. + # A list of User Tag IDs. This field, if not needed, should be an empty array in your request body. attr_accessor :user_tags # Attribute mapping from ruby-style variable name to JSON key. @@ -56,6 +56,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'user_email', ]) end diff --git a/turnkey_client/lib/turnkey_client/models/user_params_v2.rb b/turnkey_client/lib/turnkey_client/models/user_params_v2.rb index 6466c70..2bf0148 100644 --- a/turnkey_client/lib/turnkey_client/models/user_params_v2.rb +++ b/turnkey_client/lib/turnkey_client/models/user_params_v2.rb @@ -18,13 +18,13 @@ class UserParamsV2 # The user's email address. attr_accessor :user_email - # A list of API Key parameters. + # A list of API Key parameters. This field, if not needed, should be an empty array in your request body. attr_accessor :api_keys - # A list of Authenticator parameters. + # A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. attr_accessor :authenticators - # A list of User Tag IDs. + # A list of User Tag IDs. This field, if not needed, should be an empty array in your request body. attr_accessor :user_tags # Attribute mapping from ruby-style variable name to JSON key. @@ -52,6 +52,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'user_email', ]) end diff --git a/turnkey_client/lib/turnkey_client/models/user_params_v3.rb b/turnkey_client/lib/turnkey_client/models/user_params_v3.rb new file mode 100644 index 0000000..61d150e --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/user_params_v3.rb @@ -0,0 +1,301 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class UserParamsV3 + # Human-readable name for a User. + attr_accessor :user_name + + # The user's email address. + attr_accessor :user_email + + # The user's phone number in E.164 format e.g. +13214567890 + attr_accessor :user_phone_number + + # A list of API Key parameters. This field, if not needed, should be an empty array in your request body. + attr_accessor :api_keys + + # A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body. + attr_accessor :authenticators + + # A list of Oauth providers. This field, if not needed, should be an empty array in your request body. + attr_accessor :oauth_providers + + # A list of User Tag IDs. This field, if not needed, should be an empty array in your request body. + attr_accessor :user_tags + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_name' => :'userName', + :'user_email' => :'userEmail', + :'user_phone_number' => :'userPhoneNumber', + :'api_keys' => :'apiKeys', + :'authenticators' => :'authenticators', + :'oauth_providers' => :'oauthProviders', + :'user_tags' => :'userTags' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_name' => :'Object', + :'user_email' => :'Object', + :'user_phone_number' => :'Object', + :'api_keys' => :'Object', + :'authenticators' => :'Object', + :'oauth_providers' => :'Object', + :'user_tags' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'user_email', + :'user_phone_number', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::UserParamsV3` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::UserParamsV3`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_name') + self.user_name = attributes[:'user_name'] + end + + if attributes.key?(:'user_email') + self.user_email = attributes[:'user_email'] + end + + if attributes.key?(:'user_phone_number') + self.user_phone_number = attributes[:'user_phone_number'] + end + + if attributes.key?(:'api_keys') + if (value = attributes[:'api_keys']).is_a?(Array) + self.api_keys = value + end + end + + if attributes.key?(:'authenticators') + if (value = attributes[:'authenticators']).is_a?(Array) + self.authenticators = value + end + end + + if attributes.key?(:'oauth_providers') + if (value = attributes[:'oauth_providers']).is_a?(Array) + self.oauth_providers = value + end + end + + if attributes.key?(:'user_tags') + if (value = attributes[:'user_tags']).is_a?(Array) + self.user_tags = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @user_name.nil? + invalid_properties.push('invalid value for "user_name", user_name cannot be nil.') + end + + if @api_keys.nil? + invalid_properties.push('invalid value for "api_keys", api_keys cannot be nil.') + end + + if @authenticators.nil? + invalid_properties.push('invalid value for "authenticators", authenticators cannot be nil.') + end + + if @oauth_providers.nil? + invalid_properties.push('invalid value for "oauth_providers", oauth_providers cannot be nil.') + end + + if @user_tags.nil? + invalid_properties.push('invalid value for "user_tags", user_tags cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @user_name.nil? + return false if @api_keys.nil? + return false if @authenticators.nil? + return false if @oauth_providers.nil? + return false if @user_tags.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_name == o.user_name && + user_email == o.user_email && + user_phone_number == o.user_phone_number && + api_keys == o.api_keys && + authenticators == o.authenticators && + oauth_providers == o.oauth_providers && + user_tags == o.user_tags + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_name, user_email, user_phone_number, api_keys, authenticators, oauth_providers, user_tags].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/verify_otp_intent.rb b/turnkey_client/lib/turnkey_client/models/verify_otp_intent.rb new file mode 100644 index 0000000..2243430 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/verify_otp_intent.rb @@ -0,0 +1,237 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class VerifyOtpIntent + # ID representing the result of an init OTP activity. + attr_accessor :otp_id + + # OTP sent out to a user's contact (email or SMS) + attr_accessor :otp_code + + # Expiration window (in seconds) indicating how long the verification token is valid for. If not provided, a default of 1 hour will be used. Maximum value is 86400 seconds (24 hours) + attr_accessor :expiration_seconds + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'otp_id' => :'otpId', + :'otp_code' => :'otpCode', + :'expiration_seconds' => :'expirationSeconds' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'otp_id' => :'Object', + :'otp_code' => :'Object', + :'expiration_seconds' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'expiration_seconds' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::VerifyOtpIntent` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::VerifyOtpIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'otp_id') + self.otp_id = attributes[:'otp_id'] + end + + if attributes.key?(:'otp_code') + self.otp_code = attributes[:'otp_code'] + end + + if attributes.key?(:'expiration_seconds') + self.expiration_seconds = attributes[:'expiration_seconds'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @otp_id.nil? + invalid_properties.push('invalid value for "otp_id", otp_id cannot be nil.') + end + + if @otp_code.nil? + invalid_properties.push('invalid value for "otp_code", otp_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @otp_id.nil? + return false if @otp_code.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + otp_id == o.otp_id && + otp_code == o.otp_code && + expiration_seconds == o.expiration_seconds + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [otp_id, otp_code, expiration_seconds].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/verify_otp_request.rb b/turnkey_client/lib/turnkey_client/models/verify_otp_request.rb new file mode 100644 index 0000000..3a00848 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/verify_otp_request.rb @@ -0,0 +1,288 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class VerifyOtpRequest + attr_accessor :type + + # Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + attr_accessor :timestamp_ms + + # Unique identifier for a given Organization. + attr_accessor :organization_id + + attr_accessor :parameters + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'timestamp_ms' => :'timestampMs', + :'organization_id' => :'organizationId', + :'parameters' => :'parameters' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'Object', + :'timestamp_ms' => :'Object', + :'organization_id' => :'Object', + :'parameters' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::VerifyOtpRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::VerifyOtpRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'timestamp_ms') + self.timestamp_ms = attributes[:'timestamp_ms'] + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @timestamp_ms.nil? + invalid_properties.push('invalid value for "timestamp_ms", timestamp_ms cannot be nil.') + end + + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @parameters.nil? + invalid_properties.push('invalid value for "parameters", parameters cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_VERIFY_OTP']) + return false unless type_validator.valid?(@type) + return false if @timestamp_ms.nil? + return false if @organization_id.nil? + return false if @parameters.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_VERIFY_OTP']) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + timestamp_ms == o.timestamp_ms && + organization_id == o.organization_id && + parameters == o.parameters + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, timestamp_ms, organization_id, parameters].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/verify_otp_result.rb b/turnkey_client/lib/turnkey_client/models/verify_otp_result.rb new file mode 100644 index 0000000..48063ff --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/verify_otp_result.rb @@ -0,0 +1,211 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class VerifyOtpResult + # Signed JWT containing a unique id, expiry, verification type, contact. Verification status of a user is updated when the token is consumed (in OTP_LOGIN requests) + attr_accessor :verification_token + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'verification_token' => :'verificationToken' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'verification_token' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::VerifyOtpResult` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::VerifyOtpResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'verification_token') + self.verification_token = attributes[:'verification_token'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @verification_token.nil? + invalid_properties.push('invalid value for "verification_token", verification_token cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @verification_token.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + verification_token == o.verification_token + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [verification_token].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/wallet_account.rb b/turnkey_client/lib/turnkey_client/models/wallet_account.rb index 25cd3ef..f9a3ad7 100644 --- a/turnkey_client/lib/turnkey_client/models/wallet_account.rb +++ b/turnkey_client/lib/turnkey_client/models/wallet_account.rb @@ -37,6 +37,9 @@ class WalletAccount attr_accessor :updated_at + # The public component of this wallet account's underlying cryptographic key pair. + attr_accessor :public_key + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -49,7 +52,8 @@ def self.attribute_map :'address_format' => :'addressFormat', :'address' => :'address', :'created_at' => :'createdAt', - :'updated_at' => :'updatedAt' + :'updated_at' => :'updatedAt', + :'public_key' => :'publicKey' } end @@ -65,13 +69,15 @@ def self.openapi_types :'address_format' => :'Object', :'address' => :'Object', :'created_at' => :'Object', - :'updated_at' => :'Object' + :'updated_at' => :'Object', + :'public_key' => :'Object' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'public_key' ]) end @@ -129,6 +135,10 @@ def initialize(attributes = {}) if attributes.key?(:'updated_at') self.updated_at = attributes[:'updated_at'] end + + if attributes.key?(:'public_key') + self.public_key = attributes[:'public_key'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -208,7 +218,8 @@ def ==(o) address_format == o.address_format && address == o.address && created_at == o.created_at && - updated_at == o.updated_at + updated_at == o.updated_at && + public_key == o.public_key end # @see the `==` method @@ -220,7 +231,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [wallet_account_id, organization_id, wallet_id, curve, path_format, path, address_format, address, created_at, updated_at].hash + [wallet_account_id, organization_id, wallet_id, curve, path_format, path, address_format, address, created_at, updated_at, public_key].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/wallet_params.rb b/turnkey_client/lib/turnkey_client/models/wallet_params.rb index eb368c5..748f329 100644 --- a/turnkey_client/lib/turnkey_client/models/wallet_params.rb +++ b/turnkey_client/lib/turnkey_client/models/wallet_params.rb @@ -15,7 +15,7 @@ class WalletParams # Human-readable name for a Wallet. attr_accessor :wallet_name - # A list of wallet Accounts. + # A list of wallet Accounts. This field, if not needed, should be an empty array in your request body. attr_accessor :accounts # Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24. @@ -42,6 +42,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'mnemonic_length' ]) end diff --git a/turnkey_client/lib/turnkey_client/version.rb b/turnkey_client/lib/turnkey_client/version.rb index ab366cc..4a01e5b 100644 --- a/turnkey_client/lib/turnkey_client/version.rb +++ b/turnkey_client/lib/turnkey_client/version.rb @@ -9,5 +9,5 @@ =end module TurnkeyClient - VERSION = '0.0.13' + VERSION = '0.0.14' end diff --git a/turnkey_client_inputs/config.json b/turnkey_client_inputs/config.json index d9fa61e..00e6f31 100644 --- a/turnkey_client_inputs/config.json +++ b/turnkey_client_inputs/config.json @@ -6,5 +6,5 @@ "gemAuthor": "Turnkey Engineering", "gemAuthorEmail": "hello@turnkey.com", "moduleName": "TurnkeyClient", - "gemVersion": "0.0.13" + "gemVersion": "0.0.14" } diff --git a/turnkey_client_inputs/public_api.swagger.json b/turnkey_client_inputs/public_api.swagger.json index 1520d6e..6021d37 100644 --- a/turnkey_client_inputs/public_api.swagger.json +++ b/turnkey_client_inputs/public_api.swagger.json @@ -67,8 +67,8 @@ "paths": { "/public/v1/query/get_activity": { "post": { - "summary": "Get Activity", - "description": "Get details about an Activity", + "summary": "Get activity", + "description": "Get details about an activity.", "operationId": "GetActivity", "responses": { "200": { @@ -94,7 +94,7 @@ "/public/v1/query/get_api_key": { "post": { "summary": "Get API key", - "description": "Get details about an API key", + "description": "Get details about an API key.", "operationId": "GetApiKey", "responses": { "200": { @@ -119,8 +119,8 @@ }, "/public/v1/query/get_api_keys": { "post": { - "summary": "Get API key", - "description": "Get details about API keys for a user", + "summary": "Get API keys", + "description": "Get details about API keys for a user.", "operationId": "GetApiKeys", "responses": { "200": { @@ -145,8 +145,8 @@ }, "/public/v1/query/get_authenticator": { "post": { - "summary": "Get Authenticator", - "description": "Get details about an authenticator", + "summary": "Get authenticator", + "description": "Get details about an authenticator.", "operationId": "GetAuthenticator", "responses": { "200": { @@ -171,8 +171,8 @@ }, "/public/v1/query/get_authenticators": { "post": { - "summary": "Get Authenticators", - "description": "Get details about authenticators for a user", + "summary": "Get authenticators", + "description": "Get details about authenticators for a user.", "operationId": "GetAuthenticators", "responses": { "200": { @@ -198,7 +198,7 @@ "/public/v1/query/get_oauth_providers": { "post": { "summary": "Get Oauth providers", - "description": "Get details about Oauth providers for a user", + "description": "Get details about Oauth providers for a user.", "operationId": "GetOauthProviders", "responses": { "200": { @@ -223,8 +223,8 @@ }, "/public/v1/query/get_organization_configs": { "post": { - "summary": "Get Configs", - "description": "Get quorum settings and features for an organization", + "summary": "Get configs", + "description": "Get quorum settings and features for an organization.", "operationId": "GetOrganizationConfigs", "responses": { "200": { @@ -249,8 +249,8 @@ }, "/public/v1/query/get_policy": { "post": { - "summary": "Get Policy", - "description": "Get details about a Policy", + "summary": "Get policy", + "description": "Get details about a policy.", "operationId": "GetPolicy", "responses": { "200": { @@ -273,10 +273,36 @@ "tags": ["Policies"] } }, + "/public/v1/query/get_policy_evaluations": { + "post": { + "summary": "Get policy evaluations", + "description": "Get the policy evaluations for an activity.", + "operationId": "GetPolicyEvaluations", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetPolicyEvaluationsResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GetPolicyEvaluationsRequest" + } + } + ], + "tags": ["Activities"] + } + }, "/public/v1/query/get_private_key": { "post": { - "summary": "Get Private Key", - "description": "Get details about a Private Key", + "summary": "Get private key", + "description": "Get details about a private key.", "operationId": "GetPrivateKey", "responses": { "200": { @@ -299,10 +325,36 @@ "tags": ["Private Keys"] } }, + "/public/v1/query/get_smart_contract_interface": { + "post": { + "summary": "Get smart contract interface", + "description": "Get details about a smart contract interface.", + "operationId": "GetSmartContractInterface", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetSmartContractInterfaceResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GetSmartContractInterfaceRequest" + } + } + ], + "tags": ["Policies"] + } + }, "/public/v1/query/get_user": { "post": { - "summary": "Get User", - "description": "Get details about a User", + "summary": "Get user", + "description": "Get details about a user.", "operationId": "GetUser", "responses": { "200": { @@ -327,8 +379,8 @@ }, "/public/v1/query/get_wallet": { "post": { - "summary": "Get Wallet", - "description": "Get details about a Wallet", + "summary": "Get wallet", + "description": "Get details about a wallet.", "operationId": "GetWallet", "responses": { "200": { @@ -353,8 +405,8 @@ }, "/public/v1/query/get_wallet_account": { "post": { - "summary": "Get Wallet Account", - "description": "Get a single wallet account", + "summary": "Get wallet account", + "description": "Get a single wallet account.", "operationId": "GetWalletAccount", "responses": { "200": { @@ -379,8 +431,8 @@ }, "/public/v1/query/list_activities": { "post": { - "summary": "List Activities", - "description": "List all Activities within an Organization", + "summary": "List activities", + "description": "List all activities within an organization.", "operationId": "GetActivities", "responses": { "200": { @@ -405,8 +457,8 @@ }, "/public/v1/query/list_policies": { "post": { - "summary": "List Policies", - "description": "List all Policies within an Organization", + "summary": "List policies", + "description": "List all policies within an organization.", "operationId": "GetPolicies", "responses": { "200": { @@ -431,8 +483,8 @@ }, "/public/v1/query/list_private_key_tags": { "post": { - "summary": "List Private Key Tags", - "description": "List all Private Key Tags within an Organization", + "summary": "List private key tags", + "description": "List all private key tags within an organization.", "operationId": "ListPrivateKeyTags", "responses": { "200": { @@ -457,8 +509,8 @@ }, "/public/v1/query/list_private_keys": { "post": { - "summary": "List Private Keys", - "description": "List all Private Keys within an Organization", + "summary": "List private keys", + "description": "List all private keys within an organization.", "operationId": "GetPrivateKeys", "responses": { "200": { @@ -481,9 +533,35 @@ "tags": ["Private Keys"] } }, + "/public/v1/query/list_smart_contract_interfaces": { + "post": { + "summary": "List smart contract interfaces", + "description": "List all smart contract interfaces within an organization.", + "operationId": "GetSmartContractInterfaces", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetSmartContractInterfacesResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GetSmartContractInterfacesRequest" + } + } + ], + "tags": ["Policies"] + } + }, "/public/v1/query/list_suborgs": { "post": { - "summary": "Get Suborgs", + "summary": "Get sub-organizations", "description": "Get all suborg IDs associated given a parent org ID and an optional filter.", "operationId": "GetSubOrgIds", "responses": { @@ -509,8 +587,8 @@ }, "/public/v1/query/list_user_tags": { "post": { - "summary": "List User Tags", - "description": "List all User Tags within an Organization", + "summary": "List user tags", + "description": "List all user tags within an organization.", "operationId": "ListUserTags", "responses": { "200": { @@ -535,8 +613,8 @@ }, "/public/v1/query/list_users": { "post": { - "summary": "List Users", - "description": "List all Users within an Organization", + "summary": "List users", + "description": "List all users within an organization.", "operationId": "GetUsers", "responses": { "200": { @@ -561,7 +639,7 @@ }, "/public/v1/query/list_verified_suborgs": { "post": { - "summary": "Get Verified Suborgs", + "summary": "Get verified sub-organizations", "description": "Get all email or phone verified suborg IDs associated given a parent org ID.", "operationId": "GetVerifiedSubOrgIds", "responses": { @@ -587,8 +665,8 @@ }, "/public/v1/query/list_wallet_accounts": { "post": { - "summary": "List Wallets Accounts", - "description": "List all Accounts within a Wallet", + "summary": "List wallets accounts", + "description": "List all accounts within a wallet.", "operationId": "GetWalletAccounts", "responses": { "200": { @@ -613,8 +691,8 @@ }, "/public/v1/query/list_wallets": { "post": { - "summary": "List Wallets", - "description": "List all Wallets within an Organization", + "summary": "List wallets", + "description": "List all wallets within an organization.", "operationId": "GetWallets", "responses": { "200": { @@ -640,7 +718,7 @@ "/public/v1/query/whoami": { "post": { "summary": "Who am I?", - "description": "Get basic information about your current API or WebAuthN user and their organization. Affords Sub-Organization look ups via Parent Organization for WebAuthN or API key users.", + "description": "Get basic information about your current API or WebAuthN user and their organization. Affords sub-organization look ups via parent organization for WebAuthN or API key users.", "operationId": "GetWhoami", "responses": { "200": { @@ -665,8 +743,8 @@ }, "/public/v1/submit/approve_activity": { "post": { - "summary": "Approve Activity", - "description": "Approve an Activity", + "summary": "Approve activity", + "description": "Approve an activity.", "operationId": "ApproveActivity", "responses": { "200": { @@ -691,8 +769,8 @@ }, "/public/v1/submit/create_api_keys": { "post": { - "summary": "Create API Keys", - "description": "Add api keys to an existing User", + "summary": "Create API keys", + "description": "Add API keys to an existing user.", "operationId": "CreateApiKeys", "responses": { "200": { @@ -717,8 +795,8 @@ }, "/public/v1/submit/create_authenticators": { "post": { - "summary": "Create Authenticators", - "description": "Create Authenticators to authenticate requests to Turnkey", + "summary": "Create authenticators", + "description": "Create authenticators to authenticate requests to Turnkey.", "operationId": "CreateAuthenticators", "responses": { "200": { @@ -743,8 +821,8 @@ }, "/public/v1/submit/create_invitations": { "post": { - "summary": "Create Invitations", - "description": "Create Invitations to join an existing Organization", + "summary": "Create invitations", + "description": "Create invitations to join an existing organization.", "operationId": "CreateInvitations", "responses": { "200": { @@ -769,8 +847,8 @@ }, "/public/v1/submit/create_oauth_providers": { "post": { - "summary": "Create Oauth Providers", - "description": "Creates Oauth providers for a specified user - BETA", + "summary": "Create Oauth providers", + "description": "Create Oauth providers for a specified user.", "operationId": "CreateOauthProviders", "responses": { "200": { @@ -795,8 +873,8 @@ }, "/public/v1/submit/create_policies": { "post": { - "summary": "Create Policies", - "description": "Create new Policies", + "summary": "Create policies", + "description": "Create new policies.", "operationId": "CreatePolicies", "responses": { "200": { @@ -821,8 +899,8 @@ }, "/public/v1/submit/create_policy": { "post": { - "summary": "Create Policy", - "description": "Create a new Policy", + "summary": "Create policy", + "description": "Create a new policy.", "operationId": "CreatePolicy", "responses": { "200": { @@ -847,7 +925,7 @@ }, "/public/v1/submit/create_private_key_tag": { "post": { - "summary": "Create Private Key Tag", + "summary": "Create private key tag", "description": "Create a private key tag and add it to private keys.", "operationId": "CreatePrivateKeyTag", "responses": { @@ -873,8 +951,8 @@ }, "/public/v1/submit/create_private_keys": { "post": { - "summary": "Create Private Keys", - "description": "Create new Private Keys", + "summary": "Create private keys", + "description": "Create new private keys.", "operationId": "CreatePrivateKeys", "responses": { "200": { @@ -899,8 +977,8 @@ }, "/public/v1/submit/create_read_only_session": { "post": { - "summary": "Create Read Only Session", - "description": "Create a read only session for a user (valid for 1 hour)", + "summary": "Create read only session", + "description": "Create a read only session for a user (valid for 1 hour).", "operationId": "CreateReadOnlySession", "responses": { "200": { @@ -925,8 +1003,8 @@ }, "/public/v1/submit/create_read_write_session": { "post": { - "summary": "Create Read Write Session", - "description": "Create a read write session for a user", + "summary": "Create read write session", + "description": "Create a read write session for a user.", "operationId": "CreateReadWriteSession", "responses": { "200": { @@ -949,10 +1027,36 @@ "tags": ["Sessions"] } }, + "/public/v1/submit/create_smart_contract_interface": { + "post": { + "summary": "Create smart contract interface", + "description": "Create an ABI/IDL in JSON.", + "operationId": "CreateSmartContractInterface", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateSmartContractInterfaceRequest" + } + } + ], + "tags": ["Policies"] + } + }, "/public/v1/submit/create_sub_organization": { "post": { - "summary": "Create Sub-Organization", - "description": "Create a new Sub-Organization", + "summary": "Create sub-organization", + "description": "Create a new sub-organization.", "operationId": "CreateSubOrganization", "responses": { "200": { @@ -977,7 +1081,7 @@ }, "/public/v1/submit/create_user_tag": { "post": { - "summary": "Create User Tag", + "summary": "Create user tag", "description": "Create a user tag and add it to users.", "operationId": "CreateUserTag", "responses": { @@ -1003,8 +1107,8 @@ }, "/public/v1/submit/create_users": { "post": { - "summary": "Create Users", - "description": "Create Users in an existing Organization", + "summary": "Create users", + "description": "Create users in an existing organization.", "operationId": "CreateUsers", "responses": { "200": { @@ -1029,8 +1133,8 @@ }, "/public/v1/submit/create_wallet": { "post": { - "summary": "Create Wallet", - "description": "Create a Wallet and derive addresses", + "summary": "Create wallet", + "description": "Create a wallet and derive addresses.", "operationId": "CreateWallet", "responses": { "200": { @@ -1055,8 +1159,8 @@ }, "/public/v1/submit/create_wallet_accounts": { "post": { - "summary": "Create Wallet Accounts", - "description": "Derive additional addresses using an existing wallet", + "summary": "Create wallet accounts", + "description": "Derive additional addresses using an existing wallet.", "operationId": "CreateWalletAccounts", "responses": { "200": { @@ -1081,8 +1185,8 @@ }, "/public/v1/submit/delete_api_keys": { "post": { - "summary": "Delete API Keys", - "description": "Remove api keys from a User", + "summary": "Delete API keys", + "description": "Remove api keys from a user.", "operationId": "DeleteApiKeys", "responses": { "200": { @@ -1107,8 +1211,8 @@ }, "/public/v1/submit/delete_authenticators": { "post": { - "summary": "Delete Authenticators", - "description": "Remove authenticators from a User", + "summary": "Delete authenticators", + "description": "Remove authenticators from a user.", "operationId": "DeleteAuthenticators", "responses": { "200": { @@ -1133,8 +1237,8 @@ }, "/public/v1/submit/delete_invitation": { "post": { - "summary": "Delete Invitation", - "description": "Delete an existing Invitation", + "summary": "Delete invitation", + "description": "Delete an existing invitation.", "operationId": "DeleteInvitation", "responses": { "200": { @@ -1159,8 +1263,8 @@ }, "/public/v1/submit/delete_oauth_providers": { "post": { - "summary": "Delete Oauth Providers", - "description": "Removes Oauth providers for a specified user - BETA", + "summary": "Delete Oauth providers", + "description": "Remove Oauth providers for a specified user.", "operationId": "DeleteOauthProviders", "responses": { "200": { @@ -1185,8 +1289,8 @@ }, "/public/v1/submit/delete_policy": { "post": { - "summary": "Delete Policy", - "description": "Delete an existing Policy", + "summary": "Delete policy", + "description": "Delete an existing policy.", "operationId": "DeletePolicy", "responses": { "200": { @@ -1211,8 +1315,8 @@ }, "/public/v1/submit/delete_private_key_tags": { "post": { - "summary": "Delete Private Key Tags", - "description": "Delete Private Key Tags within an Organization", + "summary": "Delete private key tags", + "description": "Delete private key tags within an organization.", "operationId": "DeletePrivateKeyTags", "responses": { "200": { @@ -1237,8 +1341,8 @@ }, "/public/v1/submit/delete_private_keys": { "post": { - "summary": "Delete Private Keys", - "description": "Deletes private keys for an organization", + "summary": "Delete private keys", + "description": "Delete private keys for an organization.", "operationId": "DeletePrivateKeys", "responses": { "200": { @@ -1261,10 +1365,36 @@ "tags": ["Private Keys"] } }, + "/public/v1/submit/delete_smart_contract_interface": { + "post": { + "summary": "Delete smart contract interface", + "description": "Delete a smart contract interface.", + "operationId": "DeleteSmartContractInterface", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteSmartContractInterfaceRequest" + } + } + ], + "tags": ["Policies"] + } + }, "/public/v1/submit/delete_sub_organization": { "post": { - "summary": "Delete Sub Organization", - "description": "Deletes a sub organization", + "summary": "Delete sub-organization", + "description": "Delete a sub-organization.", "operationId": "DeleteSubOrganization", "responses": { "200": { @@ -1289,8 +1419,8 @@ }, "/public/v1/submit/delete_user_tags": { "post": { - "summary": "Delete User Tags", - "description": "Delete User Tags within an Organization", + "summary": "Delete user tags", + "description": "Delete user tags within an organization.", "operationId": "DeleteUserTags", "responses": { "200": { @@ -1315,8 +1445,8 @@ }, "/public/v1/submit/delete_users": { "post": { - "summary": "Delete Users", - "description": "Delete Users within an Organization", + "summary": "Delete users", + "description": "Delete users within an organization.", "operationId": "DeleteUsers", "responses": { "200": { @@ -1341,8 +1471,8 @@ }, "/public/v1/submit/delete_wallets": { "post": { - "summary": "Delete Wallets", - "description": "Deletes wallets for an organization", + "summary": "Delete wallets", + "description": "Delete wallets for an organization.", "operationId": "DeleteWallets", "responses": { "200": { @@ -1367,8 +1497,8 @@ }, "/public/v1/submit/email_auth": { "post": { - "summary": "Perform Email Auth", - "description": "Authenticate a user via Email", + "summary": "Perform email auth", + "description": "Authenticate a user via email.", "operationId": "EmailAuth", "responses": { "200": { @@ -1393,8 +1523,8 @@ }, "/public/v1/submit/export_private_key": { "post": { - "summary": "Export Private Key", - "description": "Exports a Private Key", + "summary": "Export private key", + "description": "Export a private key.", "operationId": "ExportPrivateKey", "responses": { "200": { @@ -1419,8 +1549,8 @@ }, "/public/v1/submit/export_wallet": { "post": { - "summary": "Export Wallet", - "description": "Exports a Wallet", + "summary": "Export wallet", + "description": "Export a wallet.", "operationId": "ExportWallet", "responses": { "200": { @@ -1445,8 +1575,8 @@ }, "/public/v1/submit/export_wallet_account": { "post": { - "summary": "Export Wallet Account", - "description": "Exports a Wallet Account", + "summary": "Export wallet account", + "description": "Export a wallet account.", "operationId": "ExportWalletAccount", "responses": { "200": { @@ -1471,8 +1601,8 @@ }, "/public/v1/submit/import_private_key": { "post": { - "summary": "Import Private Key", - "description": "Imports a private key", + "summary": "Import private key", + "description": "Import a private key.", "operationId": "ImportPrivateKey", "responses": { "200": { @@ -1497,8 +1627,8 @@ }, "/public/v1/submit/import_wallet": { "post": { - "summary": "Import Wallet", - "description": "Imports a wallet", + "summary": "Import wallet", + "description": "Import a wallet.", "operationId": "ImportWallet", "responses": { "200": { @@ -1521,10 +1651,36 @@ "tags": ["Wallets"] } }, + "/public/v1/submit/init_fiat_on_ramp": { + "post": { + "summary": "Init fiat on ramp", + "description": "Initiate a fiat on ramp flow.", + "operationId": "InitFiatOnRamp", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/InitFiatOnRampRequest" + } + } + ], + "tags": ["On Ramp"] + } + }, "/public/v1/submit/init_import_private_key": { "post": { - "summary": "Init Import Private Key", - "description": "Initializes a new private key import", + "summary": "Init import private key", + "description": "Initialize a new private key import.", "operationId": "InitImportPrivateKey", "responses": { "200": { @@ -1549,8 +1705,8 @@ }, "/public/v1/submit/init_import_wallet": { "post": { - "summary": "Init Import Wallet", - "description": "Initializes a new wallet import", + "summary": "Init import wallet", + "description": "Initialize a new wallet import.", "operationId": "InitImportWallet", "responses": { "200": { @@ -1573,10 +1729,36 @@ "tags": ["Wallets"] } }, + "/public/v1/submit/init_otp": { + "post": { + "summary": "Init generic OTP", + "description": "Initiate a generic OTP activity.", + "operationId": "InitOtp", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/InitOtpRequest" + } + } + ], + "tags": ["User Verification"] + } + }, "/public/v1/submit/init_otp_auth": { "post": { "summary": "Init OTP auth", - "description": "Initiate an OTP auth activity", + "description": "Initiate an OTP auth activity.", "operationId": "InitOtpAuth", "responses": { "200": { @@ -1601,8 +1783,8 @@ }, "/public/v1/submit/init_user_email_recovery": { "post": { - "summary": "Init Email Recovery", - "description": "Initializes a new email recovery", + "summary": "Init email recovery", + "description": "Initialize a new email recovery.", "operationId": "InitUserEmailRecovery", "responses": { "200": { @@ -1628,7 +1810,7 @@ "/public/v1/submit/oauth": { "post": { "summary": "Oauth", - "description": "Authenticate a user with an Oidc token (Oauth) - BETA", + "description": "Authenticate a user with an OIDC token (Oauth).", "operationId": "Oauth", "responses": { "200": { @@ -1651,10 +1833,36 @@ "tags": ["User Auth"] } }, + "/public/v1/submit/oauth_login": { + "post": { + "summary": "Login with Oauth", + "description": "Create an Oauth session for a user.", + "operationId": "OauthLogin", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/OauthLoginRequest" + } + } + ], + "tags": ["Sessions"] + } + }, "/public/v1/submit/otp_auth": { "post": { "summary": "OTP auth", - "description": "Authenticate a user with an OTP code sent via email or SMS", + "description": "Authenticate a user with an OTP code sent via email or SMS.", "operationId": "OtpAuth", "responses": { "200": { @@ -1677,10 +1885,36 @@ "tags": ["User Auth"] } }, + "/public/v1/submit/otp_login": { + "post": { + "summary": "Login with OTP", + "description": "Create an OTP session for a user.", + "operationId": "OtpLogin", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/OtpLoginRequest" + } + } + ], + "tags": ["Sessions"] + } + }, "/public/v1/submit/recover_user": { "post": { "summary": "Recover a user", - "description": "Completes the process of recovering a user by adding an authenticator", + "description": "Complete the process of recovering a user by adding an authenticator.", "operationId": "RecoverUser", "responses": { "200": { @@ -1705,8 +1939,8 @@ }, "/public/v1/submit/reject_activity": { "post": { - "summary": "Reject Activity", - "description": "Reject an Activity", + "summary": "Reject activity", + "description": "Reject an activity.", "operationId": "RejectActivity", "responses": { "200": { @@ -1731,8 +1965,8 @@ }, "/public/v1/submit/remove_organization_feature": { "post": { - "summary": "Remove Organization Feature", - "description": "Removes an organization feature. This activity must be approved by the current root quorum.", + "summary": "Remove organization feature", + "description": "Remove an organization feature. This activity must be approved by the current root quorum.", "operationId": "RemoveOrganizationFeature", "responses": { "200": { @@ -1757,8 +1991,8 @@ }, "/public/v1/submit/set_organization_feature": { "post": { - "summary": "Set Organization Feature", - "description": "Sets an organization feature. This activity must be approved by the current root quorum.", + "summary": "Set organization feature", + "description": "Set an organization feature. This activity must be approved by the current root quorum.", "operationId": "SetOrganizationFeature", "responses": { "200": { @@ -1783,8 +2017,8 @@ }, "/public/v1/submit/sign_raw_payload": { "post": { - "summary": "Sign Raw Payload", - "description": "Sign a raw payload", + "summary": "Sign raw payload", + "description": "Sign a raw payload.", "operationId": "SignRawPayload", "responses": { "200": { @@ -1809,8 +2043,8 @@ }, "/public/v1/submit/sign_raw_payloads": { "post": { - "summary": "Sign Raw Payloads", - "description": "Sign multiple raw payloads with the same signing parameters", + "summary": "Sign raw payloads", + "description": "Sign multiple raw payloads with the same signing parameters.", "operationId": "SignRawPayloads", "responses": { "200": { @@ -1835,8 +2069,8 @@ }, "/public/v1/submit/sign_transaction": { "post": { - "summary": "Sign Transaction", - "description": "Sign a transaction", + "summary": "Sign transaction", + "description": "Sign a transaction.", "operationId": "SignTransaction", "responses": { "200": { @@ -1859,10 +2093,36 @@ "tags": ["Signing"] } }, + "/public/v1/submit/stamp_login": { + "post": { + "summary": "Login with a stamp", + "description": "Create a session for a user through stamping client side (API key, wallet client, or passkey client).", + "operationId": "StampLogin", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/StampLoginRequest" + } + } + ], + "tags": ["Sessions"] + } + }, "/public/v1/submit/update_policy": { "post": { - "summary": "Update Policy", - "description": "Update an existing Policy", + "summary": "Update policy", + "description": "Update an existing policy.", "operationId": "UpdatePolicy", "responses": { "200": { @@ -1887,7 +2147,7 @@ }, "/public/v1/submit/update_private_key_tag": { "post": { - "summary": "Update Private Key Tag", + "summary": "Update private key tag", "description": "Update human-readable name or associated private keys. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail.", "operationId": "UpdatePrivateKeyTag", "responses": { @@ -1913,7 +2173,7 @@ }, "/public/v1/submit/update_root_quorum": { "post": { - "summary": "Update Root Quorum", + "summary": "Update root quorum", "description": "Set the threshold and members of the root quorum. This activity must be approved by the current root quorum.", "operationId": "UpdateRootQuorum", "responses": { @@ -1939,8 +2199,8 @@ }, "/public/v1/submit/update_user": { "post": { - "summary": "Update User", - "description": "Update a User in an existing Organization", + "summary": "Update user", + "description": "Update a user in an existing organization.", "operationId": "UpdateUser", "responses": { "200": { @@ -1963,11 +2223,11 @@ "tags": ["Users"] } }, - "/public/v1/submit/update_user_tag": { + "/public/v1/submit/update_user_email": { "post": { - "summary": "Update User Tag", - "description": "Update human-readable name or associated users. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail.", - "operationId": "UpdateUserTag", + "summary": "Update user's email", + "description": "Update a user's email in an existing organization.", + "operationId": "UpdateUserEmail", "responses": { "200": { "description": "A successful response.", @@ -1982,18 +2242,18 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateUserTagRequest" + "$ref": "#/definitions/UpdateUserEmailRequest" } } ], - "tags": ["User Tags"] + "tags": ["Users"] } }, - "/public/v1/submit/update_wallet": { + "/public/v1/submit/update_user_name": { "post": { - "summary": "Update Wallet", - "description": "Update a wallet for an organization", - "operationId": "UpdateWallet", + "summary": "Update user's name", + "description": "Update a user's name in an existing organization.", + "operationId": "UpdateUserName", "responses": { "200": { "description": "A successful response.", @@ -2008,45 +2268,149 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateWalletRequest" + "$ref": "#/definitions/UpdateUserNameRequest" } } ], - "tags": ["Wallets"] + "tags": ["Users"] } - } - }, - "definitions": { - "AcceptInvitationIntent": { - "type": "object", - "properties": { - "invitationId": { - "type": "string", - "description": "Unique identifier for a given Invitation object." - }, - "userId": { - "type": "string", - "description": "Unique identifier for a given User." - }, - "authenticator": { - "$ref": "#/definitions/AuthenticatorParams", - "description": "WebAuthN hardware devices that can be used to log in to the Turnkey web app." - } - }, - "required": ["invitationId", "userId", "authenticator"] }, - "AcceptInvitationIntentV2": { - "type": "object", - "properties": { - "invitationId": { - "type": "string", - "description": "Unique identifier for a given Invitation object." - }, - "userId": { - "type": "string", - "description": "Unique identifier for a given User." + "/public/v1/submit/update_user_phone_number": { + "post": { + "summary": "Update user's phone number", + "description": "Update a user's phone number in an existing organization.", + "operationId": "UpdateUserPhoneNumber", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } }, - "authenticator": { + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateUserPhoneNumberRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/submit/update_user_tag": { + "post": { + "summary": "Update user tag", + "description": "Update human-readable name or associated users. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail.", + "operationId": "UpdateUserTag", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateUserTagRequest" + } + } + ], + "tags": ["User Tags"] + } + }, + "/public/v1/submit/update_wallet": { + "post": { + "summary": "Update wallet", + "description": "Update a wallet for an organization.", + "operationId": "UpdateWallet", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateWalletRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/verify_otp": { + "post": { + "summary": "Verify generic OTP", + "description": "Verify a generic OTP.", + "operationId": "VerifyOtp", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/VerifyOtpRequest" + } + } + ], + "tags": ["User Verification"] + } + } + }, + "definitions": { + "AcceptInvitationIntent": { + "type": "object", + "properties": { + "invitationId": { + "type": "string", + "description": "Unique identifier for a given Invitation object." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "authenticator": { + "$ref": "#/definitions/AuthenticatorParams", + "description": "WebAuthN hardware devices that can be used to log in to the Turnkey web app." + } + }, + "required": ["invitationId", "userId", "authenticator"] + }, + "AcceptInvitationIntentV2": { + "type": "object", + "properties": { + "invitationId": { + "type": "string", + "description": "Unique identifier for a given Invitation object." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "authenticator": { "$ref": "#/definitions/AuthenticatorParamsV2", "description": "WebAuthN hardware devices that can be used to log in to the Turnkey web app." } @@ -2167,7 +2531,7 @@ "properties": { "activity": { "$ref": "#/definitions/Activity", - "description": "An action that can that can be taken within the Turnkey infrastructure." + "description": "An action that can be taken within the Turnkey infrastructure." } }, "required": ["activity"] @@ -2265,7 +2629,21 @@ "ACTIVITY_TYPE_INIT_OTP_AUTH", "ACTIVITY_TYPE_OTP_AUTH", "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7", - "ACTIVITY_TYPE_UPDATE_WALLET" + "ACTIVITY_TYPE_UPDATE_WALLET", + "ACTIVITY_TYPE_UPDATE_POLICY_V2", + "ACTIVITY_TYPE_CREATE_USERS_V3", + "ACTIVITY_TYPE_INIT_OTP_AUTH_V2", + "ACTIVITY_TYPE_INIT_OTP", + "ACTIVITY_TYPE_VERIFY_OTP", + "ACTIVITY_TYPE_OTP_LOGIN", + "ACTIVITY_TYPE_STAMP_LOGIN", + "ACTIVITY_TYPE_OAUTH_LOGIN", + "ACTIVITY_TYPE_UPDATE_USER_NAME", + "ACTIVITY_TYPE_UPDATE_USER_EMAIL", + "ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER", + "ACTIVITY_TYPE_INIT_FIAT_ON_RAMP", + "ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE", + "ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE" ] }, "AddressFormat": { @@ -2305,6 +2683,7 @@ "ADDRESS_FORMAT_DOGE_TESTNET", "ADDRESS_FORMAT_TON_V3R2", "ADDRESS_FORMAT_TON_V4R2", + "ADDRESS_FORMAT_TON_V5R1", "ADDRESS_FORMAT_XRP" ] }, @@ -2341,6 +2720,7 @@ "expirationSeconds": { "type": "string", "format": "uint64", + "x-nullable": true, "description": "Optional window (in seconds) indicating how long the API Key should last." } }, @@ -2373,6 +2753,7 @@ }, "expirationSeconds": { "type": "string", + "x-nullable": true, "description": "Optional window (in seconds) indicating how long the API Key should last." } }, @@ -2395,6 +2776,7 @@ }, "expirationSeconds": { "type": "string", + "x-nullable": true, "description": "Optional window (in seconds) indicating how long the API Key should last." } }, @@ -2409,6 +2791,7 @@ }, "userEmail": { "type": "string", + "x-nullable": true, "description": "The email address for this API-only User (optional)." }, "userTags": { @@ -2416,7 +2799,7 @@ "items": { "type": "string" }, - "description": "A list of tags assigned to the new API-only User." + "description": "A list of tags assigned to the new API-only User. This field, if not needed, should be an empty array in your request body." }, "apiKeys": { "type": "array", @@ -2424,7 +2807,7 @@ "type": "object", "$ref": "#/definitions/ApiKeyParams" }, - "description": "A list of API Key parameters." + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." } }, "required": ["userName", "userTags", "apiKeys"] @@ -2918,6 +3301,7 @@ }, "rootUserId": { "type": "string", + "x-nullable": true, "description": "Unique identifier for the root user object." } }, @@ -2940,6 +3324,7 @@ }, "rootUserId": { "type": "string", + "x-nullable": true, "description": "Unique identifier for the root user object." } }, @@ -3066,10 +3451,12 @@ }, "condition": { "type": "string", + "x-nullable": true, "description": "The condition expression that triggers the Effect" }, "consensus": { "type": "string", + "x-nullable": true, "description": "The consensus expression that triggers the Effect" }, "notes": { @@ -3315,11 +3702,13 @@ }, "apiKeyName": { "type": "string", + "x-nullable": true, "description": "Optional human-readable name for an API Key. If none provided, default to Read Write Session - \u003cTimestamp\u003e" }, "expirationSeconds": { "type": "string", - "description": "Expiration window (in seconds) indicating how long the API key is valid. If not provided, a default of 15 minutes will be used." + "x-nullable": true, + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." } }, "required": ["targetPublicKey", "email"] @@ -3333,15 +3722,23 @@ }, "userId": { "type": "string", + "x-nullable": true, "description": "Unique identifier for a given User." }, "apiKeyName": { "type": "string", + "x-nullable": true, "description": "Optional human-readable name for an API Key. If none provided, default to Read Write Session - \u003cTimestamp\u003e" }, "expirationSeconds": { "type": "string", - "description": "Expiration window (in seconds) indicating how long the API key is valid. If not provided, a default of 15 minutes will be used." + "x-nullable": true, + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." + }, + "invalidateExisting": { + "type": "boolean", + "x-nullable": true, + "description": "Invalidate all other previously generated ReadWriteSession API keys" } }, "required": ["targetPublicKey"] @@ -3441,6 +3838,67 @@ "credentialBundle" ] }, + "CreateSmartContractInterfaceIntent": { + "type": "object", + "properties": { + "smartContractAddress": { + "type": "string", + "description": "Corresponding contract address or program ID" + }, + "smartContractInterface": { + "type": "string", + "description": "ABI/IDL as a JSON string" + }, + "type": { + "$ref": "#/definitions/SmartContractInterfaceType" + }, + "label": { + "type": "string", + "description": "Human-readable name for a Smart Contract Interface." + }, + "notes": { + "type": "string", + "description": "Notes for a Smart Contract Interface." + } + }, + "required": [ + "smartContractAddress", + "smartContractInterface", + "type", + "label" + ] + }, + "CreateSmartContractInterfaceRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/CreateSmartContractInterfaceIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "CreateSmartContractInterfaceResult": { + "type": "object", + "properties": { + "smartContractInterfaceId": { + "type": "string", + "description": "The ID of the created Smart Contract Interface." + } + }, + "required": ["smartContractInterfaceId"] + }, "CreateSubOrganizationIntent": { "type": "object", "properties": { @@ -3536,14 +3994,17 @@ }, "wallet": { "$ref": "#/definitions/WalletParams", + "x-nullable": true, "description": "The wallet to create for the sub-organization" }, "disableEmailRecovery": { "type": "boolean", + "x-nullable": true, "description": "Disable email recovery for the sub-organization" }, "disableEmailAuth": { "type": "boolean", + "x-nullable": true, "description": "Disable email auth for the sub-organization" } }, @@ -3571,14 +4032,17 @@ }, "wallet": { "$ref": "#/definitions/WalletParams", + "x-nullable": true, "description": "The wallet to create for the sub-organization" }, "disableEmailRecovery": { "type": "boolean", + "x-nullable": true, "description": "Disable email recovery for the sub-organization" }, "disableEmailAuth": { "type": "boolean", + "x-nullable": true, "description": "Disable email auth for the sub-organization" } }, @@ -3606,14 +4070,17 @@ }, "wallet": { "$ref": "#/definitions/WalletParams", + "x-nullable": true, "description": "The wallet to create for the sub-organization" }, "disableEmailRecovery": { "type": "boolean", + "x-nullable": true, "description": "Disable email recovery for the sub-organization" }, "disableEmailAuth": { "type": "boolean", + "x-nullable": true, "description": "Disable email auth for the sub-organization" } }, @@ -3641,22 +4108,27 @@ }, "wallet": { "$ref": "#/definitions/WalletParams", + "x-nullable": true, "description": "The wallet to create for the sub-organization" }, "disableEmailRecovery": { "type": "boolean", + "x-nullable": true, "description": "Disable email recovery for the sub-organization" }, "disableEmailAuth": { "type": "boolean", + "x-nullable": true, "description": "Disable email auth for the sub-organization" }, "disableSmsAuth": { "type": "boolean", + "x-nullable": true, "description": "Disable OTP SMS auth for the sub-organization" }, "disableOtpEmailAuth": { "type": "boolean", + "x-nullable": true, "description": "Disable OTP email auth for the sub-organization" } }, @@ -3728,7 +4200,8 @@ "type": "string" }, "wallet": { - "$ref": "#/definitions/WalletResult" + "$ref": "#/definitions/WalletResult", + "x-nullable": true }, "rootUserIds": { "type": "array", @@ -3746,7 +4219,8 @@ "type": "string" }, "wallet": { - "$ref": "#/definitions/WalletResult" + "$ref": "#/definitions/WalletResult", + "x-nullable": true }, "rootUserIds": { "type": "array", @@ -3764,7 +4238,8 @@ "type": "string" }, "wallet": { - "$ref": "#/definitions/WalletResult" + "$ref": "#/definitions/WalletResult", + "x-nullable": true }, "rootUserIds": { "type": "array", @@ -3782,7 +4257,8 @@ "type": "string" }, "wallet": { - "$ref": "#/definitions/WalletResult" + "$ref": "#/definitions/WalletResult", + "x-nullable": true }, "rootUserIds": { "type": "array", @@ -3876,12 +4352,26 @@ }, "required": ["users"] }, + "CreateUsersIntentV3": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/UserParamsV3" + }, + "description": "A list of Users." + } + }, + "required": ["users"] + }, "CreateUsersRequest": { "type": "object", "properties": { "type": { "type": "string", - "enum": ["ACTIVITY_TYPE_CREATE_USERS_V2"] + "enum": ["ACTIVITY_TYPE_CREATE_USERS_V3"] }, "timestampMs": { "type": "string", @@ -3892,7 +4382,7 @@ "description": "Unique identifier for a given Organization." }, "parameters": { - "$ref": "#/definitions/CreateUsersIntentV2" + "$ref": "#/definitions/CreateUsersIntentV3" } }, "required": ["type", "timestampMs", "organizationId", "parameters"] @@ -3975,11 +4465,12 @@ "type": "object", "$ref": "#/definitions/WalletAccountParams" }, - "description": "A list of wallet Accounts." + "description": "A list of wallet Accounts. This field, if not needed, should be an empty array in your request body." }, "mnemonicLength": { "type": "integer", "format": "int32", + "x-nullable": true, "description": "Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24." } }, @@ -4041,7 +4532,10 @@ "CREDENTIAL_TYPE_API_KEY_SECP256K1", "CREDENTIAL_TYPE_EMAIL_AUTH_KEY_P256", "CREDENTIAL_TYPE_API_KEY_ED25519", - "CREDENTIAL_TYPE_OTP_AUTH_KEY_P256" + "CREDENTIAL_TYPE_OTP_AUTH_KEY_P256", + "CREDENTIAL_TYPE_READ_WRITE_SESSION_KEY_P256", + "CREDENTIAL_TYPE_OAUTH_KEY_P256", + "CREDENTIAL_TYPE_LOGIN" ] }, "Curve": { @@ -4267,6 +4761,7 @@ "properties": { "paymentMethodId": { "type": "string", + "x-nullable": true, "description": "The payment method that the customer wants to remove." } }, @@ -4389,6 +4884,7 @@ }, "deleteWithoutExport": { "type": "boolean", + "x-nullable": true, "description": "Optional parameter for deleting the private keys, even if any have not been previously exported. If they have been exported, this field is ignored." } }, @@ -4428,11 +4924,53 @@ }, "required": ["privateKeyIds"] }, + "DeleteSmartContractInterfaceIntent": { + "type": "object", + "properties": { + "smartContractInterfaceId": { + "type": "string", + "description": "The ID of a Smart Contract Interface intended for deletion." + } + }, + "required": ["smartContractInterfaceId"] + }, + "DeleteSmartContractInterfaceRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/DeleteSmartContractInterfaceIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "DeleteSmartContractInterfaceResult": { + "type": "object", + "properties": { + "smartContractInterfaceId": { + "type": "string", + "description": "The ID of the deleted Smart Contract Interface." + } + }, + "required": ["smartContractInterfaceId"] + }, "DeleteSubOrganizationIntent": { "type": "object", "properties": { "deleteWithoutExport": { "type": "boolean", + "x-nullable": true, "description": "Sub-organization deletion, by default, requires associated wallets and private keys to be exported for security reasons. Set this boolean to true to force sub-organization deletion even if some wallets or private keys within it have not been exported yet. Default: false." } } @@ -4581,6 +5119,7 @@ }, "deleteWithoutExport": { "type": "boolean", + "x-nullable": true, "description": "Optional parameter for deleting the wallets, even if any have not been previously exported. If they have been exported, this field is ignored." } }, @@ -4657,23 +5196,38 @@ }, "apiKeyName": { "type": "string", + "x-nullable": true, "description": "Optional human-readable name for an API Key. If none provided, default to Email Auth - \u003cTimestamp\u003e" }, "expirationSeconds": { "type": "string", - "description": "Expiration window (in seconds) indicating how long the API key is valid. If not provided, a default of 15 minutes will be used." + "x-nullable": true, + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." }, "emailCustomization": { "$ref": "#/definitions/EmailCustomizationParams", + "x-nullable": true, "description": "Optional parameters for customizing emails. If not provided, the default email will be used." }, "invalidateExisting": { "type": "boolean", + "x-nullable": true, "description": "Invalidate all other previously generated Email Auth API keys" }, "sendFromEmailAddress": { "type": "string", + "x-nullable": true, "description": "Optional custom email address from which to send the email" + }, + "sendFromEmailSenderName": { + "type": "string", + "x-nullable": true, + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "replyToEmailAddress": { + "type": "string", + "x-nullable": true, + "description": "Optional custom email address to use as reply-to" } }, "required": ["email", "targetPublicKey"] @@ -4691,23 +5245,38 @@ }, "apiKeyName": { "type": "string", + "x-nullable": true, "description": "Optional human-readable name for an API Key. If none provided, default to Email Auth - \u003cTimestamp\u003e" }, "expirationSeconds": { "type": "string", - "description": "Expiration window (in seconds) indicating how long the API key is valid. If not provided, a default of 15 minutes will be used." + "x-nullable": true, + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." }, "emailCustomization": { "$ref": "#/definitions/EmailCustomizationParams", + "x-nullable": true, "description": "Optional parameters for customizing emails. If not provided, the default email will be used." }, "invalidateExisting": { "type": "boolean", + "x-nullable": true, "description": "Invalidate all other previously generated Email Auth API keys" }, "sendFromEmailAddress": { "type": "string", + "x-nullable": true, "description": "Optional custom email address from which to send the email" + }, + "sendFromEmailSenderName": { + "type": "string", + "x-nullable": true, + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "replyToEmailAddress": { + "type": "string", + "x-nullable": true, + "description": "Optional custom email address to use as reply-to" } }, "required": ["email", "targetPublicKey"] @@ -4752,22 +5321,27 @@ "properties": { "appName": { "type": "string", + "x-nullable": true, "description": "The name of the application." }, "logoUrl": { "type": "string", + "x-nullable": true, "description": "A URL pointing to a logo in PNG format. Note this logo will be resized to fit into 340px x 124px." }, "magicLinkTemplate": { "type": "string", + "x-nullable": true, "description": "A template for the URL to be used in a magic link button, e.g. `https://dapp.xyz/%s`. The auth bundle will be interpolated into the `%s`." }, "templateVariables": { "type": "string", + "x-nullable": true, "description": "JSON object containing key/value pairs to be used with custom templates." }, "templateId": { "type": "string", + "x-nullable": true, "description": "Unique identifier for a given Email Template. If not specified, the default is the most recent Email Template." } } @@ -4883,6 +5457,7 @@ }, "language": { "$ref": "#/definitions/MnemonicLanguage", + "x-nullable": true, "description": "The language of the mnemonic to export. Defaults to English." } }, @@ -4930,7 +5505,8 @@ "$ref": "#/definitions/FeatureName" }, "value": { - "type": "string" + "type": "string", + "x-nullable": true } } }, @@ -4946,19 +5522,101 @@ "FEATURE_NAME_OTP_EMAIL_AUTH" ] }, + "FiatOnRampBlockchainNetwork": { + "type": "string", + "enum": [ + "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_BITCOIN", + "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_ETHEREUM", + "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_SOLANA", + "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_BASE" + ] + }, + "FiatOnRampCryptoCurrency": { + "type": "string", + "enum": [ + "FIAT_ON_RAMP_CRYPTO_CURRENCY_BTC", + "FIAT_ON_RAMP_CRYPTO_CURRENCY_ETH", + "FIAT_ON_RAMP_CRYPTO_CURRENCY_SOL", + "FIAT_ON_RAMP_CRYPTO_CURRENCY_USDC" + ] + }, + "FiatOnRampCurrency": { + "type": "string", + "enum": [ + "FIAT_ON_RAMP_CURRENCY_AUD", + "FIAT_ON_RAMP_CURRENCY_BGN", + "FIAT_ON_RAMP_CURRENCY_BRL", + "FIAT_ON_RAMP_CURRENCY_CAD", + "FIAT_ON_RAMP_CURRENCY_CHF", + "FIAT_ON_RAMP_CURRENCY_COP", + "FIAT_ON_RAMP_CURRENCY_CZK", + "FIAT_ON_RAMP_CURRENCY_DKK", + "FIAT_ON_RAMP_CURRENCY_DOP", + "FIAT_ON_RAMP_CURRENCY_EGP", + "FIAT_ON_RAMP_CURRENCY_EUR", + "FIAT_ON_RAMP_CURRENCY_GBP", + "FIAT_ON_RAMP_CURRENCY_HKD", + "FIAT_ON_RAMP_CURRENCY_IDR", + "FIAT_ON_RAMP_CURRENCY_ILS", + "FIAT_ON_RAMP_CURRENCY_JOD", + "FIAT_ON_RAMP_CURRENCY_KES", + "FIAT_ON_RAMP_CURRENCY_KWD", + "FIAT_ON_RAMP_CURRENCY_LKR", + "FIAT_ON_RAMP_CURRENCY_MXN", + "FIAT_ON_RAMP_CURRENCY_NGN", + "FIAT_ON_RAMP_CURRENCY_NOK", + "FIAT_ON_RAMP_CURRENCY_NZD", + "FIAT_ON_RAMP_CURRENCY_OMR", + "FIAT_ON_RAMP_CURRENCY_PEN", + "FIAT_ON_RAMP_CURRENCY_PLN", + "FIAT_ON_RAMP_CURRENCY_RON", + "FIAT_ON_RAMP_CURRENCY_SEK", + "FIAT_ON_RAMP_CURRENCY_THB", + "FIAT_ON_RAMP_CURRENCY_TRY", + "FIAT_ON_RAMP_CURRENCY_TWD", + "FIAT_ON_RAMP_CURRENCY_USD", + "FIAT_ON_RAMP_CURRENCY_VND", + "FIAT_ON_RAMP_CURRENCY_ZAR" + ] + }, + "FiatOnRampPaymentMethod": { + "type": "string", + "enum": [ + "FIAT_ON_RAMP_PAYMENT_METHOD_CREDIT_DEBIT_CARD", + "FIAT_ON_RAMP_PAYMENT_METHOD_APPLE_PAY", + "FIAT_ON_RAMP_PAYMENT_METHOD_GBP_BANK_TRANSFER", + "FIAT_ON_RAMP_PAYMENT_METHOD_GBP_OPEN_BANKING_PAYMENT", + "FIAT_ON_RAMP_PAYMENT_METHOD_GOOGLE_PAY", + "FIAT_ON_RAMP_PAYMENT_METHOD_SEPA_BANK_TRANSFER", + "FIAT_ON_RAMP_PAYMENT_METHOD_PIX_INSTANT_PAYMENT", + "FIAT_ON_RAMP_PAYMENT_METHOD_PAYPAL", + "FIAT_ON_RAMP_PAYMENT_METHOD_VENMO", + "FIAT_ON_RAMP_PAYMENT_METHOD_MOONPAY_BALANCE", + "FIAT_ON_RAMP_PAYMENT_METHOD_CRYPTO_ACCOUNT", + "FIAT_ON_RAMP_PAYMENT_METHOD_FIAT_WALLET", + "FIAT_ON_RAMP_PAYMENT_METHOD_ACH_BANK_ACCOUNT" + ] + }, + "FiatOnRampProvider": { + "type": "string", + "enum": [ + "FIAT_ON_RAMP_PROVIDER_COINBASE", + "FIAT_ON_RAMP_PROVIDER_MOONPAY" + ] + }, "GetActivitiesRequest": { "type": "object", "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." }, "filterByStatus": { "type": "array", "items": { "$ref": "#/definitions/ActivityStatus" }, - "description": "Array of Activity Statuses filtering which Activities will be listed in the response." + "description": "Array of activity statuses filtering which activities will be listed in the response." }, "paginationOptions": { "$ref": "#/definitions/Pagination", @@ -4969,7 +5627,7 @@ "items": { "$ref": "#/definitions/ActivityType" }, - "description": "Array of Activity Types filtering which Activities will be listed in the response." + "description": "Array of activity types filtering which activities will be listed in the response." } }, "required": ["organizationId"] @@ -4983,7 +5641,7 @@ "type": "object", "$ref": "#/definitions/Activity" }, - "description": "A list of Activities." + "description": "A list of activities." } }, "required": ["activities"] @@ -4993,11 +5651,11 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." }, "activityId": { "type": "string", - "description": "Unique identifier for a given Activity object." + "description": "Unique identifier for a given activity object." } }, "required": ["organizationId", "activityId"] @@ -5007,7 +5665,7 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." }, "apiKeyId": { "type": "string", @@ -5031,11 +5689,12 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." }, "userId": { "type": "string", - "description": "Unique identifier for a given User." + "x-nullable": true, + "description": "Unique identifier for a given user." } }, "required": ["organizationId"] @@ -5059,11 +5718,11 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." }, "authenticatorId": { "type": "string", - "description": "Unique identifier for a given Authenticator." + "description": "Unique identifier for a given authenticator." } }, "required": ["organizationId", "authenticatorId"] @@ -5083,11 +5742,11 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." }, "userId": { "type": "string", - "description": "Unique identifier for a given User." + "description": "Unique identifier for a given user." } }, "required": ["organizationId", "userId"] @@ -5111,11 +5770,12 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." }, "userId": { "type": "string", - "description": "Unique identifier for a given User." + "x-nullable": true, + "description": "Unique identifier for a given user." } }, "required": ["organizationId"] @@ -5129,7 +5789,7 @@ "type": "object", "$ref": "#/definitions/OauthProvider" }, - "description": "A list of Oauth Providers" + "description": "A list of Oauth providers." } }, "required": ["oauthProviders"] @@ -5139,7 +5799,7 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." } }, "required": ["organizationId"] @@ -5149,7 +5809,7 @@ "properties": { "configs": { "$ref": "#/definitions/Config", - "description": "Organization configs including quorum settings and organization features" + "description": "Organization configs including quorum settings and organization features." } }, "required": ["configs"] @@ -5159,7 +5819,7 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." } }, "required": ["organizationId"] @@ -5173,21 +5833,48 @@ "type": "object", "$ref": "#/definitions/Policy" }, - "description": "A list of Policies." + "description": "A list of policies." } }, "required": ["policies"] }, - "GetPolicyRequest": { + "GetPolicyEvaluationsRequest": { "type": "object", "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." }, - "policyId": { + "activityId": { "type": "string", - "description": "Unique identifier for a given Policy." + "description": "Unique identifier for a given activity." + } + }, + "required": ["organizationId", "activityId"] + }, + "GetPolicyEvaluationsResponse": { + "type": "object", + "properties": { + "policyEvaluations": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/activity.v1.PolicyEvaluation" + } + } + }, + "required": ["policyEvaluations"] + }, + "GetPolicyRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "policyId": { + "type": "string", + "description": "Unique identifier for a given policy." } }, "required": ["organizationId", "policyId"] @@ -5197,7 +5884,7 @@ "properties": { "policy": { "$ref": "#/definitions/Policy", - "description": "Object that codifies rules defining the actions that are permissible within an Organization." + "description": "Object that codifies rules defining the actions that are permissible within an organization." } }, "required": ["policy"] @@ -5207,11 +5894,11 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." }, "privateKeyId": { "type": "string", - "description": "Unique identifier for a given Private Key." + "description": "Unique identifier for a given private key." } }, "required": ["organizationId", "privateKeyId"] @@ -5231,7 +5918,7 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." } }, "required": ["organizationId"] @@ -5245,21 +5932,69 @@ "type": "object", "$ref": "#/definitions/PrivateKey" }, - "description": "A list of Private Keys." + "description": "A list of private keys." } }, "required": ["privateKeys"] }, + "GetSmartContractInterfaceRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "smartContractInterfaceId": { + "type": "string", + "description": "Unique identifier for a given smart contract interface." + } + }, + "required": ["organizationId", "smartContractInterfaceId"] + }, + "GetSmartContractInterfaceResponse": { + "type": "object", + "properties": { + "smartContractInterface": { + "$ref": "#/definitions/data.v1.SmartContractInterface", + "description": "Object to be used in conjunction with policies to guard transaction signing." + } + }, + "required": ["smartContractInterface"] + }, + "GetSmartContractInterfacesRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "GetSmartContractInterfacesResponse": { + "type": "object", + "properties": { + "smartContractInterfaces": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/data.v1.SmartContractInterface" + }, + "description": "A list of smart contract interfaces." + } + }, + "required": ["smartContractInterfaces"] + }, "GetSubOrgIdsRequest": { "type": "object", "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for the parent Organization. This is used to find sub-organizations within it." + "description": "Unique identifier for the parent organization. This is used to find sub-organizations within it." }, "filterType": { "type": "string", - "description": "Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN' or 'PUBLIC_KEY'" + "description": "Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN', 'WALLET_ACCOUNT_ADDRESS' or 'PUBLIC_KEY'" }, "filterValue": { "type": "string", @@ -5290,11 +6025,11 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." }, "userId": { "type": "string", - "description": "Unique identifier for a given User." + "description": "Unique identifier for a given user." } }, "required": ["organizationId", "userId"] @@ -5304,7 +6039,7 @@ "properties": { "user": { "$ref": "#/definitions/User", - "description": "Web and/or API user within your Organization." + "description": "Web and/or API user within your organization." } }, "required": ["user"] @@ -5314,7 +6049,7 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." } }, "required": ["organizationId"] @@ -5328,7 +6063,7 @@ "type": "object", "$ref": "#/definitions/User" }, - "description": "A list of Users." + "description": "A list of users." } }, "required": ["users"] @@ -5338,11 +6073,11 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for the parent Organization. This is used to find sub-organizations within it." + "description": "Unique identifier for the parent organization. This is used to find sub-organizations within it." }, "filterType": { "type": "string", - "description": "Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER'" + "description": "Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER'." }, "filterValue": { "type": "string", @@ -5373,19 +6108,21 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." }, "walletId": { "type": "string", - "description": "Unique identifier for a given Wallet." + "description": "Unique identifier for a given wallet." }, "address": { "type": "string", - "description": "Address corresponding to a Wallet Account." + "x-nullable": true, + "description": "Address corresponding to a wallet account." }, "path": { "type": "string", - "description": "Path corresponding to a Wallet Account." + "x-nullable": true, + "description": "Path corresponding to a wallet account." } }, "required": ["organizationId", "walletId"] @@ -5395,7 +6132,7 @@ "properties": { "account": { "$ref": "#/definitions/WalletAccount", - "description": "The resulting Wallet Account." + "description": "The resulting wallet account." } }, "required": ["account"] @@ -5405,18 +6142,19 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." }, "walletId": { "type": "string", - "description": "Unique identifier for a given Wallet." + "x-nullable": true, + "description": "Unique identifier for a given wallet. If not provided, all accounts for the organization will be returned." }, "paginationOptions": { "$ref": "#/definitions/Pagination", "description": "Parameters used for cursor-based pagination." } }, - "required": ["organizationId", "walletId"] + "required": ["organizationId"] }, "GetWalletAccountsResponse": { "type": "object", @@ -5427,7 +6165,7 @@ "type": "object", "$ref": "#/definitions/WalletAccount" }, - "description": "A list of Accounts generated from a Wallet that share a common seed." + "description": "A list of accounts generated from a wallet that share a common seed." } }, "required": ["accounts"] @@ -5437,11 +6175,11 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." }, "walletId": { "type": "string", - "description": "Unique identifier for a given Wallet." + "description": "Unique identifier for a given wallet." } }, "required": ["organizationId", "walletId"] @@ -5451,7 +6189,7 @@ "properties": { "wallet": { "$ref": "#/definitions/Wallet", - "description": "A collection of deterministically generated cryptographic public / private key pairs that share a common seed" + "description": "A collection of deterministically generated cryptographic public / private key pairs that share a common seed." } }, "required": ["wallet"] @@ -5461,7 +6199,7 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." } }, "required": ["organizationId"] @@ -5475,7 +6213,7 @@ "type": "object", "$ref": "#/definitions/Wallet" }, - "description": "A list of Wallets." + "description": "A list of wallets." } }, "required": ["wallets"] @@ -5485,7 +6223,7 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization. If the request is being made by a WebAuthN user and their Sub-Organization ID is unknown, this can be the Parent Organization ID; using the Sub-Organization ID when possible is preferred due to performance reasons." + "description": "Unique identifier for a given organization. If the request is being made by a WebAuthN user and their sub-organization ID is unknown, this can be the parent organization ID; using the sub-organization ID when possible is preferred due to performance reasons." } }, "required": ["organizationId"] @@ -5495,19 +6233,19 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." }, "organizationName": { "type": "string", - "description": "Human-readable name for an Organization." + "description": "Human-readable name for an organization." }, "userId": { "type": "string", - "description": "Unique identifier for a given User." + "description": "Unique identifier for a given user." }, "username": { "type": "string", - "description": "Human-readable name for a User." + "description": "Human-readable name for a user." } }, "required": ["organizationId", "organizationName", "userId", "username"] @@ -5659,6 +6397,98 @@ }, "required": ["walletId", "addresses"] }, + "InitFiatOnRampIntent": { + "type": "object", + "properties": { + "onrampProvider": { + "$ref": "#/definitions/FiatOnRampProvider", + "description": "Enum to specifiy which on-ramp provider to use" + }, + "walletAddress": { + "type": "string", + "description": "Destination wallet address for the buy transaction." + }, + "network": { + "$ref": "#/definitions/FiatOnRampBlockchainNetwork", + "description": "Blockchain network to be used for the transaction, e.g., bitcoin, ethereum. Maps to MoonPay's network or Coinbase's defaultNetwork." + }, + "cryptoCurrencyCode": { + "$ref": "#/definitions/FiatOnRampCryptoCurrency", + "description": "Code for the cryptocurrency to be purchased, e.g., btc, eth. Maps to MoonPay's currencyCode or Coinbase's defaultAsset." + }, + "fiatCurrencyCode": { + "$ref": "#/definitions/FiatOnRampCurrency", + "x-nullable": true, + "description": "Code for the fiat currency to be used in the transaction, e.g., USD, EUR." + }, + "fiatCurrencyAmount": { + "type": "string", + "x-nullable": true, + "description": "Specifies a preset fiat amount for the transaction, e.g., '100'. Must be greater than '20'. If not provided, the user will be prompted to enter an amount." + }, + "paymentMethod": { + "$ref": "#/definitions/FiatOnRampPaymentMethod", + "x-nullable": true, + "description": "Pre-selected payment method, e.g., CREDIT_DEBIT_CARD, APPLE_PAY. Validated against the chosen provider." + }, + "countryCode": { + "type": "string", + "x-nullable": true, + "description": "ISO 3166-1 two-digit country code for Coinbase representing the purchasing user’s country of residence, e.g., US, GB." + }, + "countrySubdivisionCode": { + "type": "string", + "x-nullable": true, + "description": "ISO 3166-2 two-digit country subdivision code for Coinbase representing the purchasing user’s subdivision of residence within their country, e.g. NY. Required if country_code=US." + }, + "sandboxMode": { + "type": "boolean", + "x-nullable": true, + "description": "Optional flag to indicate whether to use the sandbox mode to simulate transactions for the on-ramp provider. Default is false." + } + }, + "required": [ + "onrampProvider", + "walletAddress", + "network", + "cryptoCurrencyCode" + ] + }, + "InitFiatOnRampRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_INIT_FIAT_ON_RAMP"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/InitFiatOnRampIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "InitFiatOnRampResult": { + "type": "object", + "properties": { + "onRampUrl": { + "type": "string", + "description": "Unique URL for a given fiat on-ramp flow." + }, + "onRampTransactionId": { + "type": "string", + "description": "Unique identifier used to retrieve transaction statuses for a given fiat on-ramp flow." + } + }, + "required": ["onRampUrl", "onRampTransactionId"] + }, "InitImportPrivateKeyIntent": { "type": "object", "properties": { @@ -5754,19 +6584,88 @@ }, "emailCustomization": { "$ref": "#/definitions/EmailCustomizationParams", + "x-nullable": true, + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "smsCustomization": { + "$ref": "#/definitions/SmsCustomizationParams", + "x-nullable": true, + "description": "Optional parameters for customizing SMS message. If not provided, the default sms message will be used." + }, + "userIdentifier": { + "type": "string", + "x-nullable": true, + "description": "Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address." + }, + "sendFromEmailAddress": { + "type": "string", + "x-nullable": true, + "description": "Optional custom email address from which to send the OTP email" + }, + "sendFromEmailSenderName": { + "type": "string", + "x-nullable": true, + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "replyToEmailAddress": { + "type": "string", + "x-nullable": true, + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["otpType", "contact"] + }, + "InitOtpAuthIntentV2": { + "type": "object", + "properties": { + "otpType": { + "type": "string", + "description": "Enum to specifiy whether to send OTP via SMS or email" + }, + "contact": { + "type": "string", + "description": "Email or phone number to send the OTP code to" + }, + "otpLength": { + "type": "integer", + "format": "int32", + "x-nullable": true, + "description": "Optional length of the OTP code. Default = 9" + }, + "emailCustomization": { + "$ref": "#/definitions/EmailCustomizationParams", + "x-nullable": true, "description": "Optional parameters for customizing emails. If not provided, the default email will be used." }, "smsCustomization": { "$ref": "#/definitions/SmsCustomizationParams", + "x-nullable": true, "description": "Optional parameters for customizing SMS message. If not provided, the default sms message will be used." }, "userIdentifier": { "type": "string", + "x-nullable": true, "description": "Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address." }, "sendFromEmailAddress": { "type": "string", + "x-nullable": true, "description": "Optional custom email address from which to send the OTP email" + }, + "alphanumeric": { + "type": "boolean", + "x-nullable": true, + "description": "Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true" + }, + "sendFromEmailSenderName": { + "type": "string", + "x-nullable": true, + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "replyToEmailAddress": { + "type": "string", + "x-nullable": true, + "description": "Optional custom email address to use as reply-to" } }, "required": ["otpType", "contact"] @@ -5776,7 +6675,7 @@ "properties": { "type": { "type": "string", - "enum": ["ACTIVITY_TYPE_INIT_OTP_AUTH"] + "enum": ["ACTIVITY_TYPE_INIT_OTP_AUTH_V2"] }, "timestampMs": { "type": "string", @@ -5787,7 +6686,7 @@ "description": "Unique identifier for a given Organization." }, "parameters": { - "$ref": "#/definitions/InitOtpAuthIntent" + "$ref": "#/definitions/InitOtpAuthIntentV2" } }, "required": ["type", "timestampMs", "organizationId", "parameters"] @@ -5802,6 +6701,107 @@ }, "required": ["otpId"] }, + "InitOtpAuthResultV2": { + "type": "object", + "properties": { + "otpId": { + "type": "string", + "description": "Unique identifier for an OTP authentication" + } + }, + "required": ["otpId"] + }, + "InitOtpIntent": { + "type": "object", + "properties": { + "otpType": { + "type": "string", + "description": "Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL" + }, + "contact": { + "type": "string", + "description": "Email or phone number to send the OTP code to" + }, + "otpLength": { + "type": "integer", + "format": "int32", + "x-nullable": true, + "description": "Optional length of the OTP code. Default = 9" + }, + "emailCustomization": { + "$ref": "#/definitions/EmailCustomizationParams", + "x-nullable": true, + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "smsCustomization": { + "$ref": "#/definitions/SmsCustomizationParams", + "x-nullable": true, + "description": "Optional parameters for customizing SMS message. If not provided, the default sms message will be used." + }, + "userIdentifier": { + "type": "string", + "x-nullable": true, + "description": "Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address." + }, + "sendFromEmailAddress": { + "type": "string", + "x-nullable": true, + "description": "Optional custom email address from which to send the OTP email" + }, + "alphanumeric": { + "type": "boolean", + "x-nullable": true, + "description": "Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true" + }, + "sendFromEmailSenderName": { + "type": "string", + "x-nullable": true, + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "expirationSeconds": { + "type": "string", + "x-nullable": true, + "description": "Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes)" + }, + "replyToEmailAddress": { + "type": "string", + "x-nullable": true, + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["otpType", "contact"] + }, + "InitOtpRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_INIT_OTP"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/InitOtpIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "InitOtpResult": { + "type": "object", + "properties": { + "otpId": { + "type": "string", + "description": "Unique identifier for an OTP authentication" + } + }, + "required": ["otpId"] + }, "InitUserEmailRecoveryIntent": { "type": "object", "properties": { @@ -5815,10 +6815,12 @@ }, "expirationSeconds": { "type": "string", - "description": "Expiration window (in seconds) indicating how long the recovery credential is valid. If not provided, a default of 15 minutes will be used." + "x-nullable": true, + "description": "Expiration window (in seconds) indicating how long the recovery credential is valid for. If not provided, a default of 15 minutes will be used." }, "emailCustomization": { "$ref": "#/definitions/EmailCustomizationParams", + "x-nullable": true, "description": "Optional parameters for customizing emails. If not provided, the default email will be used." } }, @@ -6097,6 +7099,48 @@ }, "updateWalletIntent": { "$ref": "#/definitions/UpdateWalletIntent" + }, + "updatePolicyIntentV2": { + "$ref": "#/definitions/UpdatePolicyIntentV2" + }, + "createUsersIntentV3": { + "$ref": "#/definitions/CreateUsersIntentV3" + }, + "initOtpAuthIntentV2": { + "$ref": "#/definitions/InitOtpAuthIntentV2" + }, + "initOtpIntent": { + "$ref": "#/definitions/InitOtpIntent" + }, + "verifyOtpIntent": { + "$ref": "#/definitions/VerifyOtpIntent" + }, + "otpLoginIntent": { + "$ref": "#/definitions/OtpLoginIntent" + }, + "stampLoginIntent": { + "$ref": "#/definitions/StampLoginIntent" + }, + "oauthLoginIntent": { + "$ref": "#/definitions/OauthLoginIntent" + }, + "updateUserNameIntent": { + "$ref": "#/definitions/UpdateUserNameIntent" + }, + "updateUserEmailIntent": { + "$ref": "#/definitions/UpdateUserEmailIntent" + }, + "updateUserPhoneNumberIntent": { + "$ref": "#/definitions/UpdateUserPhoneNumberIntent" + }, + "initFiatOnRampIntent": { + "$ref": "#/definitions/InitFiatOnRampIntent" + }, + "createSmartContractInterfaceIntent": { + "$ref": "#/definitions/CreateSmartContractInterfaceIntent" + }, + "deleteSmartContractInterfaceIntent": { + "$ref": "#/definitions/DeleteSmartContractInterfaceIntent" } } }, @@ -6116,7 +7160,7 @@ "items": { "type": "string" }, - "description": "A list of tags assigned to the Invitation recipient." + "description": "A list of tags assigned to the Invitation recipient. This field, if not needed, should be an empty array in your request body." }, "accessType": { "$ref": "#/definitions/AccessType", @@ -6140,7 +7184,7 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." } }, "required": ["organizationId"] @@ -6154,7 +7198,7 @@ "type": "object", "$ref": "#/definitions/v1.Tag" }, - "description": "A list of Private Key Tags" + "description": "A list of private key tags." } }, "required": ["privateKeyTags"] @@ -6164,7 +7208,7 @@ "properties": { "organizationId": { "type": "string", - "description": "Unique identifier for a given Organization." + "description": "Unique identifier for a given organization." } }, "required": ["organizationId"] @@ -6178,7 +7222,7 @@ "type": "object", "$ref": "#/definitions/v1.Tag" }, - "description": "A list of User Tags" + "description": "A list of user tags." } }, "required": ["userTags"] @@ -6210,15 +7254,77 @@ }, "apiKeyName": { "type": "string", + "x-nullable": true, "description": "Optional human-readable name for an API Key. If none provided, default to Oauth - \u003cTimestamp\u003e" }, "expirationSeconds": { "type": "string", - "description": "Expiration window (in seconds) indicating how long the API key is valid. If not provided, a default of 15 minutes will be used." + "x-nullable": true, + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." + }, + "invalidateExisting": { + "type": "boolean", + "x-nullable": true, + "description": "Invalidate all other previously generated Oauth API keys" } }, "required": ["oidcToken", "targetPublicKey"] }, + "OauthLoginIntent": { + "type": "object", + "properties": { + "oidcToken": { + "type": "string", + "description": "Base64 encoded OIDC token" + }, + "publicKey": { + "type": "string", + "description": "Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the oidc token associated with this request" + }, + "expirationSeconds": { + "type": "string", + "x-nullable": true, + "description": "Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used." + }, + "invalidateExisting": { + "type": "boolean", + "x-nullable": true, + "description": "Invalidate all other previously generated Login API keys" + } + }, + "required": ["oidcToken", "publicKey"] + }, + "OauthLoginRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_OAUTH_LOGIN"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/OauthLoginIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "OauthLoginResult": { + "type": "object", + "properties": { + "session": { + "type": "string", + "description": "Signed JWT containing an expiry, public key, session type, user id, and organization id" + } + }, + "required": ["session"] + }, "OauthProvider": { "type": "object", "properties": { @@ -6337,7 +7443,7 @@ }, "otpCode": { "type": "string", - "description": "6 digit OTP code sent out to a user's contact (email or SMS)" + "description": "OTP sent out to a user's contact (email or SMS)" }, "targetPublicKey": { "type": "string", @@ -6345,18 +7451,21 @@ }, "apiKeyName": { "type": "string", + "x-nullable": true, "description": "Optional human-readable name for an API Key. If none provided, default to OTP Auth - \u003cTimestamp\u003e" }, "expirationSeconds": { "type": "string", - "description": "Expiration window (in seconds) indicating how long the API key is valid. If not provided, a default of 15 minutes will be used." + "x-nullable": true, + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." }, "invalidateExisting": { "type": "boolean", + "x-nullable": true, "description": "Invalidate all other previously generated OTP Auth API keys" } }, - "required": ["otpId", "otpCode"] + "required": ["otpId", "otpCode", "targetPublicKey"] }, "OtpAuthRequest": { "type": "object", @@ -6397,6 +7506,72 @@ }, "required": ["userId"] }, + "OtpLoginIntent": { + "type": "object", + "properties": { + "verificationToken": { + "type": "string", + "description": "Signed JWT containing a unique id, expiry, verification type, contact" + }, + "publicKey": { + "type": "string", + "description": "Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the verification token" + }, + "expirationSeconds": { + "type": "string", + "x-nullable": true, + "description": "Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used." + }, + "invalidateExisting": { + "type": "boolean", + "x-nullable": true, + "description": "Invalidate all other previously generated Login API keys" + } + }, + "required": ["verificationToken", "publicKey"] + }, + "OtpLoginRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_OTP_LOGIN"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/OtpLoginIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "OtpLoginResult": { + "type": "object", + "properties": { + "session": { + "type": "string", + "description": "Signed JWT containing an expiry, public key, session type, user id, and organization id" + } + }, + "required": ["session"] + }, + "Outcome": { + "type": "string", + "enum": [ + "OUTCOME_ALLOW", + "OUTCOME_DENY_EXPLICIT", + "OUTCOME_DENY_IMPLICIT", + "OUTCOME_REQUIRES_CONSENSUS", + "OUTCOME_REJECTED", + "OUTCOME_ERROR" + ] + }, "Pagination": { "type": "object", "properties": { @@ -6420,7 +7595,11 @@ }, "PayloadEncoding": { "type": "string", - "enum": ["PAYLOAD_ENCODING_HEXADECIMAL", "PAYLOAD_ENCODING_TEXT_UTF8"] + "enum": [ + "PAYLOAD_ENCODING_HEXADECIMAL", + "PAYLOAD_ENCODING_TEXT_UTF8", + "PAYLOAD_ENCODING_EIP712" + ] }, "Policy": { "type": "object", @@ -6449,10 +7628,12 @@ }, "consensus": { "type": "string", + "x-nullable": true, "description": "A consensus expression that evalutes to true or false." }, "condition": { "type": "string", + "x-nullable": true, "description": "A condition expression that evalutes to true or false." } }, @@ -6545,7 +7726,7 @@ "items": { "type": "string" }, - "description": "A list of Private Key Tag IDs." + "description": "A list of Private Key Tag IDs. This field, if not needed, should be an empty array in your request body." }, "addressFormats": { "type": "array", @@ -6928,6 +8109,45 @@ }, "updateWalletResult": { "$ref": "#/definitions/UpdateWalletResult" + }, + "updatePolicyResultV2": { + "$ref": "#/definitions/UpdatePolicyResultV2" + }, + "initOtpAuthResultV2": { + "$ref": "#/definitions/InitOtpAuthResultV2" + }, + "initOtpResult": { + "$ref": "#/definitions/InitOtpResult" + }, + "verifyOtpResult": { + "$ref": "#/definitions/VerifyOtpResult" + }, + "otpLoginResult": { + "$ref": "#/definitions/OtpLoginResult" + }, + "stampLoginResult": { + "$ref": "#/definitions/StampLoginResult" + }, + "oauthLoginResult": { + "$ref": "#/definitions/OauthLoginResult" + }, + "updateUserNameResult": { + "$ref": "#/definitions/UpdateUserNameResult" + }, + "updateUserEmailResult": { + "$ref": "#/definitions/UpdateUserEmailResult" + }, + "updateUserPhoneNumberResult": { + "$ref": "#/definitions/UpdateUserPhoneNumberResult" + }, + "initFiatOnRampResult": { + "$ref": "#/definitions/InitFiatOnRampResult" + }, + "createSmartContractInterfaceResult": { + "$ref": "#/definitions/CreateSmartContractInterfaceResult" + }, + "deleteSmartContractInterfaceResult": { + "$ref": "#/definitions/DeleteSmartContractInterfaceResult" } } }, @@ -6940,6 +8160,7 @@ }, "userEmail": { "type": "string", + "x-nullable": true, "description": "The user's email address." }, "apiKeys": { @@ -6948,7 +8169,7 @@ "type": "object", "$ref": "#/definitions/ApiKeyParams" }, - "description": "A list of API Key parameters." + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." }, "authenticators": { "type": "array", @@ -6956,7 +8177,7 @@ "type": "object", "$ref": "#/definitions/AuthenticatorParamsV2" }, - "description": "A list of Authenticator parameters." + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." } }, "required": ["userName", "apiKeys", "authenticators"] @@ -6970,6 +8191,7 @@ }, "userEmail": { "type": "string", + "x-nullable": true, "description": "The user's email address." }, "apiKeys": { @@ -6978,7 +8200,7 @@ "type": "object", "$ref": "#/definitions/ApiKeyParams" }, - "description": "A list of API Key parameters." + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." }, "authenticators": { "type": "array", @@ -6986,7 +8208,7 @@ "type": "object", "$ref": "#/definitions/AuthenticatorParamsV2" }, - "description": "A list of Authenticator parameters." + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." }, "oauthProviders": { "type": "array", @@ -6994,7 +8216,7 @@ "type": "object", "$ref": "#/definitions/OauthProviderParams" }, - "description": "A list of Oauth providers." + "description": "A list of Oauth providers. This field, if not needed, should be an empty array in your request body." } }, "required": ["userName", "apiKeys", "authenticators", "oauthProviders"] @@ -7008,6 +8230,7 @@ }, "userEmail": { "type": "string", + "x-nullable": true, "description": "The user's email address." }, "apiKeys": { @@ -7016,7 +8239,7 @@ "type": "object", "$ref": "#/definitions/ApiKeyParamsV2" }, - "description": "A list of API Key parameters." + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." }, "authenticators": { "type": "array", @@ -7024,7 +8247,7 @@ "type": "object", "$ref": "#/definitions/AuthenticatorParamsV2" }, - "description": "A list of Authenticator parameters." + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." }, "oauthProviders": { "type": "array", @@ -7032,7 +8255,7 @@ "type": "object", "$ref": "#/definitions/OauthProviderParams" }, - "description": "A list of Oauth providers." + "description": "A list of Oauth providers. This field, if not needed, should be an empty array in your request body." } }, "required": ["userName", "apiKeys", "authenticators", "oauthProviders"] @@ -7046,10 +8269,12 @@ }, "userEmail": { "type": "string", + "x-nullable": true, "description": "The user's email address." }, "userPhoneNumber": { "type": "string", + "x-nullable": true, "description": "The user's phone number in E.164 format e.g. +13214567890" }, "apiKeys": { @@ -7058,7 +8283,7 @@ "type": "object", "$ref": "#/definitions/ApiKeyParamsV2" }, - "description": "A list of API Key parameters." + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." }, "authenticators": { "type": "array", @@ -7066,7 +8291,7 @@ "type": "object", "$ref": "#/definitions/AuthenticatorParamsV2" }, - "description": "A list of Authenticator parameters." + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." }, "oauthProviders": { "type": "array", @@ -7074,7 +8299,7 @@ "type": "object", "$ref": "#/definitions/OauthProviderParams" }, - "description": "A list of Oauth providers." + "description": "A list of Oauth providers. This field, if not needed, should be an empty array in your request body." } }, "required": ["userName", "apiKeys", "authenticators", "oauthProviders"] @@ -7119,6 +8344,7 @@ }, "value": { "type": "string", + "x-nullable": true, "description": "Optional value for the feature. Will override existing values if feature is already set." } }, @@ -7441,25 +8667,87 @@ "type": "object", "properties": { "appid": { - "type": "boolean" + "type": "boolean", + "x-nullable": true }, "appidExclude": { - "type": "boolean" + "type": "boolean", + "x-nullable": true }, "credProps": { - "$ref": "#/definitions/CredPropsAuthenticationExtensionsClientOutputs" + "$ref": "#/definitions/CredPropsAuthenticationExtensionsClientOutputs", + "x-nullable": true } } }, + "SmartContractInterfaceType": { + "type": "string", + "enum": [ + "SMART_CONTRACT_INTERFACE_TYPE_ETHEREUM", + "SMART_CONTRACT_INTERFACE_TYPE_SOLANA" + ] + }, "SmsCustomizationParams": { "type": "object", "properties": { "template": { "type": "string", + "x-nullable": true, "description": "Template containing references to .OtpCode i.e Your OTP is {{.OtpCode}}" } } }, + "StampLoginIntent": { + "type": "object", + "properties": { + "publicKey": { + "type": "string", + "description": "Client-side public key generated by the user, which will be conditionally added to org data based on the passkey stamp associated with this request" + }, + "expirationSeconds": { + "type": "string", + "x-nullable": true, + "description": "Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used." + }, + "invalidateExisting": { + "type": "boolean", + "x-nullable": true, + "description": "Invalidate all other previously generated Login API keys" + } + }, + "required": ["publicKey"] + }, + "StampLoginRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_STAMP_LOGIN"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/StampLoginIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "StampLoginResult": { + "type": "object", + "properties": { + "session": { + "type": "string", + "description": "Signed JWT containing an expiry, public key, session type, user id, and organization id" + } + }, + "required": ["session"] + }, "Status": { "type": "object", "properties": { @@ -7485,7 +8773,11 @@ }, "TransactionType": { "type": "string", - "enum": ["TRANSACTION_TYPE_ETHEREUM", "TRANSACTION_TYPE_SOLANA"] + "enum": [ + "TRANSACTION_TYPE_ETHEREUM", + "TRANSACTION_TYPE_SOLANA", + "TRANSACTION_TYPE_TRON" + ] }, "UpdateAllowedOriginsIntent": { "type": "object", @@ -7512,22 +8804,62 @@ }, "policyName": { "type": "string", + "x-nullable": true, + "description": "Human-readable name for a Policy." + }, + "policyEffect": { + "$ref": "#/definitions/Effect", + "x-nullable": true, + "description": "The instruction to DENY or ALLOW an activity (optional)." + }, + "policyCondition": { + "type": "string", + "x-nullable": true, + "description": "The condition expression that triggers the Effect (optional)." + }, + "policyConsensus": { + "type": "string", + "x-nullable": true, + "description": "The consensus expression that triggers the Effect (optional)." + }, + "policyNotes": { + "type": "string", + "x-nullable": true, + "description": "Accompanying notes for a Policy (optional)." + } + }, + "required": ["policyId"] + }, + "UpdatePolicyIntentV2": { + "type": "object", + "properties": { + "policyId": { + "type": "string", + "description": "Unique identifier for a given Policy." + }, + "policyName": { + "type": "string", + "x-nullable": true, "description": "Human-readable name for a Policy." }, "policyEffect": { "$ref": "#/definitions/Effect", + "x-nullable": true, "description": "The instruction to DENY or ALLOW an activity (optional)." }, "policyCondition": { "type": "string", + "x-nullable": true, "description": "The condition expression that triggers the Effect (optional)." }, "policyConsensus": { "type": "string", + "x-nullable": true, "description": "The consensus expression that triggers the Effect (optional)." }, "policyNotes": { "type": "string", + "x-nullable": true, "description": "Accompanying notes for a Policy (optional)." } }, @@ -7538,7 +8870,7 @@ "properties": { "type": { "type": "string", - "enum": ["ACTIVITY_TYPE_UPDATE_POLICY"] + "enum": ["ACTIVITY_TYPE_UPDATE_POLICY_V2"] }, "timestampMs": { "type": "string", @@ -7549,7 +8881,7 @@ "description": "Unique identifier for a given Organization." }, "parameters": { - "$ref": "#/definitions/UpdatePolicyIntent" + "$ref": "#/definitions/UpdatePolicyIntentV2" } }, "required": ["type", "timestampMs", "organizationId", "parameters"] @@ -7564,6 +8896,16 @@ }, "required": ["policyId"] }, + "UpdatePolicyResultV2": { + "type": "object", + "properties": { + "policyId": { + "type": "string", + "description": "Unique identifier for a given Policy." + } + }, + "required": ["policyId"] + }, "UpdatePrivateKeyTagIntent": { "type": "object", "properties": { @@ -7573,6 +8915,7 @@ }, "newPrivateKeyTagName": { "type": "string", + "x-nullable": true, "description": "The new, human-readable name for the tag with the given ID." }, "addPrivateKeyIds": { @@ -7665,6 +9008,56 @@ "UpdateRootQuorumResult": { "type": "object" }, + "UpdateUserEmailIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address. Setting this to an empty string will remove the user's email." + }, + "verificationToken": { + "type": "string", + "x-nullable": true, + "description": "Signed JWT containing a unique id, expiry, verification type, contact" + } + }, + "required": ["userId", "userEmail"] + }, + "UpdateUserEmailRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_USER_EMAIL"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/UpdateUserEmailIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "UpdateUserEmailResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier of the User whose email was updated." + } + }, + "required": ["userId"] + }, "UpdateUserIntent": { "type": "object", "properties": { @@ -7674,10 +9067,12 @@ }, "userName": { "type": "string", + "x-nullable": true, "description": "Human-readable name for a User." }, "userEmail": { "type": "string", + "x-nullable": true, "description": "The user's email address." }, "userTagIds": { @@ -7685,15 +9080,111 @@ "items": { "type": "string" }, - "description": "An updated list of User Tags to apply to this User." + "description": "An updated list of User Tags to apply to this User. This field, if not needed, should be an empty array in your request body." }, "userPhoneNumber": { "type": "string", + "x-nullable": true, "description": "The user's phone number in E.164 format e.g. +13214567890" } }, "required": ["userId"] }, + "UpdateUserNameIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "userName": { + "type": "string", + "description": "Human-readable name for a User." + } + }, + "required": ["userId", "userName"] + }, + "UpdateUserNameRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_USER_NAME"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/UpdateUserNameIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "UpdateUserNameResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier of the User whose name was updated." + } + }, + "required": ["userId"] + }, + "UpdateUserPhoneNumberIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "userPhoneNumber": { + "type": "string", + "description": "The user's phone number in E.164 format e.g. +13214567890. Setting this to an empty string will remove the user's phone number." + }, + "verificationToken": { + "type": "string", + "x-nullable": true, + "description": "Signed JWT containing a unique id, expiry, verification type, contact" + } + }, + "required": ["userId", "userPhoneNumber"] + }, + "UpdateUserPhoneNumberRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/UpdateUserPhoneNumberIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "UpdateUserPhoneNumberResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier of the User whose phone number was updated." + } + }, + "required": ["userId"] + }, "UpdateUserRequest": { "type": "object", "properties": { @@ -7734,6 +9225,7 @@ }, "newUserTagName": { "type": "string", + "x-nullable": true, "description": "The new, human-readable name for the tag with the given ID." }, "addUserIds": { @@ -7842,10 +9334,12 @@ }, "userEmail": { "type": "string", + "x-nullable": true, "description": "The user's email address." }, "userPhoneNumber": { "type": "string", + "x-nullable": true, "description": "The user's phone number in E.164 format e.g. +13214567890" }, "authenticators": { @@ -7862,7 +9356,7 @@ "type": "object", "$ref": "#/definitions/ApiKey" }, - "description": "A list of API Key parameters." + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." }, "userTags": { "type": "array", @@ -7906,6 +9400,7 @@ }, "userEmail": { "type": "string", + "x-nullable": true, "description": "The user's email address." }, "accessType": { @@ -7918,7 +9413,7 @@ "type": "object", "$ref": "#/definitions/ApiKeyParams" }, - "description": "A list of API Key parameters." + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." }, "authenticators": { "type": "array", @@ -7926,14 +9421,14 @@ "type": "object", "$ref": "#/definitions/AuthenticatorParams" }, - "description": "A list of Authenticator parameters." + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." }, "userTags": { "type": "array", "items": { "type": "string" }, - "description": "A list of User Tag IDs." + "description": "A list of User Tag IDs. This field, if not needed, should be an empty array in your request body." } }, "required": [ @@ -7953,6 +9448,7 @@ }, "userEmail": { "type": "string", + "x-nullable": true, "description": "The user's email address." }, "apiKeys": { @@ -7961,7 +9457,7 @@ "type": "object", "$ref": "#/definitions/ApiKeyParams" }, - "description": "A list of API Key parameters." + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." }, "authenticators": { "type": "array", @@ -7969,18 +9465,125 @@ "type": "object", "$ref": "#/definitions/AuthenticatorParamsV2" }, - "description": "A list of Authenticator parameters." + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." }, "userTags": { "type": "array", "items": { "type": "string" }, - "description": "A list of User Tag IDs." + "description": "A list of User Tag IDs. This field, if not needed, should be an empty array in your request body." } }, "required": ["userName", "apiKeys", "authenticators", "userTags"] }, + "UserParamsV3": { + "type": "object", + "properties": { + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "x-nullable": true, + "description": "The user's email address." + }, + "userPhoneNumber": { + "type": "string", + "x-nullable": true, + "description": "The user's phone number in E.164 format e.g. +13214567890" + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/ApiKeyParamsV2" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/AuthenticatorParamsV2" + }, + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + }, + "oauthProviders": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/OauthProviderParams" + }, + "description": "A list of Oauth providers. This field, if not needed, should be an empty array in your request body." + }, + "userTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User Tag IDs. This field, if not needed, should be an empty array in your request body." + } + }, + "required": [ + "userName", + "apiKeys", + "authenticators", + "oauthProviders", + "userTags" + ] + }, + "VerifyOtpIntent": { + "type": "object", + "properties": { + "otpId": { + "type": "string", + "description": "ID representing the result of an init OTP activity." + }, + "otpCode": { + "type": "string", + "description": "OTP sent out to a user's contact (email or SMS)" + }, + "expirationSeconds": { + "type": "string", + "x-nullable": true, + "description": "Expiration window (in seconds) indicating how long the verification token is valid for. If not provided, a default of 1 hour will be used. Maximum value is 86400 seconds (24 hours)" + } + }, + "required": ["otpId", "otpCode"] + }, + "VerifyOtpRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_VERIFY_OTP"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/VerifyOtpIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "VerifyOtpResult": { + "type": "object", + "properties": { + "verificationToken": { + "type": "string", + "description": "Signed JWT containing a unique id, expiry, verification type, contact. Verification status of a user is updated when the token is consumed (in OTP_LOGIN requests)" + } + }, + "required": ["verificationToken"] + }, "Vote": { "type": "object", "properties": { @@ -8101,7 +9704,7 @@ }, "addressFormat": { "$ref": "#/definitions/AddressFormat", - "description": "Address format used to generate the Acccount." + "description": "Address format used to generate the Account." }, "address": { "type": "string", @@ -8112,6 +9715,11 @@ }, "updatedAt": { "$ref": "#/definitions/external.data.v1.Timestamp" + }, + "publicKey": { + "type": "string", + "x-nullable": true, + "description": "The public component of this wallet account's underlying cryptographic key pair." } }, "required": [ @@ -8162,11 +9770,12 @@ "type": "object", "$ref": "#/definitions/WalletAccountParams" }, - "description": "A list of wallet Accounts." + "description": "A list of wallet Accounts. This field, if not needed, should be an empty array in your request body." }, "mnemonicLength": { "type": "integer", "format": "int32", + "x-nullable": true, "description": "Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24." } }, @@ -8199,6 +9808,46 @@ } } }, + "activity.v1.PolicyEvaluation": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for a given policy evaluation." + }, + "activityId": { + "type": "string", + "description": "Unique identifier for a given Activity." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for the Organization the Activity belongs to." + }, + "voteId": { + "type": "string", + "description": "Unique identifier for the Vote associated with this policy evaluation." + }, + "policyEvaluations": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/ump.v1.PolicyEvaluation" + }, + "description": "Detailed evaluation result for each Policy that was run." + }, + "createdAt": { + "$ref": "#/definitions/external.data.v1.Timestamp" + } + }, + "required": [ + "id", + "activityId", + "organizationId", + "voteId", + "policyEvaluations", + "createdAt" + ] + }, "data.v1.Address": { "type": "object", "properties": { @@ -8210,6 +9859,56 @@ } } }, + "data.v1.SmartContractInterface": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "The Organization the Smart Contract Interface belongs to." + }, + "smartContractInterfaceId": { + "type": "string", + "description": "Unique identifier for a given Smart Contract Interface (ABI or IDL)." + }, + "smartContractAddress": { + "type": "string", + "description": "The address corresponding to the Smart Contract or Program." + }, + "smartContractInterface": { + "type": "string", + "description": "The JSON corresponding to the Smart Contract Interface (ABI or IDL)." + }, + "type": { + "type": "string", + "description": "The type corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA)." + }, + "label": { + "type": "string", + "description": "The label corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA)." + }, + "notes": { + "type": "string", + "description": "The notes corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA)." + }, + "createdAt": { + "$ref": "#/definitions/external.data.v1.Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/external.data.v1.Timestamp" + } + }, + "required": [ + "organizationId", + "smartContractInterfaceId", + "smartContractAddress", + "smartContractInterface", + "type", + "label", + "notes", + "createdAt", + "updatedAt" + ] + }, "external.data.v1.Credential": { "type": "object", "properties": { @@ -8253,6 +9952,17 @@ }, "required": ["seconds", "nanos"] }, + "ump.v1.PolicyEvaluation": { + "type": "object", + "properties": { + "policyId": { + "type": "string" + }, + "outcome": { + "$ref": "#/definitions/Outcome" + } + } + }, "v1.Tag": { "type": "object", "properties": {