From 0a8a3ecebaadc56d47d63630a1a386de5f2bbd2d Mon Sep 17 00:00:00 2001 From: Zane Kharitonov Date: Thu, 25 Sep 2025 09:40:07 -0400 Subject: [PATCH] v0.0.15 --- turnkey_client/.swagger-codegen/VERSION | 2 +- turnkey_client/lib/turnkey_client.rb | 40 +- .../lib/turnkey_client/api/app_proof_api.rb | 77 ++ .../lib/turnkey_client/api/boot_proof_api.rb | 135 ++ .../lib/turnkey_client/api/default_api.rb | 77 ++ .../lib/turnkey_client/api/user_auth_api.rb | 290 ++++ .../lib/turnkey_client/models/activity.rb | 14 +- .../turnkey_client/models/activity_type.rb | 7 + .../lib/turnkey_client/models/app_proof.rb | 255 ++++ .../lib/turnkey_client/models/boot_proof.rb | 315 +++++ .../models/boot_proof_response.rb | 210 +++ .../models/common_v1_policy_evaluation.rb | 214 +++ .../models/create_oauth2_credential_intent.rb | 240 ++++ .../create_oauth2_credential_request.rb | 288 ++++ .../models/create_oauth2_credential_result.rb | 211 +++ .../create_sub_organization_intent_v7.rb | 21 +- .../models/delete_oauth2_credential_intent.rb | 211 +++ .../delete_oauth2_credential_request.rb | 288 ++++ .../models/delete_oauth2_credential_result.rb | 211 +++ .../models/disable_auth_proxy_intent.rb | 196 +++ .../models/disable_auth_proxy_result.rb | 196 +++ .../models/enable_auth_proxy_intent.rb | 196 +++ .../models/enable_auth_proxy_result.rb | 211 +++ .../lib/turnkey_client/models/feature_name.rb | 1 + .../models/get_app_proofs_request.rb | 226 ++++ .../models/get_app_proofs_response.rb | 212 +++ .../models/get_boot_proof_request.rb | 226 ++++ .../models/get_latest_boot_proof_request.rb | 226 ++++ .../models/get_oauth2_credential_request.rb | 226 ++++ .../models/get_oauth2_credential_response.rb | 210 +++ .../models/get_wallet_accounts_request.rb | 13 +- .../models/init_fiat_on_ramp_intent.rb | 21 +- .../models/init_fiat_on_ramp_result.rb | 18 +- .../lib/turnkey_client/models/intent.rb | 71 +- .../models/list_oauth2_credentials_request.rb | 211 +++ .../list_oauth2_credentials_response.rb | 212 +++ .../models/oauth2_authenticate_intent.rb | 278 ++++ .../models/oauth2_authenticate_request.rb | 288 ++++ .../models/oauth2_authenticate_result.rb | 211 +++ .../models/oauth2_credential.rb | 298 ++++ .../turnkey_client/models/oauth2_provider.rb | 27 + .../turnkey_client/models/otp_login_intent.rb | 21 +- .../turnkey_client/models/payload_encoding.rb | 1 + .../lib/turnkey_client/models/result.rb | 71 +- .../turnkey_client/models/signature_scheme.rb | 26 + .../models/smart_contract_interface.rb | 329 +++++ .../models/update_auth_proxy_config_intent.rb | 346 +++++ .../models/update_auth_proxy_config_result.rb | 206 +++ .../models/update_oauth2_credential_intent.rb | 255 ++++ .../update_oauth2_credential_request.rb | 288 ++++ .../models/update_oauth2_credential_result.rb | 211 +++ .../models/verify_otp_intent.rb | 21 +- .../turnkey_client/models/wallet_account.rb | 19 +- .../models/wallet_kit_settings_params.rb | 230 ++++ turnkey_client/lib/turnkey_client/version.rb | 2 +- turnkey_client_inputs/config.json | 2 +- turnkey_client_inputs/public_api.swagger.json | 1205 +++++++++++++++-- 57 files changed, 9919 insertions(+), 194 deletions(-) create mode 100644 turnkey_client/lib/turnkey_client/api/app_proof_api.rb create mode 100644 turnkey_client/lib/turnkey_client/api/boot_proof_api.rb create mode 100644 turnkey_client/lib/turnkey_client/api/default_api.rb create mode 100644 turnkey_client/lib/turnkey_client/models/app_proof.rb create mode 100644 turnkey_client/lib/turnkey_client/models/boot_proof.rb create mode 100644 turnkey_client/lib/turnkey_client/models/boot_proof_response.rb create mode 100644 turnkey_client/lib/turnkey_client/models/common_v1_policy_evaluation.rb create mode 100644 turnkey_client/lib/turnkey_client/models/create_oauth2_credential_intent.rb create mode 100644 turnkey_client/lib/turnkey_client/models/create_oauth2_credential_request.rb create mode 100644 turnkey_client/lib/turnkey_client/models/create_oauth2_credential_result.rb create mode 100644 turnkey_client/lib/turnkey_client/models/delete_oauth2_credential_intent.rb create mode 100644 turnkey_client/lib/turnkey_client/models/delete_oauth2_credential_request.rb create mode 100644 turnkey_client/lib/turnkey_client/models/delete_oauth2_credential_result.rb create mode 100644 turnkey_client/lib/turnkey_client/models/disable_auth_proxy_intent.rb create mode 100644 turnkey_client/lib/turnkey_client/models/disable_auth_proxy_result.rb create mode 100644 turnkey_client/lib/turnkey_client/models/enable_auth_proxy_intent.rb create mode 100644 turnkey_client/lib/turnkey_client/models/enable_auth_proxy_result.rb create mode 100644 turnkey_client/lib/turnkey_client/models/get_app_proofs_request.rb create mode 100644 turnkey_client/lib/turnkey_client/models/get_app_proofs_response.rb create mode 100644 turnkey_client/lib/turnkey_client/models/get_boot_proof_request.rb create mode 100644 turnkey_client/lib/turnkey_client/models/get_latest_boot_proof_request.rb create mode 100644 turnkey_client/lib/turnkey_client/models/get_oauth2_credential_request.rb create mode 100644 turnkey_client/lib/turnkey_client/models/get_oauth2_credential_response.rb create mode 100644 turnkey_client/lib/turnkey_client/models/list_oauth2_credentials_request.rb create mode 100644 turnkey_client/lib/turnkey_client/models/list_oauth2_credentials_response.rb create mode 100644 turnkey_client/lib/turnkey_client/models/oauth2_authenticate_intent.rb create mode 100644 turnkey_client/lib/turnkey_client/models/oauth2_authenticate_request.rb create mode 100644 turnkey_client/lib/turnkey_client/models/oauth2_authenticate_result.rb create mode 100644 turnkey_client/lib/turnkey_client/models/oauth2_credential.rb create mode 100644 turnkey_client/lib/turnkey_client/models/oauth2_provider.rb create mode 100644 turnkey_client/lib/turnkey_client/models/signature_scheme.rb create mode 100644 turnkey_client/lib/turnkey_client/models/smart_contract_interface.rb create mode 100644 turnkey_client/lib/turnkey_client/models/update_auth_proxy_config_intent.rb create mode 100644 turnkey_client/lib/turnkey_client/models/update_auth_proxy_config_result.rb create mode 100644 turnkey_client/lib/turnkey_client/models/update_oauth2_credential_intent.rb create mode 100644 turnkey_client/lib/turnkey_client/models/update_oauth2_credential_request.rb create mode 100644 turnkey_client/lib/turnkey_client/models/update_oauth2_credential_result.rb create mode 100644 turnkey_client/lib/turnkey_client/models/wallet_kit_settings_params.rb diff --git a/turnkey_client/.swagger-codegen/VERSION b/turnkey_client/.swagger-codegen/VERSION index 8515c05..9ad03a7 100644 --- a/turnkey_client/.swagger-codegen/VERSION +++ b/turnkey_client/.swagger-codegen/VERSION @@ -1 +1 @@ -3.0.64 \ No newline at end of file +3.0.73 \ No newline at end of file diff --git a/turnkey_client/lib/turnkey_client.rb b/turnkey_client/lib/turnkey_client.rb index c51aa97..83c4a8d 100644 --- a/turnkey_client/lib/turnkey_client.rb +++ b/turnkey_client/lib/turnkey_client.rb @@ -34,6 +34,7 @@ require 'turnkey_client/models/api_key_params' require 'turnkey_client/models/api_key_params_v2' require 'turnkey_client/models/api_only_user_params' +require 'turnkey_client/models/app_proof' require 'turnkey_client/models/approve_activity_intent' require 'turnkey_client/models/approve_activity_request' require 'turnkey_client/models/attestation' @@ -42,6 +43,9 @@ require 'turnkey_client/models/authenticator_params' require 'turnkey_client/models/authenticator_params_v2' require 'turnkey_client/models/authenticator_transport' +require 'turnkey_client/models/boot_proof' +require 'turnkey_client/models/boot_proof_response' +require 'turnkey_client/models/common_v1_policy_evaluation' require 'turnkey_client/models/config' require 'turnkey_client/models/create_api_keys_intent' require 'turnkey_client/models/create_api_keys_intent_v2' @@ -56,6 +60,9 @@ require 'turnkey_client/models/create_invitations_intent' require 'turnkey_client/models/create_invitations_request' require 'turnkey_client/models/create_invitations_result' +require 'turnkey_client/models/create_oauth2_credential_intent' +require 'turnkey_client/models/create_oauth2_credential_request' +require 'turnkey_client/models/create_oauth2_credential_result' require 'turnkey_client/models/create_oauth_providers_intent' require 'turnkey_client/models/create_oauth_providers_request' require 'turnkey_client/models/create_oauth_providers_result' @@ -121,7 +128,6 @@ 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' @@ -131,6 +137,9 @@ require 'turnkey_client/models/delete_invitation_intent' require 'turnkey_client/models/delete_invitation_request' require 'turnkey_client/models/delete_invitation_result' +require 'turnkey_client/models/delete_oauth2_credential_intent' +require 'turnkey_client/models/delete_oauth2_credential_request' +require 'turnkey_client/models/delete_oauth2_credential_result' require 'turnkey_client/models/delete_oauth_providers_intent' require 'turnkey_client/models/delete_oauth_providers_request' require 'turnkey_client/models/delete_oauth_providers_result' @@ -162,6 +171,8 @@ require 'turnkey_client/models/delete_wallets_intent' require 'turnkey_client/models/delete_wallets_request' require 'turnkey_client/models/delete_wallets_result' +require 'turnkey_client/models/disable_auth_proxy_intent' +require 'turnkey_client/models/disable_auth_proxy_result' require 'turnkey_client/models/disable_private_key_intent' require 'turnkey_client/models/disable_private_key_result' require 'turnkey_client/models/effect' @@ -170,6 +181,8 @@ require 'turnkey_client/models/email_auth_request' require 'turnkey_client/models/email_auth_result' require 'turnkey_client/models/email_customization_params' +require 'turnkey_client/models/enable_auth_proxy_intent' +require 'turnkey_client/models/enable_auth_proxy_result' require 'turnkey_client/models/export_private_key_intent' require 'turnkey_client/models/export_private_key_request' require 'turnkey_client/models/export_private_key_result' @@ -196,10 +209,16 @@ require 'turnkey_client/models/get_api_key_response' require 'turnkey_client/models/get_api_keys_request' require 'turnkey_client/models/get_api_keys_response' +require 'turnkey_client/models/get_app_proofs_request' +require 'turnkey_client/models/get_app_proofs_response' require 'turnkey_client/models/get_authenticator_request' require 'turnkey_client/models/get_authenticator_response' require 'turnkey_client/models/get_authenticators_request' require 'turnkey_client/models/get_authenticators_response' +require 'turnkey_client/models/get_boot_proof_request' +require 'turnkey_client/models/get_latest_boot_proof_request' +require 'turnkey_client/models/get_oauth2_credential_request' +require 'turnkey_client/models/get_oauth2_credential_response' require 'turnkey_client/models/get_oauth_providers_request' require 'turnkey_client/models/get_oauth_providers_response' require 'turnkey_client/models/get_organization_configs_request' @@ -265,11 +284,18 @@ require 'turnkey_client/models/init_user_email_recovery_result' require 'turnkey_client/models/intent' require 'turnkey_client/models/invitation_params' +require 'turnkey_client/models/list_oauth2_credentials_request' +require 'turnkey_client/models/list_oauth2_credentials_response' require 'turnkey_client/models/list_private_key_tags_request' require 'turnkey_client/models/list_private_key_tags_response' require 'turnkey_client/models/list_user_tags_request' require 'turnkey_client/models/list_user_tags_response' require 'turnkey_client/models/mnemonic_language' +require 'turnkey_client/models/oauth2_authenticate_intent' +require 'turnkey_client/models/oauth2_authenticate_request' +require 'turnkey_client/models/oauth2_authenticate_result' +require 'turnkey_client/models/oauth2_credential' +require 'turnkey_client/models/oauth2_provider' require 'turnkey_client/models/oauth_intent' require 'turnkey_client/models/oauth_login_intent' require 'turnkey_client/models/oauth_login_request' @@ -326,7 +352,9 @@ require 'turnkey_client/models/sign_transaction_intent_v2' require 'turnkey_client/models/sign_transaction_request' require 'turnkey_client/models/sign_transaction_result' +require 'turnkey_client/models/signature_scheme' require 'turnkey_client/models/simple_client_extension_results' +require 'turnkey_client/models/smart_contract_interface' require 'turnkey_client/models/smart_contract_interface_type' require 'turnkey_client/models/sms_customization_params' require 'turnkey_client/models/stamp_login_intent' @@ -335,9 +363,13 @@ 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_auth_proxy_config_intent' +require 'turnkey_client/models/update_auth_proxy_config_result' +require 'turnkey_client/models/update_oauth2_credential_intent' +require 'turnkey_client/models/update_oauth2_credential_request' +require 'turnkey_client/models/update_oauth2_credential_result' require 'turnkey_client/models/update_policy_intent' require 'turnkey_client/models/update_policy_intent_v2' require 'turnkey_client/models/update_policy_request' @@ -379,14 +411,18 @@ require 'turnkey_client/models/wallet' require 'turnkey_client/models/wallet_account' require 'turnkey_client/models/wallet_account_params' +require 'turnkey_client/models/wallet_kit_settings_params' require 'turnkey_client/models/wallet_params' require 'turnkey_client/models/wallet_result' # APIs require 'turnkey_client/api/api_keys_api' require 'turnkey_client/api/activities_api' +require 'turnkey_client/api/app_proof_api' require 'turnkey_client/api/authenticators_api' +require 'turnkey_client/api/boot_proof_api' require 'turnkey_client/api/consensus_api' +require 'turnkey_client/api/default_api' require 'turnkey_client/api/features_api' require 'turnkey_client/api/invitations_api' require 'turnkey_client/api/on_ramp_api' diff --git a/turnkey_client/lib/turnkey_client/api/app_proof_api.rb b/turnkey_client/lib/turnkey_client/api/app_proof_api.rb new file mode 100644 index 0000000..29953cd --- /dev/null +++ b/turnkey_client/lib/turnkey_client/api/app_proof_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 AppProofApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # List app proofs for an activity + # List the app proofs for the given activity. + # @param body + # @param [Hash] opts the optional parameters + # @return [GetAppProofsResponse] + def get_app_proofs(body, opts = {}) + data, _status_code, _headers = get_app_proofs_with_http_info(body, opts) + data + end + + # List app proofs for an activity + # List the app proofs for the given activity. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(GetAppProofsResponse, Integer, Hash)>] GetAppProofsResponse data, response status code and response headers + def get_app_proofs_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppProofApi.get_app_proofs ...' + 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 AppProofApi.get_app_proofs" + end + # resource path + local_var_path = '/public/v1/query/list_app_proofs' + + # 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] || 'GetAppProofsResponse' + + 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: AppProofApi#get_app_proofs\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/boot_proof_api.rb b/turnkey_client/lib/turnkey_client/api/boot_proof_api.rb new file mode 100644 index 0000000..7f2dd71 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/api/boot_proof_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 BootProofApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Get a specific boot proof + # Get the boot proof for a given ephemeral key. + # @param body + # @param [Hash] opts the optional parameters + # @return [BootProofResponse] + def get_boot_proof(body, opts = {}) + data, _status_code, _headers = get_boot_proof_with_http_info(body, opts) + data + end + + # Get a specific boot proof + # Get the boot proof for a given ephemeral key. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(BootProofResponse, Integer, Hash)>] BootProofResponse data, response status code and response headers + def get_boot_proof_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: BootProofApi.get_boot_proof ...' + 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 BootProofApi.get_boot_proof" + end + # resource path + local_var_path = '/public/v1/query/get_boot_proof' + + # 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] || 'BootProofResponse' + + 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: BootProofApi#get_boot_proof\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get the latest boot proof for an app + # Get the latest boot proof for a given enclave app name. + # @param body + # @param [Hash] opts the optional parameters + # @return [BootProofResponse] + def get_latest_boot_proof(body, opts = {}) + data, _status_code, _headers = get_latest_boot_proof_with_http_info(body, opts) + data + end + + # Get the latest boot proof for an app + # Get the latest boot proof for a given enclave app name. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(BootProofResponse, Integer, Hash)>] BootProofResponse data, response status code and response headers + def get_latest_boot_proof_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: BootProofApi.get_latest_boot_proof ...' + 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 BootProofApi.get_latest_boot_proof" + end + # resource path + local_var_path = '/public/v1/query/get_latest_boot_proof' + + # 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] || 'BootProofResponse' + + 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: BootProofApi#get_latest_boot_proof\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/default_api.rb b/turnkey_client/lib/turnkey_client/api/default_api.rb new file mode 100644 index 0000000..e458b15 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/api/default_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 DefaultApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Get OAuth 2.0 credential + # Get details about an OAuth 2.0 credential. + # @param body + # @param [Hash] opts the optional parameters + # @return [GetOauth2CredentialResponse] + def get_oauth2_credential(body, opts = {}) + data, _status_code, _headers = get_oauth2_credential_with_http_info(body, opts) + data + end + + # Get OAuth 2.0 credential + # Get details about an OAuth 2.0 credential. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(GetOauth2CredentialResponse, Integer, Hash)>] GetOauth2CredentialResponse data, response status code and response headers + def get_oauth2_credential_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.get_oauth2_credential ...' + 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 DefaultApi.get_oauth2_credential" + end + # resource path + local_var_path = '/public/v1/query/get_oauth2_credential' + + # 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] || 'GetOauth2CredentialResponse' + + 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: DefaultApi#get_oauth2_credential\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/user_auth_api.rb b/turnkey_client/lib/turnkey_client/api/user_auth_api.rb index b082a71..986e795 100644 --- a/turnkey_client/lib/turnkey_client/api/user_auth_api.rb +++ b/turnkey_client/lib/turnkey_client/api/user_auth_api.rb @@ -15,6 +15,64 @@ class UserAuthApi def initialize(api_client = ApiClient.default) @api_client = api_client end + # Create an OAuth 2.0 Credential + # Enable authentication for end users with an OAuth 2.0 provider + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def create_oauth2_credential(body, opts = {}) + data, _status_code, _headers = create_oauth2_credential_with_http_info(body, opts) + data + end + + # Create an OAuth 2.0 Credential + # Enable authentication for end users with an OAuth 2.0 provider + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def create_oauth2_credential_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserAuthApi.create_oauth2_credential ...' + 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 UserAuthApi.create_oauth2_credential" + end + # resource path + local_var_path = '/public/v1/submit/create_oauth2_credential' + + # 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: UserAuthApi#create_oauth2_credential\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end # Create Oauth providers # Create Oauth providers for a specified user. # @param body @@ -73,6 +131,64 @@ def create_oauth_providers_with_http_info(body, opts = {}) end return data, status_code, headers end + # Delete an OAuth 2.0 Credential + # Disable authentication for end users with an OAuth 2.0 provider + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def delete_oauth2_credential(body, opts = {}) + data, _status_code, _headers = delete_oauth2_credential_with_http_info(body, opts) + data + end + + # Delete an OAuth 2.0 Credential + # Disable authentication for end users with an OAuth 2.0 provider + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def delete_oauth2_credential_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserAuthApi.delete_oauth2_credential ...' + 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 UserAuthApi.delete_oauth2_credential" + end + # resource path + local_var_path = '/public/v1/submit/delete_oauth2_credential' + + # 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: UserAuthApi#delete_oauth2_credential\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end # Delete Oauth providers # Remove Oauth providers for a specified user. # @param body @@ -305,6 +421,64 @@ def init_otp_auth_with_http_info(body, opts = {}) end return data, status_code, headers end + # List OAuth 2.0 Credentials + # List all OAuth 2.0 credentials within an organization. + # @param body + # @param [Hash] opts the optional parameters + # @return [ListOauth2CredentialsResponse] + def list_oauth2_credentials(body, opts = {}) + data, _status_code, _headers = list_oauth2_credentials_with_http_info(body, opts) + data + end + + # List OAuth 2.0 Credentials + # List all OAuth 2.0 credentials within an organization. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ListOauth2CredentialsResponse, Integer, Hash)>] ListOauth2CredentialsResponse data, response status code and response headers + def list_oauth2_credentials_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserAuthApi.list_oauth2_credentials ...' + 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 UserAuthApi.list_oauth2_credentials" + end + # resource path + local_var_path = '/public/v1/query/list_oauth2_credentials' + + # 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] || 'ListOauth2CredentialsResponse' + + 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: UserAuthApi#list_oauth2_credentials\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end # Oauth # Authenticate a user with an OIDC token (Oauth). # @param body @@ -363,6 +537,64 @@ def oauth_with_http_info(body, opts = {}) end return data, status_code, headers end + # OAuth 2.0 authentication + # Authenticate a user with an OAuth 2.0 provider and receive an OIDC token to use with the LoginWithOAuth or CreateSubOrganization activities + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def oauth2_authenticate(body, opts = {}) + data, _status_code, _headers = oauth2_authenticate_with_http_info(body, opts) + data + end + + # OAuth 2.0 authentication + # Authenticate a user with an OAuth 2.0 provider and receive an OIDC token to use with the LoginWithOAuth or CreateSubOrganization activities + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def oauth2_authenticate_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserAuthApi.oauth2_authenticate ...' + 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 UserAuthApi.oauth2_authenticate" + end + # resource path + local_var_path = '/public/v1/submit/oauth2_authenticate' + + # 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: UserAuthApi#oauth2_authenticate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end # OTP auth # Authenticate a user with an OTP code sent via email or SMS. # @param body @@ -421,5 +653,63 @@ def otp_auth_with_http_info(body, opts = {}) end return data, status_code, headers end + # Update an OAuth 2.0 Credential + # Update an OAuth 2.0 provider credential + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def update_oauth2_credential(body, opts = {}) + data, _status_code, _headers = update_oauth2_credential_with_http_info(body, opts) + data + end + + # Update an OAuth 2.0 Credential + # Update an OAuth 2.0 provider credential + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def update_oauth2_credential_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserAuthApi.update_oauth2_credential ...' + 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 UserAuthApi.update_oauth2_credential" + end + # resource path + local_var_path = '/public/v1/submit/update_oauth2_credential' + + # 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: UserAuthApi#update_oauth2_credential\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/models/activity.rb b/turnkey_client/lib/turnkey_client/models/activity.rb index 3d3c4e0..d79e13e 100644 --- a/turnkey_client/lib/turnkey_client/models/activity.rb +++ b/turnkey_client/lib/turnkey_client/models/activity.rb @@ -29,6 +29,9 @@ class Activity # A list of objects representing a particular User's approval or rejection of a Consensus request, including all relevant metadata. attr_accessor :votes + # A list of app proofs generated by enclaves during activity execution, providing verifiable attestations of performed operations. + attr_accessor :app_proofs + # An artifact verifying a User's action. attr_accessor :fingerprint @@ -52,6 +55,7 @@ def self.attribute_map :'intent' => :'intent', :'result' => :'result', :'votes' => :'votes', + :'app_proofs' => :'appProofs', :'fingerprint' => :'fingerprint', :'can_approve' => :'canApprove', :'can_reject' => :'canReject', @@ -71,6 +75,7 @@ def self.openapi_types :'intent' => :'Object', :'result' => :'Object', :'votes' => :'Object', + :'app_proofs' => :'Object', :'fingerprint' => :'Object', :'can_approve' => :'Object', :'can_reject' => :'Object', @@ -131,6 +136,12 @@ def initialize(attributes = {}) end end + if attributes.key?(:'app_proofs') + if (value = attributes[:'app_proofs']).is_a?(Array) + self.app_proofs = value + end + end + if attributes.key?(:'fingerprint') self.fingerprint = attributes[:'fingerprint'] end @@ -241,6 +252,7 @@ def ==(o) intent == o.intent && result == o.result && votes == o.votes && + app_proofs == o.app_proofs && fingerprint == o.fingerprint && can_approve == o.can_approve && can_reject == o.can_reject && @@ -258,7 +270,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, organization_id, status, type, intent, result, votes, fingerprint, can_approve, can_reject, created_at, updated_at, failure].hash + [id, organization_id, status, type, intent, result, votes, app_proofs, fingerprint, can_approve, can_reject, created_at, updated_at, failure].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/activity_type.rb b/turnkey_client/lib/turnkey_client/models/activity_type.rb index cf9e980..b92917e 100644 --- a/turnkey_client/lib/turnkey_client/models/activity_type.rb +++ b/turnkey_client/lib/turnkey_client/models/activity_type.rb @@ -106,6 +106,13 @@ class ActivityType 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 + ENABLE_AUTH_PROXY = 'ACTIVITY_TYPE_ENABLE_AUTH_PROXY'.freeze + DISABLE_AUTH_PROXY = 'ACTIVITY_TYPE_DISABLE_AUTH_PROXY'.freeze + UPDATE_AUTH_PROXY_CONFIG = 'ACTIVITY_TYPE_UPDATE_AUTH_PROXY_CONFIG'.freeze + CREATE_OAUTH2_CREDENTIAL = 'ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL'.freeze + UPDATE_OAUTH2_CREDENTIAL = 'ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL'.freeze + DELETE_OAUTH2_CREDENTIAL = 'ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL'.freeze + OAUTH2_AUTHENTICATE = 'ACTIVITY_TYPE_OAUTH2_AUTHENTICATE'.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/app_proof.rb b/turnkey_client/lib/turnkey_client/models/app_proof.rb new file mode 100644 index 0000000..0bd2a81 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/app_proof.rb @@ -0,0 +1,255 @@ +=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 AppProof + attr_accessor :scheme + + # Ephemeral public key. + attr_accessor :public_key + + # JSON serialized AppProofPayload. + attr_accessor :proof_payload + + # Signature over hashed proof_payload. + attr_accessor :signature + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'scheme' => :'scheme', + :'public_key' => :'publicKey', + :'proof_payload' => :'proofPayload', + :'signature' => :'signature' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'scheme' => :'Object', + :'public_key' => :'Object', + :'proof_payload' => :'Object', + :'signature' => :'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::AppProof` 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::AppProof`. 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?(:'scheme') + self.scheme = attributes[:'scheme'] + end + + if attributes.key?(:'public_key') + self.public_key = attributes[:'public_key'] + end + + if attributes.key?(:'proof_payload') + self.proof_payload = attributes[:'proof_payload'] + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + 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 @scheme.nil? + invalid_properties.push('invalid value for "scheme", scheme cannot be nil.') + end + + if @public_key.nil? + invalid_properties.push('invalid value for "public_key", public_key cannot be nil.') + end + + if @proof_payload.nil? + invalid_properties.push('invalid value for "proof_payload", proof_payload cannot be nil.') + end + + if @signature.nil? + invalid_properties.push('invalid value for "signature", signature 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 @scheme.nil? + return false if @public_key.nil? + return false if @proof_payload.nil? + return false if @signature.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 && + scheme == o.scheme && + public_key == o.public_key && + proof_payload == o.proof_payload && + signature == o.signature + 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 + [scheme, public_key, proof_payload, signature].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/boot_proof.rb b/turnkey_client/lib/turnkey_client/models/boot_proof.rb new file mode 100644 index 0000000..7111157 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/boot_proof.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 BootProof + # The hex encoded Ephemeral Public Key. + attr_accessor :ephemeral_public_key_hex + + # The DER encoded COSE Sign1 struct Attestation doc. + attr_accessor :aws_attestation_doc_b64 + + # The borsch serialized base64 encoded Manifest. + attr_accessor :qos_manifest_b64 + + # The borsch serialized base64 encoded Manifest Envelope. + attr_accessor :qos_manifest_envelope_b64 + + # The label under which the enclave app was deployed. + attr_accessor :deployment_label + + # Name of the enclave app + attr_accessor :enclave_app + + # Owner of the app i.e. 'tkhq' + attr_accessor :owner + + attr_accessor :created_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ephemeral_public_key_hex' => :'ephemeralPublicKeyHex', + :'aws_attestation_doc_b64' => :'awsAttestationDocB64', + :'qos_manifest_b64' => :'qosManifestB64', + :'qos_manifest_envelope_b64' => :'qosManifestEnvelopeB64', + :'deployment_label' => :'deploymentLabel', + :'enclave_app' => :'enclaveApp', + :'owner' => :'owner', + :'created_at' => :'createdAt' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'ephemeral_public_key_hex' => :'Object', + :'aws_attestation_doc_b64' => :'Object', + :'qos_manifest_b64' => :'Object', + :'qos_manifest_envelope_b64' => :'Object', + :'deployment_label' => :'Object', + :'enclave_app' => :'Object', + :'owner' => :'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::BootProof` 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::BootProof`. 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?(:'ephemeral_public_key_hex') + self.ephemeral_public_key_hex = attributes[:'ephemeral_public_key_hex'] + end + + if attributes.key?(:'aws_attestation_doc_b64') + self.aws_attestation_doc_b64 = attributes[:'aws_attestation_doc_b64'] + end + + if attributes.key?(:'qos_manifest_b64') + self.qos_manifest_b64 = attributes[:'qos_manifest_b64'] + end + + if attributes.key?(:'qos_manifest_envelope_b64') + self.qos_manifest_envelope_b64 = attributes[:'qos_manifest_envelope_b64'] + end + + if attributes.key?(:'deployment_label') + self.deployment_label = attributes[:'deployment_label'] + end + + if attributes.key?(:'enclave_app') + self.enclave_app = attributes[:'enclave_app'] + end + + if attributes.key?(:'owner') + self.owner = attributes[:'owner'] + 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 @ephemeral_public_key_hex.nil? + invalid_properties.push('invalid value for "ephemeral_public_key_hex", ephemeral_public_key_hex cannot be nil.') + end + + if @aws_attestation_doc_b64.nil? + invalid_properties.push('invalid value for "aws_attestation_doc_b64", aws_attestation_doc_b64 cannot be nil.') + end + + if @qos_manifest_b64.nil? + invalid_properties.push('invalid value for "qos_manifest_b64", qos_manifest_b64 cannot be nil.') + end + + if @qos_manifest_envelope_b64.nil? + invalid_properties.push('invalid value for "qos_manifest_envelope_b64", qos_manifest_envelope_b64 cannot be nil.') + end + + if @deployment_label.nil? + invalid_properties.push('invalid value for "deployment_label", deployment_label cannot be nil.') + end + + if @enclave_app.nil? + invalid_properties.push('invalid value for "enclave_app", enclave_app cannot be nil.') + end + + if @owner.nil? + invalid_properties.push('invalid value for "owner", owner 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 @ephemeral_public_key_hex.nil? + return false if @aws_attestation_doc_b64.nil? + return false if @qos_manifest_b64.nil? + return false if @qos_manifest_envelope_b64.nil? + return false if @deployment_label.nil? + return false if @enclave_app.nil? + return false if @owner.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 && + ephemeral_public_key_hex == o.ephemeral_public_key_hex && + aws_attestation_doc_b64 == o.aws_attestation_doc_b64 && + qos_manifest_b64 == o.qos_manifest_b64 && + qos_manifest_envelope_b64 == o.qos_manifest_envelope_b64 && + deployment_label == o.deployment_label && + enclave_app == o.enclave_app && + owner == o.owner && + 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 + [ephemeral_public_key_hex, aws_attestation_doc_b64, qos_manifest_b64, qos_manifest_envelope_b64, deployment_label, enclave_app, owner, 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/boot_proof_response.rb b/turnkey_client/lib/turnkey_client/models/boot_proof_response.rb new file mode 100644 index 0000000..f80335b --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/boot_proof_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 BootProofResponse + attr_accessor :boot_proof + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'boot_proof' => :'bootProof' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'boot_proof' => :'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::BootProofResponse` 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::BootProofResponse`. 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?(:'boot_proof') + self.boot_proof = attributes[:'boot_proof'] + 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 @boot_proof.nil? + invalid_properties.push('invalid value for "boot_proof", boot_proof 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 @boot_proof.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 && + boot_proof == o.boot_proof + 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 + [boot_proof].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/common_v1_policy_evaluation.rb b/turnkey_client/lib/turnkey_client/models/common_v1_policy_evaluation.rb new file mode 100644 index 0000000..7ce78b0 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/common_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 CommonV1PolicyEvaluation + 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::CommonV1PolicyEvaluation` 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::CommonV1PolicyEvaluation`. 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/create_oauth2_credential_intent.rb b/turnkey_client/lib/turnkey_client/models/create_oauth2_credential_intent.rb new file mode 100644 index 0000000..50a9a65 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/create_oauth2_credential_intent.rb @@ -0,0 +1,240 @@ +=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 CreateOauth2CredentialIntent + attr_accessor :provider + + # The Client ID issued by the OAuth 2.0 provider + attr_accessor :client_id + + # The client secret issued by the OAuth 2.0 provider encrypted to the TLS Fetcher quorum key + attr_accessor :encrypted_client_secret + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'provider' => :'provider', + :'client_id' => :'clientId', + :'encrypted_client_secret' => :'encryptedClientSecret' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'provider' => :'Object', + :'client_id' => :'Object', + :'encrypted_client_secret' => :'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::CreateOauth2CredentialIntent` 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::CreateOauth2CredentialIntent`. 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?(:'provider') + self.provider = attributes[:'provider'] + end + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'encrypted_client_secret') + self.encrypted_client_secret = attributes[:'encrypted_client_secret'] + 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 @provider.nil? + invalid_properties.push('invalid value for "provider", provider cannot be nil.') + end + + if @client_id.nil? + invalid_properties.push('invalid value for "client_id", client_id cannot be nil.') + end + + if @encrypted_client_secret.nil? + invalid_properties.push('invalid value for "encrypted_client_secret", encrypted_client_secret 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 @provider.nil? + return false if @client_id.nil? + return false if @encrypted_client_secret.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 && + provider == o.provider && + client_id == o.client_id && + encrypted_client_secret == o.encrypted_client_secret + 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 + [provider, client_id, encrypted_client_secret].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_oauth2_credential_request.rb b/turnkey_client/lib/turnkey_client/models/create_oauth2_credential_request.rb new file mode 100644 index 0000000..d6e51c8 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/create_oauth2_credential_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 CreateOauth2CredentialRequest + 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::CreateOauth2CredentialRequest` 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::CreateOauth2CredentialRequest`. 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_OAUTH2_CREDENTIAL']) + 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_OAUTH2_CREDENTIAL']) + 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_oauth2_credential_result.rb b/turnkey_client/lib/turnkey_client/models/create_oauth2_credential_result.rb new file mode 100644 index 0000000..ead2c5d --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/create_oauth2_credential_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 CreateOauth2CredentialResult + # Unique identifier of the OAuth 2.0 credential that was created + attr_accessor :oauth2_credential_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'oauth2_credential_id' => :'oauth2CredentialId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'oauth2_credential_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::CreateOauth2CredentialResult` 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::CreateOauth2CredentialResult`. 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?(:'oauth2_credential_id') + self.oauth2_credential_id = attributes[:'oauth2_credential_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 @oauth2_credential_id.nil? + invalid_properties.push('invalid value for "oauth2_credential_id", oauth2_credential_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 @oauth2_credential_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 && + oauth2_credential_id == o.oauth2_credential_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 + [oauth2_credential_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_v7.rb b/turnkey_client/lib/turnkey_client/models/create_sub_organization_intent_v7.rb index d41bcfe..b706323 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 @@ -35,6 +35,9 @@ class CreateSubOrganizationIntentV7 # Disable OTP email auth for the sub-organization attr_accessor :disable_otp_email_auth + # 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 { @@ -45,7 +48,8 @@ def self.attribute_map :'disable_email_recovery' => :'disableEmailRecovery', :'disable_email_auth' => :'disableEmailAuth', :'disable_sms_auth' => :'disableSmsAuth', - :'disable_otp_email_auth' => :'disableOtpEmailAuth' + :'disable_otp_email_auth' => :'disableOtpEmailAuth', + :'verification_token' => :'verificationToken' } end @@ -59,7 +63,8 @@ def self.openapi_types :'disable_email_recovery' => :'Object', :'disable_email_auth' => :'Object', :'disable_sms_auth' => :'Object', - :'disable_otp_email_auth' => :'Object' + :'disable_otp_email_auth' => :'Object', + :'verification_token' => :'Object' } end @@ -69,7 +74,8 @@ def self.openapi_nullable :'disable_email_recovery', :'disable_email_auth', :'disable_sms_auth', - :'disable_otp_email_auth' + :'disable_otp_email_auth', + :'verification_token' ]) end @@ -121,6 +127,10 @@ def initialize(attributes = {}) if attributes.key?(:'disable_otp_email_auth') self.disable_otp_email_auth = attributes[:'disable_otp_email_auth'] 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? @@ -163,7 +173,8 @@ def ==(o) disable_email_recovery == o.disable_email_recovery && disable_email_auth == o.disable_email_auth && disable_sms_auth == o.disable_sms_auth && - disable_otp_email_auth == o.disable_otp_email_auth + disable_otp_email_auth == o.disable_otp_email_auth && + verification_token == o.verification_token end # @see the `==` method @@ -175,7 +186,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [sub_organization_name, root_users, root_quorum_threshold, wallet, disable_email_recovery, disable_email_auth, disable_sms_auth, disable_otp_email_auth].hash + [sub_organization_name, root_users, root_quorum_threshold, wallet, disable_email_recovery, disable_email_auth, disable_sms_auth, disable_otp_email_auth, verification_token].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/delete_oauth2_credential_intent.rb b/turnkey_client/lib/turnkey_client/models/delete_oauth2_credential_intent.rb new file mode 100644 index 0000000..67f5db6 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/delete_oauth2_credential_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 DeleteOauth2CredentialIntent + # The ID of the OAuth 2.0 credential to delete + attr_accessor :oauth2_credential_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'oauth2_credential_id' => :'oauth2CredentialId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'oauth2_credential_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::DeleteOauth2CredentialIntent` 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::DeleteOauth2CredentialIntent`. 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?(:'oauth2_credential_id') + self.oauth2_credential_id = attributes[:'oauth2_credential_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 @oauth2_credential_id.nil? + invalid_properties.push('invalid value for "oauth2_credential_id", oauth2_credential_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 @oauth2_credential_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 && + oauth2_credential_id == o.oauth2_credential_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 + [oauth2_credential_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_oauth2_credential_request.rb b/turnkey_client/lib/turnkey_client/models/delete_oauth2_credential_request.rb new file mode 100644 index 0000000..7b92c2c --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/delete_oauth2_credential_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 DeleteOauth2CredentialRequest + 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::DeleteOauth2CredentialRequest` 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::DeleteOauth2CredentialRequest`. 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_OAUTH2_CREDENTIAL']) + 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_OAUTH2_CREDENTIAL']) + 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_oauth2_credential_result.rb b/turnkey_client/lib/turnkey_client/models/delete_oauth2_credential_result.rb new file mode 100644 index 0000000..bb20695 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/delete_oauth2_credential_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 DeleteOauth2CredentialResult + # Unique identifier of the OAuth 2.0 credential that was deleted + attr_accessor :oauth2_credential_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'oauth2_credential_id' => :'oauth2CredentialId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'oauth2_credential_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::DeleteOauth2CredentialResult` 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::DeleteOauth2CredentialResult`. 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?(:'oauth2_credential_id') + self.oauth2_credential_id = attributes[:'oauth2_credential_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 @oauth2_credential_id.nil? + invalid_properties.push('invalid value for "oauth2_credential_id", oauth2_credential_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 @oauth2_credential_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 && + oauth2_credential_id == o.oauth2_credential_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 + [oauth2_credential_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/disable_auth_proxy_intent.rb b/turnkey_client/lib/turnkey_client/models/disable_auth_proxy_intent.rb new file mode 100644 index 0000000..3a0eb31 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/disable_auth_proxy_intent.rb @@ -0,0 +1,196 @@ +=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 DisableAuthProxyIntent + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + } + end + + # Attribute type mapping. + def self.openapi_types + { + } + 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::DisableAuthProxyIntent` 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::DisableAuthProxyIntent`. 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 + } + 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 + 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 + [].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/disable_auth_proxy_result.rb b/turnkey_client/lib/turnkey_client/models/disable_auth_proxy_result.rb new file mode 100644 index 0000000..6c56221 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/disable_auth_proxy_result.rb @@ -0,0 +1,196 @@ +=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 DisableAuthProxyResult + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + } + end + + # Attribute type mapping. + def self.openapi_types + { + } + 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::DisableAuthProxyResult` 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::DisableAuthProxyResult`. 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 + } + 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 + 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 + [].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/enable_auth_proxy_intent.rb b/turnkey_client/lib/turnkey_client/models/enable_auth_proxy_intent.rb new file mode 100644 index 0000000..bdb1d4b --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/enable_auth_proxy_intent.rb @@ -0,0 +1,196 @@ +=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 EnableAuthProxyIntent + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + } + end + + # Attribute type mapping. + def self.openapi_types + { + } + 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::EnableAuthProxyIntent` 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::EnableAuthProxyIntent`. 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 + } + 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 + 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 + [].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/enable_auth_proxy_result.rb b/turnkey_client/lib/turnkey_client/models/enable_auth_proxy_result.rb new file mode 100644 index 0000000..6a7679e --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/enable_auth_proxy_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 EnableAuthProxyResult + # A User ID with permission to initiate authentication. + 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::EnableAuthProxyResult` 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::EnableAuthProxyResult`. 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/feature_name.rb b/turnkey_client/lib/turnkey_client/models/feature_name.rb index ad586ec..8a8e560 100644 --- a/turnkey_client/lib/turnkey_client/models/feature_name.rb +++ b/turnkey_client/lib/turnkey_client/models/feature_name.rb @@ -19,6 +19,7 @@ class FeatureName WEBHOOK = 'FEATURE_NAME_WEBHOOK'.freeze SMS_AUTH = 'FEATURE_NAME_SMS_AUTH'.freeze OTP_EMAIL_AUTH = 'FEATURE_NAME_OTP_EMAIL_AUTH'.freeze + AUTH_PROXY = 'FEATURE_NAME_AUTH_PROXY'.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/get_app_proofs_request.rb b/turnkey_client/lib/turnkey_client/models/get_app_proofs_request.rb new file mode 100644 index 0000000..35b28ee --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/get_app_proofs_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 GetAppProofsRequest + # 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::GetAppProofsRequest` 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::GetAppProofsRequest`. 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_app_proofs_response.rb b/turnkey_client/lib/turnkey_client/models/get_app_proofs_response.rb new file mode 100644 index 0000000..04aff85 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/get_app_proofs_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 GetAppProofsResponse + attr_accessor :app_proofs + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'app_proofs' => :'appProofs' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'app_proofs' => :'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::GetAppProofsResponse` 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::GetAppProofsResponse`. 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?(:'app_proofs') + if (value = attributes[:'app_proofs']).is_a?(Array) + self.app_proofs = 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 @app_proofs.nil? + invalid_properties.push('invalid value for "app_proofs", app_proofs 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 @app_proofs.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 && + app_proofs == o.app_proofs + 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 + [app_proofs].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_boot_proof_request.rb b/turnkey_client/lib/turnkey_client/models/get_boot_proof_request.rb new file mode 100644 index 0000000..58750ca --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/get_boot_proof_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 GetBootProofRequest + # Unique identifier for a given Organization. + attr_accessor :organization_id + + # Hex encoded ephemeral public key. + attr_accessor :ephemeral_key + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'organization_id' => :'organizationId', + :'ephemeral_key' => :'ephemeralKey' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'organization_id' => :'Object', + :'ephemeral_key' => :'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::GetBootProofRequest` 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::GetBootProofRequest`. 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?(:'ephemeral_key') + self.ephemeral_key = attributes[:'ephemeral_key'] + 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 @ephemeral_key.nil? + invalid_properties.push('invalid value for "ephemeral_key", ephemeral_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 @organization_id.nil? + return false if @ephemeral_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 && + organization_id == o.organization_id && + ephemeral_key == o.ephemeral_key + 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, ephemeral_key].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_latest_boot_proof_request.rb b/turnkey_client/lib/turnkey_client/models/get_latest_boot_proof_request.rb new file mode 100644 index 0000000..9e3458c --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/get_latest_boot_proof_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 GetLatestBootProofRequest + # Unique identifier for a given Organization. + attr_accessor :organization_id + + # Name of enclave app. + attr_accessor :app_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'organization_id' => :'organizationId', + :'app_name' => :'appName' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'organization_id' => :'Object', + :'app_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::GetLatestBootProofRequest` 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::GetLatestBootProofRequest`. 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?(:'app_name') + self.app_name = attributes[:'app_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 @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @app_name.nil? + invalid_properties.push('invalid value for "app_name", app_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 @organization_id.nil? + return false if @app_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 && + organization_id == o.organization_id && + app_name == o.app_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 + [organization_id, app_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/get_oauth2_credential_request.rb b/turnkey_client/lib/turnkey_client/models/get_oauth2_credential_request.rb new file mode 100644 index 0000000..691d2ed --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/get_oauth2_credential_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 GetOauth2CredentialRequest + # Unique identifier for a given Organization. + attr_accessor :organization_id + + # Unique identifier for a given OAuth 2.0 Credential. + attr_accessor :oauth2_credential_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'organization_id' => :'organizationId', + :'oauth2_credential_id' => :'oauth2CredentialId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'organization_id' => :'Object', + :'oauth2_credential_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::GetOauth2CredentialRequest` 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::GetOauth2CredentialRequest`. 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?(:'oauth2_credential_id') + self.oauth2_credential_id = attributes[:'oauth2_credential_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 @oauth2_credential_id.nil? + invalid_properties.push('invalid value for "oauth2_credential_id", oauth2_credential_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 @oauth2_credential_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 && + oauth2_credential_id == o.oauth2_credential_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, oauth2_credential_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_oauth2_credential_response.rb b/turnkey_client/lib/turnkey_client/models/get_oauth2_credential_response.rb new file mode 100644 index 0000000..df2cc3b --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/get_oauth2_credential_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 GetOauth2CredentialResponse + attr_accessor :oauth2_credential + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'oauth2_credential' => :'oauth2Credential' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'oauth2_credential' => :'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::GetOauth2CredentialResponse` 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::GetOauth2CredentialResponse`. 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?(:'oauth2_credential') + self.oauth2_credential = attributes[:'oauth2_credential'] + 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 @oauth2_credential.nil? + invalid_properties.push('invalid value for "oauth2_credential", oauth2_credential 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 @oauth2_credential.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 && + oauth2_credential == o.oauth2_credential + 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 + [oauth2_credential].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_wallet_accounts_request.rb b/turnkey_client/lib/turnkey_client/models/get_wallet_accounts_request.rb index 50050a9..34efb53 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 @@ -18,6 +18,9 @@ class GetWalletAccountsRequest # Unique identifier for a given wallet. If not provided, all accounts for the organization will be returned. attr_accessor :wallet_id + # Optional flag to specify if the wallet details should be included in the response. Default = false. + attr_accessor :include_wallet_details + attr_accessor :pagination_options # Attribute mapping from ruby-style variable name to JSON key. @@ -25,6 +28,7 @@ def self.attribute_map { :'organization_id' => :'organizationId', :'wallet_id' => :'walletId', + :'include_wallet_details' => :'includeWalletDetails', :'pagination_options' => :'paginationOptions' } end @@ -34,6 +38,7 @@ def self.openapi_types { :'organization_id' => :'Object', :'wallet_id' => :'Object', + :'include_wallet_details' => :'Object', :'pagination_options' => :'Object' } end @@ -42,6 +47,7 @@ def self.openapi_types def self.openapi_nullable Set.new([ :'wallet_id', + :'include_wallet_details', ]) end @@ -68,6 +74,10 @@ def initialize(attributes = {}) self.wallet_id = attributes[:'wallet_id'] end + if attributes.key?(:'include_wallet_details') + self.include_wallet_details = attributes[:'include_wallet_details'] + end + if attributes.key?(:'pagination_options') self.pagination_options = attributes[:'pagination_options'] end @@ -98,6 +108,7 @@ def ==(o) self.class == o.class && organization_id == o.organization_id && wallet_id == o.wallet_id && + include_wallet_details == o.include_wallet_details && pagination_options == o.pagination_options end @@ -110,7 +121,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [organization_id, wallet_id, pagination_options].hash + [organization_id, wallet_id, include_wallet_details, pagination_options].hash end # Builds the object from hash 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 index 0ba8901..b77bc8d 100644 --- 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 @@ -37,6 +37,9 @@ class InitFiatOnRampIntent # 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 + # Optional MoonPay Widget URL to sign when using MoonPay client SDKs with URL Signing enabled. + attr_accessor :url_for_signature + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -49,7 +52,8 @@ def self.attribute_map :'payment_method' => :'paymentMethod', :'country_code' => :'countryCode', :'country_subdivision_code' => :'countrySubdivisionCode', - :'sandbox_mode' => :'sandboxMode' + :'sandbox_mode' => :'sandboxMode', + :'url_for_signature' => :'urlForSignature' } end @@ -65,7 +69,8 @@ def self.openapi_types :'payment_method' => :'Object', :'country_code' => :'Object', :'country_subdivision_code' => :'Object', - :'sandbox_mode' => :'Object' + :'sandbox_mode' => :'Object', + :'url_for_signature' => :'Object' } end @@ -75,7 +80,8 @@ def self.openapi_nullable :'fiat_currency_amount', :'country_code', :'country_subdivision_code', - :'sandbox_mode' + :'sandbox_mode', + :'url_for_signature' ]) end @@ -133,6 +139,10 @@ def initialize(attributes = {}) if attributes.key?(:'sandbox_mode') self.sandbox_mode = attributes[:'sandbox_mode'] end + + if attributes.key?(:'url_for_signature') + self.url_for_signature = attributes[:'url_for_signature'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -182,7 +192,8 @@ def ==(o) payment_method == o.payment_method && country_code == o.country_code && country_subdivision_code == o.country_subdivision_code && - sandbox_mode == o.sandbox_mode + sandbox_mode == o.sandbox_mode && + url_for_signature == o.url_for_signature end # @see the `==` method @@ -194,7 +205,7 @@ def eql?(o) # 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 + [onramp_provider, wallet_address, network, crypto_currency_code, fiat_currency_code, fiat_currency_amount, payment_method, country_code, country_subdivision_code, sandbox_mode, url_for_signature].hash end # Builds the object from hash 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 index 0132b04..62715ae 100644 --- 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 @@ -18,11 +18,15 @@ class InitFiatOnRampResult # Unique identifier used to retrieve transaction statuses for a given fiat on-ramp flow. attr_accessor :on_ramp_transaction_id + # Optional signature of the MoonPay Widget URL. The signature is generated if the Init Fiat On Ramp intent includes the urlForSignature field. The signature can be used to initialize the MoonPay SDKs when URL signing is enabled for your project. + attr_accessor :on_ramp_url_signature + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'on_ramp_url' => :'onRampUrl', - :'on_ramp_transaction_id' => :'onRampTransactionId' + :'on_ramp_transaction_id' => :'onRampTransactionId', + :'on_ramp_url_signature' => :'onRampUrlSignature' } end @@ -30,7 +34,8 @@ def self.attribute_map def self.openapi_types { :'on_ramp_url' => :'Object', - :'on_ramp_transaction_id' => :'Object' + :'on_ramp_transaction_id' => :'Object', + :'on_ramp_url_signature' => :'Object' } end @@ -62,6 +67,10 @@ def initialize(attributes = {}) if attributes.key?(:'on_ramp_transaction_id') self.on_ramp_transaction_id = attributes[:'on_ramp_transaction_id'] end + + if attributes.key?(:'on_ramp_url_signature') + self.on_ramp_url_signature = attributes[:'on_ramp_url_signature'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -93,7 +102,8 @@ 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 + on_ramp_transaction_id == o.on_ramp_transaction_id && + on_ramp_url_signature == o.on_ramp_url_signature end # @see the `==` method @@ -105,7 +115,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [on_ramp_url, on_ramp_transaction_id].hash + [on_ramp_url, on_ramp_transaction_id, on_ramp_url_signature].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/intent.rb b/turnkey_client/lib/turnkey_client/models/intent.rb index e1713b0..5c16869 100644 --- a/turnkey_client/lib/turnkey_client/models/intent.rb +++ b/turnkey_client/lib/turnkey_client/models/intent.rb @@ -200,6 +200,20 @@ class Intent attr_accessor :delete_smart_contract_interface_intent + attr_accessor :enable_auth_proxy_intent + + attr_accessor :disable_auth_proxy_intent + + attr_accessor :update_auth_proxy_config_intent + + attr_accessor :create_oauth2_credential_intent + + attr_accessor :update_oauth2_credential_intent + + attr_accessor :delete_oauth2_credential_intent + + attr_accessor :oauth2_authenticate_intent + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -296,7 +310,14 @@ def self.attribute_map :'update_user_phone_number_intent' => :'updateUserPhoneNumberIntent', :'init_fiat_on_ramp_intent' => :'initFiatOnRampIntent', :'create_smart_contract_interface_intent' => :'createSmartContractInterfaceIntent', - :'delete_smart_contract_interface_intent' => :'deleteSmartContractInterfaceIntent' + :'delete_smart_contract_interface_intent' => :'deleteSmartContractInterfaceIntent', + :'enable_auth_proxy_intent' => :'enableAuthProxyIntent', + :'disable_auth_proxy_intent' => :'disableAuthProxyIntent', + :'update_auth_proxy_config_intent' => :'updateAuthProxyConfigIntent', + :'create_oauth2_credential_intent' => :'createOauth2CredentialIntent', + :'update_oauth2_credential_intent' => :'updateOauth2CredentialIntent', + :'delete_oauth2_credential_intent' => :'deleteOauth2CredentialIntent', + :'oauth2_authenticate_intent' => :'oauth2AuthenticateIntent' } end @@ -396,7 +417,14 @@ def self.openapi_types :'update_user_phone_number_intent' => :'Object', :'init_fiat_on_ramp_intent' => :'Object', :'create_smart_contract_interface_intent' => :'Object', - :'delete_smart_contract_interface_intent' => :'Object' + :'delete_smart_contract_interface_intent' => :'Object', + :'enable_auth_proxy_intent' => :'Object', + :'disable_auth_proxy_intent' => :'Object', + :'update_auth_proxy_config_intent' => :'Object', + :'create_oauth2_credential_intent' => :'Object', + :'update_oauth2_credential_intent' => :'Object', + :'delete_oauth2_credential_intent' => :'Object', + :'oauth2_authenticate_intent' => :'Object' } end @@ -796,6 +824,34 @@ def initialize(attributes = {}) if attributes.key?(:'delete_smart_contract_interface_intent') self.delete_smart_contract_interface_intent = attributes[:'delete_smart_contract_interface_intent'] end + + if attributes.key?(:'enable_auth_proxy_intent') + self.enable_auth_proxy_intent = attributes[:'enable_auth_proxy_intent'] + end + + if attributes.key?(:'disable_auth_proxy_intent') + self.disable_auth_proxy_intent = attributes[:'disable_auth_proxy_intent'] + end + + if attributes.key?(:'update_auth_proxy_config_intent') + self.update_auth_proxy_config_intent = attributes[:'update_auth_proxy_config_intent'] + end + + if attributes.key?(:'create_oauth2_credential_intent') + self.create_oauth2_credential_intent = attributes[:'create_oauth2_credential_intent'] + end + + if attributes.key?(:'update_oauth2_credential_intent') + self.update_oauth2_credential_intent = attributes[:'update_oauth2_credential_intent'] + end + + if attributes.key?(:'delete_oauth2_credential_intent') + self.delete_oauth2_credential_intent = attributes[:'delete_oauth2_credential_intent'] + end + + if attributes.key?(:'oauth2_authenticate_intent') + self.oauth2_authenticate_intent = attributes[:'oauth2_authenticate_intent'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -909,7 +965,14 @@ def ==(o) 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 + delete_smart_contract_interface_intent == o.delete_smart_contract_interface_intent && + enable_auth_proxy_intent == o.enable_auth_proxy_intent && + disable_auth_proxy_intent == o.disable_auth_proxy_intent && + update_auth_proxy_config_intent == o.update_auth_proxy_config_intent && + create_oauth2_credential_intent == o.create_oauth2_credential_intent && + update_oauth2_credential_intent == o.update_oauth2_credential_intent && + delete_oauth2_credential_intent == o.delete_oauth2_credential_intent && + oauth2_authenticate_intent == o.oauth2_authenticate_intent end # @see the `==` method @@ -921,7 +984,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, 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 + [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, enable_auth_proxy_intent, disable_auth_proxy_intent, update_auth_proxy_config_intent, create_oauth2_credential_intent, update_oauth2_credential_intent, delete_oauth2_credential_intent, oauth2_authenticate_intent].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/list_oauth2_credentials_request.rb b/turnkey_client/lib/turnkey_client/models/list_oauth2_credentials_request.rb new file mode 100644 index 0000000..d6b1cf9 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/list_oauth2_credentials_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 ListOauth2CredentialsRequest + # 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::ListOauth2CredentialsRequest` 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::ListOauth2CredentialsRequest`. 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/list_oauth2_credentials_response.rb b/turnkey_client/lib/turnkey_client/models/list_oauth2_credentials_response.rb new file mode 100644 index 0000000..9eb7f61 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/list_oauth2_credentials_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 ListOauth2CredentialsResponse + attr_accessor :oauth2_credentials + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'oauth2_credentials' => :'oauth2Credentials' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'oauth2_credentials' => :'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::ListOauth2CredentialsResponse` 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::ListOauth2CredentialsResponse`. 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?(:'oauth2_credentials') + if (value = attributes[:'oauth2_credentials']).is_a?(Array) + self.oauth2_credentials = 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 @oauth2_credentials.nil? + invalid_properties.push('invalid value for "oauth2_credentials", oauth2_credentials 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 @oauth2_credentials.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 && + oauth2_credentials == o.oauth2_credentials + 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 + [oauth2_credentials].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/oauth2_authenticate_intent.rb b/turnkey_client/lib/turnkey_client/models/oauth2_authenticate_intent.rb new file mode 100644 index 0000000..961efdf --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/oauth2_authenticate_intent.rb @@ -0,0 +1,278 @@ +=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 Oauth2AuthenticateIntent + # The OAuth 2.0 credential id whose client_id and client_secret will be used in the OAuth 2.0 flow + attr_accessor :oauth2_credential_id + + # The auth_code provided by the OAuth 2.0 provider to the end user to be exchanged for a Bearer token in the OAuth 2.0 flow + attr_accessor :auth_code + + # The URI the user is redirected to after they have authenticated with the OAuth 2.0 provider + attr_accessor :redirect_uri + + # The code verifier used by OAuth 2.0 PKCE providers + attr_accessor :code_verifier + + # An optional nonce used by the client to prevent replay/substitution of an ID token + attr_accessor :nonce + + # An optional P256 public key to which, if provided, the bearer token will be encrypted and returned via the `encrypted_bearer_token` claim of the OIDC Token + attr_accessor :bearer_token_target_public_key + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'oauth2_credential_id' => :'oauth2CredentialId', + :'auth_code' => :'authCode', + :'redirect_uri' => :'redirectUri', + :'code_verifier' => :'codeVerifier', + :'nonce' => :'nonce', + :'bearer_token_target_public_key' => :'bearerTokenTargetPublicKey' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'oauth2_credential_id' => :'Object', + :'auth_code' => :'Object', + :'redirect_uri' => :'Object', + :'code_verifier' => :'Object', + :'nonce' => :'Object', + :'bearer_token_target_public_key' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'nonce', + :'bearer_token_target_public_key' + ]) + 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::Oauth2AuthenticateIntent` 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::Oauth2AuthenticateIntent`. 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?(:'oauth2_credential_id') + self.oauth2_credential_id = attributes[:'oauth2_credential_id'] + end + + if attributes.key?(:'auth_code') + self.auth_code = attributes[:'auth_code'] + end + + if attributes.key?(:'redirect_uri') + self.redirect_uri = attributes[:'redirect_uri'] + end + + if attributes.key?(:'code_verifier') + self.code_verifier = attributes[:'code_verifier'] + end + + if attributes.key?(:'nonce') + self.nonce = attributes[:'nonce'] + end + + if attributes.key?(:'bearer_token_target_public_key') + self.bearer_token_target_public_key = attributes[:'bearer_token_target_public_key'] + 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 @oauth2_credential_id.nil? + invalid_properties.push('invalid value for "oauth2_credential_id", oauth2_credential_id cannot be nil.') + end + + if @auth_code.nil? + invalid_properties.push('invalid value for "auth_code", auth_code cannot be nil.') + end + + if @redirect_uri.nil? + invalid_properties.push('invalid value for "redirect_uri", redirect_uri cannot be nil.') + end + + if @code_verifier.nil? + invalid_properties.push('invalid value for "code_verifier", code_verifier 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 @oauth2_credential_id.nil? + return false if @auth_code.nil? + return false if @redirect_uri.nil? + return false if @code_verifier.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 && + oauth2_credential_id == o.oauth2_credential_id && + auth_code == o.auth_code && + redirect_uri == o.redirect_uri && + code_verifier == o.code_verifier && + nonce == o.nonce && + bearer_token_target_public_key == o.bearer_token_target_public_key + 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 + [oauth2_credential_id, auth_code, redirect_uri, code_verifier, nonce, bearer_token_target_public_key].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/oauth2_authenticate_request.rb b/turnkey_client/lib/turnkey_client/models/oauth2_authenticate_request.rb new file mode 100644 index 0000000..4eff5e9 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/oauth2_authenticate_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 Oauth2AuthenticateRequest + 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::Oauth2AuthenticateRequest` 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::Oauth2AuthenticateRequest`. 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_OAUTH2_AUTHENTICATE']) + 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_OAUTH2_AUTHENTICATE']) + 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/oauth2_authenticate_result.rb b/turnkey_client/lib/turnkey_client/models/oauth2_authenticate_result.rb new file mode 100644 index 0000000..3478e6e --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/oauth2_authenticate_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 Oauth2AuthenticateResult + # Base64 encoded OIDC token issued by Turnkey to be used with the LoginWithOAuth activity + attr_accessor :oidc_token + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'oidc_token' => :'oidcToken' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'oidc_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::Oauth2AuthenticateResult` 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::Oauth2AuthenticateResult`. 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 + 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 + + 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? + 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 + 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].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/oauth2_credential.rb b/turnkey_client/lib/turnkey_client/models/oauth2_credential.rb new file mode 100644 index 0000000..7d0a457 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/oauth2_credential.rb @@ -0,0 +1,298 @@ +=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 Oauth2Credential + # Unique identifier for a given OAuth 2.0 Credential. + attr_accessor :oauth2_credential_id + + # Unique identifier for an Organization. + attr_accessor :organization_id + + attr_accessor :provider + + # The client id for a given OAuth 2.0 Credential. + attr_accessor :client_id + + # The encrypted client secret for a given OAuth 2.0 Credential encrypted to the TLS Fetcher quorum key. + attr_accessor :encrypted_client_secret + + attr_accessor :created_at + + attr_accessor :updated_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'oauth2_credential_id' => :'oauth2CredentialId', + :'organization_id' => :'organizationId', + :'provider' => :'provider', + :'client_id' => :'clientId', + :'encrypted_client_secret' => :'encryptedClientSecret', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'oauth2_credential_id' => :'Object', + :'organization_id' => :'Object', + :'provider' => :'Object', + :'client_id' => :'Object', + :'encrypted_client_secret' => :'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::Oauth2Credential` 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::Oauth2Credential`. 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?(:'oauth2_credential_id') + self.oauth2_credential_id = attributes[:'oauth2_credential_id'] + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'provider') + self.provider = attributes[:'provider'] + end + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'encrypted_client_secret') + self.encrypted_client_secret = attributes[:'encrypted_client_secret'] + 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 @oauth2_credential_id.nil? + invalid_properties.push('invalid value for "oauth2_credential_id", oauth2_credential_id cannot be nil.') + end + + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @provider.nil? + invalid_properties.push('invalid value for "provider", provider cannot be nil.') + end + + if @client_id.nil? + invalid_properties.push('invalid value for "client_id", client_id cannot be nil.') + end + + if @encrypted_client_secret.nil? + invalid_properties.push('invalid value for "encrypted_client_secret", encrypted_client_secret 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 @oauth2_credential_id.nil? + return false if @organization_id.nil? + return false if @provider.nil? + return false if @client_id.nil? + return false if @encrypted_client_secret.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 && + oauth2_credential_id == o.oauth2_credential_id && + organization_id == o.organization_id && + provider == o.provider && + client_id == o.client_id && + encrypted_client_secret == o.encrypted_client_secret && + 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 + [oauth2_credential_id, organization_id, provider, client_id, encrypted_client_secret, 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/oauth2_provider.rb b/turnkey_client/lib/turnkey_client/models/oauth2_provider.rb new file mode 100644 index 0000000..684aa16 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/oauth2_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 Oauth2Provider + X = 'OAUTH2_PROVIDER_X'.freeze + DISCORD = 'OAUTH2_PROVIDER_DISCORD'.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 = Oauth2Provider.constants.select { |c| Oauth2Provider::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #Oauth2Provider" if constantValues.empty? + value + end + end +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 index 7565ddf..9515fea 100644 --- a/turnkey_client/lib/turnkey_client/models/otp_login_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/otp_login_intent.rb @@ -24,13 +24,17 @@ class OtpLoginIntent # Invalidate all other previously generated Login API keys attr_accessor :invalidate_existing + # Optional signature associated with the public key passed into the verification step. This must be a hex-encoded ECDSA signature over the verification token. Only required if a public key was provided during the verification step. + attr_accessor :client_signature + # 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' + :'invalidate_existing' => :'invalidateExisting', + :'client_signature' => :'clientSignature' } end @@ -40,7 +44,8 @@ def self.openapi_types :'verification_token' => :'Object', :'public_key' => :'Object', :'expiration_seconds' => :'Object', - :'invalidate_existing' => :'Object' + :'invalidate_existing' => :'Object', + :'client_signature' => :'Object' } end @@ -48,7 +53,8 @@ def self.openapi_types def self.openapi_nullable Set.new([ :'expiration_seconds', - :'invalidate_existing' + :'invalidate_existing', + :'client_signature' ]) end @@ -82,6 +88,10 @@ def initialize(attributes = {}) if attributes.key?(:'invalidate_existing') self.invalidate_existing = attributes[:'invalidate_existing'] end + + if attributes.key?(:'client_signature') + self.client_signature = attributes[:'client_signature'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -115,7 +125,8 @@ def ==(o) verification_token == o.verification_token && public_key == o.public_key && expiration_seconds == o.expiration_seconds && - invalidate_existing == o.invalidate_existing + invalidate_existing == o.invalidate_existing && + client_signature == o.client_signature end # @see the `==` method @@ -127,7 +138,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [verification_token, public_key, expiration_seconds, invalidate_existing].hash + [verification_token, public_key, expiration_seconds, invalidate_existing, client_signature].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/payload_encoding.rb b/turnkey_client/lib/turnkey_client/models/payload_encoding.rb index 645339a..daf54f3 100644 --- a/turnkey_client/lib/turnkey_client/models/payload_encoding.rb +++ b/turnkey_client/lib/turnkey_client/models/payload_encoding.rb @@ -15,6 +15,7 @@ class PayloadEncoding HEXADECIMAL = 'PAYLOAD_ENCODING_HEXADECIMAL'.freeze TEXT_UTF8 = 'PAYLOAD_ENCODING_TEXT_UTF8'.freeze EIP712 = 'PAYLOAD_ENCODING_EIP712'.freeze + EIP7702_AUTHORIZATION = 'PAYLOAD_ENCODING_EIP7702_AUTHORIZATION'.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/result.rb b/turnkey_client/lib/turnkey_client/models/result.rb index 3246e5b..b0f76c5 100644 --- a/turnkey_client/lib/turnkey_client/models/result.rb +++ b/turnkey_client/lib/turnkey_client/models/result.rb @@ -170,6 +170,20 @@ class Result attr_accessor :delete_smart_contract_interface_result + attr_accessor :enable_auth_proxy_result + + attr_accessor :disable_auth_proxy_result + + attr_accessor :update_auth_proxy_config_result + + attr_accessor :create_oauth2_credential_result + + attr_accessor :update_oauth2_credential_result + + attr_accessor :delete_oauth2_credential_result + + attr_accessor :oauth2_authenticate_result + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -251,7 +265,14 @@ def self.attribute_map :'update_user_phone_number_result' => :'updateUserPhoneNumberResult', :'init_fiat_on_ramp_result' => :'initFiatOnRampResult', :'create_smart_contract_interface_result' => :'createSmartContractInterfaceResult', - :'delete_smart_contract_interface_result' => :'deleteSmartContractInterfaceResult' + :'delete_smart_contract_interface_result' => :'deleteSmartContractInterfaceResult', + :'enable_auth_proxy_result' => :'enableAuthProxyResult', + :'disable_auth_proxy_result' => :'disableAuthProxyResult', + :'update_auth_proxy_config_result' => :'updateAuthProxyConfigResult', + :'create_oauth2_credential_result' => :'createOauth2CredentialResult', + :'update_oauth2_credential_result' => :'updateOauth2CredentialResult', + :'delete_oauth2_credential_result' => :'deleteOauth2CredentialResult', + :'oauth2_authenticate_result' => :'oauth2AuthenticateResult' } end @@ -336,7 +357,14 @@ def self.openapi_types :'update_user_phone_number_result' => :'Object', :'init_fiat_on_ramp_result' => :'Object', :'create_smart_contract_interface_result' => :'Object', - :'delete_smart_contract_interface_result' => :'Object' + :'delete_smart_contract_interface_result' => :'Object', + :'enable_auth_proxy_result' => :'Object', + :'disable_auth_proxy_result' => :'Object', + :'update_auth_proxy_config_result' => :'Object', + :'create_oauth2_credential_result' => :'Object', + :'update_oauth2_credential_result' => :'Object', + :'delete_oauth2_credential_result' => :'Object', + :'oauth2_authenticate_result' => :'Object' } end @@ -676,6 +704,34 @@ def initialize(attributes = {}) if attributes.key?(:'delete_smart_contract_interface_result') self.delete_smart_contract_interface_result = attributes[:'delete_smart_contract_interface_result'] end + + if attributes.key?(:'enable_auth_proxy_result') + self.enable_auth_proxy_result = attributes[:'enable_auth_proxy_result'] + end + + if attributes.key?(:'disable_auth_proxy_result') + self.disable_auth_proxy_result = attributes[:'disable_auth_proxy_result'] + end + + if attributes.key?(:'update_auth_proxy_config_result') + self.update_auth_proxy_config_result = attributes[:'update_auth_proxy_config_result'] + end + + if attributes.key?(:'create_oauth2_credential_result') + self.create_oauth2_credential_result = attributes[:'create_oauth2_credential_result'] + end + + if attributes.key?(:'update_oauth2_credential_result') + self.update_oauth2_credential_result = attributes[:'update_oauth2_credential_result'] + end + + if attributes.key?(:'delete_oauth2_credential_result') + self.delete_oauth2_credential_result = attributes[:'delete_oauth2_credential_result'] + end + + if attributes.key?(:'oauth2_authenticate_result') + self.oauth2_authenticate_result = attributes[:'oauth2_authenticate_result'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -774,7 +830,14 @@ def ==(o) 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 + delete_smart_contract_interface_result == o.delete_smart_contract_interface_result && + enable_auth_proxy_result == o.enable_auth_proxy_result && + disable_auth_proxy_result == o.disable_auth_proxy_result && + update_auth_proxy_config_result == o.update_auth_proxy_config_result && + create_oauth2_credential_result == o.create_oauth2_credential_result && + update_oauth2_credential_result == o.update_oauth2_credential_result && + delete_oauth2_credential_result == o.delete_oauth2_credential_result && + oauth2_authenticate_result == o.oauth2_authenticate_result end # @see the `==` method @@ -786,7 +849,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, 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 + [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, enable_auth_proxy_result, disable_auth_proxy_result, update_auth_proxy_config_result, create_oauth2_credential_result, update_oauth2_credential_result, delete_oauth2_credential_result, oauth2_authenticate_result].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/signature_scheme.rb b/turnkey_client/lib/turnkey_client/models/signature_scheme.rb new file mode 100644 index 0000000..50cf9ab --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/signature_scheme.rb @@ -0,0 +1,26 @@ +=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 SignatureScheme + SIGNATURE_SCHEME_EPHEMERAL_KEY_P256 = 'SIGNATURE_SCHEME_EPHEMERAL_KEY_P256'.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 = SignatureScheme.constants.select { |c| SignatureScheme::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #SignatureScheme" if constantValues.empty? + value + end + end +end diff --git a/turnkey_client/lib/turnkey_client/models/smart_contract_interface.rb b/turnkey_client/lib/turnkey_client/models/smart_contract_interface.rb new file mode 100644 index 0000000..22525e6 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/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 SmartContractInterface + # 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::SmartContractInterface` 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::SmartContractInterface`. 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/update_auth_proxy_config_intent.rb b/turnkey_client/lib/turnkey_client/models/update_auth_proxy_config_intent.rb new file mode 100644 index 0000000..aae5f16 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_auth_proxy_config_intent.rb @@ -0,0 +1,346 @@ +=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 UpdateAuthProxyConfigIntent + # Updated list of allowed origins for CORS. + attr_accessor :allowed_origins + + # Updated list of allowed proxy authentication methods. + attr_accessor :allowed_auth_methods + + # Custom 'from' address for auth-related emails. + attr_accessor :send_from_email_address + + # Custom reply-to address for auth-related emails. + attr_accessor :reply_to_email_address + + # Template ID for email-auth messages. + attr_accessor :email_auth_template_id + + # Template ID for OTP SMS messages. + attr_accessor :otp_template_id + + attr_accessor :email_customization_params + + attr_accessor :sms_customization_params + + attr_accessor :wallet_kit_settings + + # OTP code lifetime in seconds. + attr_accessor :otp_expiration_seconds + + # Verification-token lifetime in seconds. + attr_accessor :verification_token_expiration_seconds + + # Session lifetime in seconds. + attr_accessor :session_expiration_seconds + + # Enable alphanumeric OTP codes. + attr_accessor :otp_alphanumeric + + # Desired OTP code length (6–9). + attr_accessor :otp_length + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'allowed_origins' => :'allowedOrigins', + :'allowed_auth_methods' => :'allowedAuthMethods', + :'send_from_email_address' => :'sendFromEmailAddress', + :'reply_to_email_address' => :'replyToEmailAddress', + :'email_auth_template_id' => :'emailAuthTemplateId', + :'otp_template_id' => :'otpTemplateId', + :'email_customization_params' => :'emailCustomizationParams', + :'sms_customization_params' => :'smsCustomizationParams', + :'wallet_kit_settings' => :'walletKitSettings', + :'otp_expiration_seconds' => :'otpExpirationSeconds', + :'verification_token_expiration_seconds' => :'verificationTokenExpirationSeconds', + :'session_expiration_seconds' => :'sessionExpirationSeconds', + :'otp_alphanumeric' => :'otpAlphanumeric', + :'otp_length' => :'otpLength' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'allowed_origins' => :'Object', + :'allowed_auth_methods' => :'Object', + :'send_from_email_address' => :'Object', + :'reply_to_email_address' => :'Object', + :'email_auth_template_id' => :'Object', + :'otp_template_id' => :'Object', + :'email_customization_params' => :'Object', + :'sms_customization_params' => :'Object', + :'wallet_kit_settings' => :'Object', + :'otp_expiration_seconds' => :'Object', + :'verification_token_expiration_seconds' => :'Object', + :'session_expiration_seconds' => :'Object', + :'otp_alphanumeric' => :'Object', + :'otp_length' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'send_from_email_address', + :'reply_to_email_address', + :'email_auth_template_id', + :'otp_template_id', + :'otp_expiration_seconds', + :'verification_token_expiration_seconds', + :'session_expiration_seconds', + :'otp_alphanumeric', + :'otp_length' + ]) + 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::UpdateAuthProxyConfigIntent` 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::UpdateAuthProxyConfigIntent`. 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?(:'allowed_origins') + if (value = attributes[:'allowed_origins']).is_a?(Array) + self.allowed_origins = value + end + end + + if attributes.key?(:'allowed_auth_methods') + if (value = attributes[:'allowed_auth_methods']).is_a?(Array) + self.allowed_auth_methods = value + end + end + + if attributes.key?(:'send_from_email_address') + self.send_from_email_address = attributes[:'send_from_email_address'] + end + + if attributes.key?(:'reply_to_email_address') + self.reply_to_email_address = attributes[:'reply_to_email_address'] + end + + if attributes.key?(:'email_auth_template_id') + self.email_auth_template_id = attributes[:'email_auth_template_id'] + end + + if attributes.key?(:'otp_template_id') + self.otp_template_id = attributes[:'otp_template_id'] + end + + if attributes.key?(:'email_customization_params') + self.email_customization_params = attributes[:'email_customization_params'] + end + + if attributes.key?(:'sms_customization_params') + self.sms_customization_params = attributes[:'sms_customization_params'] + end + + if attributes.key?(:'wallet_kit_settings') + self.wallet_kit_settings = attributes[:'wallet_kit_settings'] + end + + if attributes.key?(:'otp_expiration_seconds') + self.otp_expiration_seconds = attributes[:'otp_expiration_seconds'] + end + + if attributes.key?(:'verification_token_expiration_seconds') + self.verification_token_expiration_seconds = attributes[:'verification_token_expiration_seconds'] + end + + if attributes.key?(:'session_expiration_seconds') + self.session_expiration_seconds = attributes[:'session_expiration_seconds'] + end + + if attributes.key?(:'otp_alphanumeric') + self.otp_alphanumeric = attributes[:'otp_alphanumeric'] + end + + if attributes.key?(:'otp_length') + self.otp_length = attributes[:'otp_length'] + 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 && + allowed_origins == o.allowed_origins && + allowed_auth_methods == o.allowed_auth_methods && + send_from_email_address == o.send_from_email_address && + reply_to_email_address == o.reply_to_email_address && + email_auth_template_id == o.email_auth_template_id && + otp_template_id == o.otp_template_id && + email_customization_params == o.email_customization_params && + sms_customization_params == o.sms_customization_params && + wallet_kit_settings == o.wallet_kit_settings && + otp_expiration_seconds == o.otp_expiration_seconds && + verification_token_expiration_seconds == o.verification_token_expiration_seconds && + session_expiration_seconds == o.session_expiration_seconds && + otp_alphanumeric == o.otp_alphanumeric && + otp_length == o.otp_length + 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 + [allowed_origins, allowed_auth_methods, send_from_email_address, reply_to_email_address, email_auth_template_id, otp_template_id, email_customization_params, sms_customization_params, wallet_kit_settings, otp_expiration_seconds, verification_token_expiration_seconds, session_expiration_seconds, otp_alphanumeric, otp_length].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_auth_proxy_config_result.rb b/turnkey_client/lib/turnkey_client/models/update_auth_proxy_config_result.rb new file mode 100644 index 0000000..ae31f28 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_auth_proxy_config_result.rb @@ -0,0 +1,206 @@ +=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 UpdateAuthProxyConfigResult + # Unique identifier for a given User. (representing the turnkey signer user id) + attr_accessor :config_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'config_id' => :'configId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'config_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::UpdateAuthProxyConfigResult` 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::UpdateAuthProxyConfigResult`. 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?(:'config_id') + self.config_id = attributes[:'config_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 + 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 && + config_id == o.config_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 + [config_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_oauth2_credential_intent.rb b/turnkey_client/lib/turnkey_client/models/update_oauth2_credential_intent.rb new file mode 100644 index 0000000..9f29e5c --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_oauth2_credential_intent.rb @@ -0,0 +1,255 @@ +=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 UpdateOauth2CredentialIntent + # The ID of the OAuth 2.0 credential to update + attr_accessor :oauth2_credential_id + + attr_accessor :provider + + # The Client ID issued by the OAuth 2.0 provider + attr_accessor :client_id + + # The client secret issued by the OAuth 2.0 provider encrypted to the TLS Fetcher quorum key + attr_accessor :encrypted_client_secret + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'oauth2_credential_id' => :'oauth2CredentialId', + :'provider' => :'provider', + :'client_id' => :'clientId', + :'encrypted_client_secret' => :'encryptedClientSecret' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'oauth2_credential_id' => :'Object', + :'provider' => :'Object', + :'client_id' => :'Object', + :'encrypted_client_secret' => :'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::UpdateOauth2CredentialIntent` 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::UpdateOauth2CredentialIntent`. 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?(:'oauth2_credential_id') + self.oauth2_credential_id = attributes[:'oauth2_credential_id'] + end + + if attributes.key?(:'provider') + self.provider = attributes[:'provider'] + end + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'encrypted_client_secret') + self.encrypted_client_secret = attributes[:'encrypted_client_secret'] + 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 @oauth2_credential_id.nil? + invalid_properties.push('invalid value for "oauth2_credential_id", oauth2_credential_id cannot be nil.') + end + + if @provider.nil? + invalid_properties.push('invalid value for "provider", provider cannot be nil.') + end + + if @client_id.nil? + invalid_properties.push('invalid value for "client_id", client_id cannot be nil.') + end + + if @encrypted_client_secret.nil? + invalid_properties.push('invalid value for "encrypted_client_secret", encrypted_client_secret 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 @oauth2_credential_id.nil? + return false if @provider.nil? + return false if @client_id.nil? + return false if @encrypted_client_secret.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 && + oauth2_credential_id == o.oauth2_credential_id && + provider == o.provider && + client_id == o.client_id && + encrypted_client_secret == o.encrypted_client_secret + 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 + [oauth2_credential_id, provider, client_id, encrypted_client_secret].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_oauth2_credential_request.rb b/turnkey_client/lib/turnkey_client/models/update_oauth2_credential_request.rb new file mode 100644 index 0000000..54796a3 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_oauth2_credential_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 UpdateOauth2CredentialRequest + 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::UpdateOauth2CredentialRequest` 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::UpdateOauth2CredentialRequest`. 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_OAUTH2_CREDENTIAL']) + 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_OAUTH2_CREDENTIAL']) + 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_oauth2_credential_result.rb b/turnkey_client/lib/turnkey_client/models/update_oauth2_credential_result.rb new file mode 100644 index 0000000..102d1bd --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_oauth2_credential_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 UpdateOauth2CredentialResult + # Unique identifier of the OAuth 2.0 credential that was updated + attr_accessor :oauth2_credential_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'oauth2_credential_id' => :'oauth2CredentialId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'oauth2_credential_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::UpdateOauth2CredentialResult` 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::UpdateOauth2CredentialResult`. 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?(:'oauth2_credential_id') + self.oauth2_credential_id = attributes[:'oauth2_credential_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 @oauth2_credential_id.nil? + invalid_properties.push('invalid value for "oauth2_credential_id", oauth2_credential_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 @oauth2_credential_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 && + oauth2_credential_id == o.oauth2_credential_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 + [oauth2_credential_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/verify_otp_intent.rb b/turnkey_client/lib/turnkey_client/models/verify_otp_intent.rb index 2243430..76ce460 100644 --- a/turnkey_client/lib/turnkey_client/models/verify_otp_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/verify_otp_intent.rb @@ -21,12 +21,16 @@ class VerifyOtpIntent # 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 + # Client-side public key generated by the user, which will be added to the JWT response and verified in subsequent requests via a client proof signature + attr_accessor :public_key + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'otp_id' => :'otpId', :'otp_code' => :'otpCode', - :'expiration_seconds' => :'expirationSeconds' + :'expiration_seconds' => :'expirationSeconds', + :'public_key' => :'publicKey' } end @@ -35,14 +39,16 @@ def self.openapi_types { :'otp_id' => :'Object', :'otp_code' => :'Object', - :'expiration_seconds' => :'Object' + :'expiration_seconds' => :'Object', + :'public_key' => :'Object' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'expiration_seconds' + :'expiration_seconds', + :'public_key' ]) end @@ -72,6 +78,10 @@ def initialize(attributes = {}) if attributes.key?(:'expiration_seconds') self.expiration_seconds = attributes[:'expiration_seconds'] 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? @@ -104,7 +114,8 @@ def ==(o) self.class == o.class && otp_id == o.otp_id && otp_code == o.otp_code && - expiration_seconds == o.expiration_seconds + expiration_seconds == o.expiration_seconds && + public_key == o.public_key end # @see the `==` method @@ -116,7 +127,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [otp_id, otp_code, expiration_seconds].hash + [otp_id, otp_code, expiration_seconds, public_key].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/wallet_account.rb b/turnkey_client/lib/turnkey_client/models/wallet_account.rb index f9a3ad7..80f6df2 100644 --- a/turnkey_client/lib/turnkey_client/models/wallet_account.rb +++ b/turnkey_client/lib/turnkey_client/models/wallet_account.rb @@ -40,6 +40,8 @@ class WalletAccount # The public component of this wallet account's underlying cryptographic key pair. attr_accessor :public_key + attr_accessor :wallet_details + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -53,7 +55,8 @@ def self.attribute_map :'address' => :'address', :'created_at' => :'createdAt', :'updated_at' => :'updatedAt', - :'public_key' => :'publicKey' + :'public_key' => :'publicKey', + :'wallet_details' => :'walletDetails' } end @@ -70,14 +73,15 @@ def self.openapi_types :'address' => :'Object', :'created_at' => :'Object', :'updated_at' => :'Object', - :'public_key' => :'Object' + :'public_key' => :'Object', + :'wallet_details' => :'Object' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'public_key' + :'public_key', ]) end @@ -139,6 +143,10 @@ def initialize(attributes = {}) if attributes.key?(:'public_key') self.public_key = attributes[:'public_key'] end + + if attributes.key?(:'wallet_details') + self.wallet_details = attributes[:'wallet_details'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -219,7 +227,8 @@ def ==(o) address == o.address && created_at == o.created_at && updated_at == o.updated_at && - public_key == o.public_key + public_key == o.public_key && + wallet_details == o.wallet_details end # @see the `==` method @@ -231,7 +240,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, public_key].hash + [wallet_account_id, organization_id, wallet_id, curve, path_format, path, address_format, address, created_at, updated_at, public_key, wallet_details].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/wallet_kit_settings_params.rb b/turnkey_client/lib/turnkey_client/models/wallet_kit_settings_params.rb new file mode 100644 index 0000000..beb648f --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/wallet_kit_settings_params.rb @@ -0,0 +1,230 @@ +=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 WalletKitSettingsParams + # List of enabled social login providers (e.g., 'apple', 'google', 'facebook') + attr_accessor :enabled_social_providers + + # Mapping of social login providers to their Oauth client IDs. + attr_accessor :oauth_client_ids + + # Oauth redirect URL to be used for social login flows. + attr_accessor :oauth_redirect_url + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'enabled_social_providers' => :'enabledSocialProviders', + :'oauth_client_ids' => :'oauthClientIds', + :'oauth_redirect_url' => :'oauthRedirectUrl' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'enabled_social_providers' => :'Object', + :'oauth_client_ids' => :'Object', + :'oauth_redirect_url' => :'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::WalletKitSettingsParams` 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::WalletKitSettingsParams`. 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?(:'enabled_social_providers') + if (value = attributes[:'enabled_social_providers']).is_a?(Array) + self.enabled_social_providers = value + end + end + + if attributes.key?(:'oauth_client_ids') + if (value = attributes[:'oauth_client_ids']).is_a?(Hash) + self.oauth_client_ids = value + end + end + + if attributes.key?(:'oauth_redirect_url') + self.oauth_redirect_url = attributes[:'oauth_redirect_url'] + 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 && + enabled_social_providers == o.enabled_social_providers && + oauth_client_ids == o.oauth_client_ids && + oauth_redirect_url == o.oauth_redirect_url + 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 + [enabled_social_providers, oauth_client_ids, oauth_redirect_url].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/version.rb b/turnkey_client/lib/turnkey_client/version.rb index 4a01e5b..6aa3715 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.14' + VERSION = '0.0.15' end diff --git a/turnkey_client_inputs/config.json b/turnkey_client_inputs/config.json index 00e6f31..b0a3f4e 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.14" + "gemVersion": "0.0.15" } diff --git a/turnkey_client_inputs/public_api.swagger.json b/turnkey_client_inputs/public_api.swagger.json index 6021d37..5b643fa 100644 --- a/turnkey_client_inputs/public_api.swagger.json +++ b/turnkey_client_inputs/public_api.swagger.json @@ -195,6 +195,83 @@ "tags": ["Authenticators"] } }, + "/public/v1/query/get_boot_proof": { + "post": { + "summary": "Get a specific boot proof", + "description": "Get the boot proof for a given ephemeral key.", + "operationId": "GetBootProof", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/BootProofResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GetBootProofRequest" + } + } + ], + "tags": ["Boot Proof"] + } + }, + "/public/v1/query/get_latest_boot_proof": { + "post": { + "summary": "Get the latest boot proof for an app", + "description": "Get the latest boot proof for a given enclave app name.", + "operationId": "GetLatestBootProof", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/BootProofResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GetLatestBootProofRequest" + } + } + ], + "tags": ["Boot Proof"] + } + }, + "/public/v1/query/get_oauth2_credential": { + "post": { + "summary": "Get OAuth 2.0 credential", + "description": "Get details about an OAuth 2.0 credential.", + "operationId": "GetOauth2Credential", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetOauth2CredentialResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GetOauth2CredentialRequest" + } + } + ] + } + }, "/public/v1/query/get_oauth_providers": { "post": { "summary": "Get Oauth providers", @@ -455,6 +532,58 @@ "tags": ["Activities"] } }, + "/public/v1/query/list_app_proofs": { + "post": { + "summary": "List app proofs for an activity", + "description": "List the app proofs for the given activity.", + "operationId": "GetAppProofs", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetAppProofsResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GetAppProofsRequest" + } + } + ], + "tags": ["App Proof"] + } + }, + "/public/v1/query/list_oauth2_credentials": { + "post": { + "summary": "List OAuth 2.0 Credentials", + "description": "List all OAuth 2.0 credentials within an organization.", + "operationId": "ListOauth2Credentials", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ListOauth2CredentialsResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ListOauth2CredentialsRequest" + } + } + ], + "tags": ["User Auth"] + } + }, "/public/v1/query/list_policies": { "post": { "summary": "List policies", @@ -845,6 +974,32 @@ "tags": ["Invitations"] } }, + "/public/v1/submit/create_oauth2_credential": { + "post": { + "summary": "Create an OAuth 2.0 Credential", + "description": "Enable authentication for end users with an OAuth 2.0 provider", + "operationId": "CreateOauth2Credential", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOauth2CredentialRequest" + } + } + ], + "tags": ["User Auth"] + } + }, "/public/v1/submit/create_oauth_providers": { "post": { "summary": "Create Oauth providers", @@ -1261,6 +1416,32 @@ "tags": ["Invitations"] } }, + "/public/v1/submit/delete_oauth2_credential": { + "post": { + "summary": "Delete an OAuth 2.0 Credential", + "description": "Disable authentication for end users with an OAuth 2.0 provider", + "operationId": "DeleteOauth2Credential", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteOauth2CredentialRequest" + } + } + ], + "tags": ["User Auth"] + } + }, "/public/v1/submit/delete_oauth_providers": { "post": { "summary": "Delete Oauth providers", @@ -1833,6 +2014,32 @@ "tags": ["User Auth"] } }, + "/public/v1/submit/oauth2_authenticate": { + "post": { + "summary": "OAuth 2.0 authentication", + "description": "Authenticate a user with an OAuth 2.0 provider and receive an OIDC token to use with the LoginWithOAuth or CreateSubOrganization activities", + "operationId": "Oauth2Authenticate", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Oauth2AuthenticateRequest" + } + } + ], + "tags": ["User Auth"] + } + }, "/public/v1/submit/oauth_login": { "post": { "summary": "Login with Oauth", @@ -2119,6 +2326,32 @@ "tags": ["Sessions"] } }, + "/public/v1/submit/update_oauth2_credential": { + "post": { + "summary": "Update an OAuth 2.0 Credential", + "description": "Update an OAuth 2.0 provider credential", + "operationId": "UpdateOauth2Credential", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOauth2CredentialRequest" + } + } + ], + "tags": ["User Auth"] + } + }, "/public/v1/submit/update_policy": { "post": { "summary": "Update policy", @@ -2490,6 +2723,14 @@ }, "description": "A list of objects representing a particular User's approval or rejection of a Consensus request, including all relevant metadata." }, + "appProofs": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/AppProof" + }, + "description": "A list of app proofs generated by enclaves during activity execution, providing verifiable attestations of performed operations." + }, "fingerprint": { "type": "string", "description": "An artifact verifying a User's action." @@ -2643,7 +2884,14 @@ "ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER", "ACTIVITY_TYPE_INIT_FIAT_ON_RAMP", "ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE", - "ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE" + "ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE", + "ACTIVITY_TYPE_ENABLE_AUTH_PROXY", + "ACTIVITY_TYPE_DISABLE_AUTH_PROXY", + "ACTIVITY_TYPE_UPDATE_AUTH_PROXY_CONFIG", + "ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL", + "ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL", + "ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL", + "ACTIVITY_TYPE_OAUTH2_AUTHENTICATE" ] }, "AddressFormat": { @@ -2812,6 +3060,28 @@ }, "required": ["userName", "userTags", "apiKeys"] }, + "AppProof": { + "type": "object", + "properties": { + "scheme": { + "$ref": "#/definitions/SignatureScheme", + "description": "Scheme of signing key." + }, + "publicKey": { + "type": "string", + "description": "Ephemeral public key." + }, + "proofPayload": { + "type": "string", + "description": "JSON serialized AppProofPayload." + }, + "signature": { + "type": "string", + "description": "Signature over hashed proof_payload." + } + }, + "required": ["scheme", "publicKey", "proofPayload", "signature"] + }, "ApproveActivityIntent": { "type": "object", "properties": { @@ -3002,6 +3272,61 @@ "AUTHENTICATOR_TRANSPORT_HYBRID" ] }, + "BootProof": { + "type": "object", + "properties": { + "ephemeralPublicKeyHex": { + "type": "string", + "description": "The hex encoded Ephemeral Public Key." + }, + "awsAttestationDocB64": { + "type": "string", + "description": "The DER encoded COSE Sign1 struct Attestation doc." + }, + "qosManifestB64": { + "type": "string", + "description": "The borsch serialized base64 encoded Manifest." + }, + "qosManifestEnvelopeB64": { + "type": "string", + "description": "The borsch serialized base64 encoded Manifest Envelope." + }, + "deploymentLabel": { + "type": "string", + "description": "The label under which the enclave app was deployed." + }, + "enclaveApp": { + "type": "string", + "description": "Name of the enclave app" + }, + "owner": { + "type": "string", + "description": "Owner of the app i.e. 'tkhq'" + }, + "createdAt": { + "$ref": "#/definitions/external.data.v1.Timestamp" + } + }, + "required": [ + "ephemeralPublicKeyHex", + "awsAttestationDocB64", + "qosManifestB64", + "qosManifestEnvelopeB64", + "deploymentLabel", + "enclaveApp", + "owner", + "createdAt" + ] + }, + "BootProofResponse": { + "type": "object", + "properties": { + "bootProof": { + "$ref": "#/definitions/BootProof" + } + }, + "required": ["bootProof"] + }, "Config": { "type": "object", "properties": { @@ -3232,30 +3557,30 @@ }, "required": ["invitationIds"] }, - "CreateOauthProvidersIntent": { + "CreateOauth2CredentialIntent": { "type": "object", "properties": { - "userId": { + "provider": { + "$ref": "#/definitions/Oauth2Provider", + "description": "The OAuth 2.0 provider" + }, + "clientId": { "type": "string", - "description": "The ID of the User to add an Oauth provider to" + "description": "The Client ID issued by the OAuth 2.0 provider" }, - "oauthProviders": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/OauthProviderParams" - }, - "description": "A list of Oauth providers." + "encryptedClientSecret": { + "type": "string", + "description": "The client secret issued by the OAuth 2.0 provider encrypted to the TLS Fetcher quorum key" } }, - "required": ["userId", "oauthProviders"] + "required": ["provider", "clientId", "encryptedClientSecret"] }, - "CreateOauthProvidersRequest": { + "CreateOauth2CredentialRequest": { "type": "object", "properties": { "type": { "type": "string", - "enum": ["ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS"] + "enum": ["ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL"] }, "timestampMs": { "type": "string", @@ -3266,28 +3591,77 @@ "description": "Unique identifier for a given Organization." }, "parameters": { - "$ref": "#/definitions/CreateOauthProvidersIntent" + "$ref": "#/definitions/CreateOauth2CredentialIntent" } }, "required": ["type", "timestampMs", "organizationId", "parameters"] }, - "CreateOauthProvidersResult": { + "CreateOauth2CredentialResult": { "type": "object", "properties": { - "providerIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "A list of unique identifiers for Oauth Providers" + "oauth2CredentialId": { + "type": "string", + "description": "Unique identifier of the OAuth 2.0 credential that was created" } }, - "required": ["providerIds"] + "required": ["oauth2CredentialId"] }, - "CreateOrganizationIntent": { + "CreateOauthProvidersIntent": { "type": "object", "properties": { - "organizationName": { + "userId": { + "type": "string", + "description": "The ID of the User to add an Oauth provider to" + }, + "oauthProviders": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/OauthProviderParams" + }, + "description": "A list of Oauth providers." + } + }, + "required": ["userId", "oauthProviders"] + }, + "CreateOauthProvidersRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS"] + }, + "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/CreateOauthProvidersIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "CreateOauthProvidersResult": { + "type": "object", + "properties": { + "providerIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of unique identifiers for Oauth Providers" + } + }, + "required": ["providerIds"] + }, + "CreateOrganizationIntent": { + "type": "object", + "properties": { + "organizationName": { "type": "string", "description": "Human-readable name for an Organization." }, @@ -4130,6 +4504,11 @@ "type": "boolean", "x-nullable": true, "description": "Disable OTP email auth for the sub-organization" + }, + "verificationToken": { + "type": "string", + "x-nullable": true, + "description": "Signed JWT containing a unique id, expiry, verification type, contact" } }, "required": ["subOrganizationName", "rootUsers", "rootQuorumThreshold"] @@ -4685,6 +5064,47 @@ }, "required": ["invitationId"] }, + "DeleteOauth2CredentialIntent": { + "type": "object", + "properties": { + "oauth2CredentialId": { + "type": "string", + "description": "The ID of the OAuth 2.0 credential to delete" + } + }, + "required": ["oauth2CredentialId"] + }, + "DeleteOauth2CredentialRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL"] + }, + "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/DeleteOauth2CredentialIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "DeleteOauth2CredentialResult": { + "type": "object", + "properties": { + "oauth2CredentialId": { + "type": "string", + "description": "Unique identifier of the OAuth 2.0 credential that was deleted" + } + }, + "required": ["oauth2CredentialId"] + }, "DeleteOauthProvidersIntent": { "type": "object", "properties": { @@ -5159,6 +5579,12 @@ }, "required": ["walletIds"] }, + "DisableAuthProxyIntent": { + "type": "object" + }, + "DisableAuthProxyResult": { + "type": "object" + }, "DisablePrivateKeyIntent": { "type": "object", "properties": { @@ -5346,6 +5772,19 @@ } } }, + "EnableAuthProxyIntent": { + "type": "object" + }, + "EnableAuthProxyResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "A User ID with permission to initiate authentication." + } + }, + "required": ["userId"] + }, "ExportPrivateKeyIntent": { "type": "object", "properties": { @@ -5519,7 +5958,8 @@ "FEATURE_NAME_EMAIL_RECOVERY", "FEATURE_NAME_WEBHOOK", "FEATURE_NAME_SMS_AUTH", - "FEATURE_NAME_OTP_EMAIL_AUTH" + "FEATURE_NAME_OTP_EMAIL_AUTH", + "FEATURE_NAME_AUTH_PROXY" ] }, "FiatOnRampBlockchainNetwork": { @@ -5713,6 +6153,33 @@ }, "required": ["apiKeys"] }, + "GetAppProofsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "activityId": { + "type": "string", + "description": "Unique identifier for a given activity." + } + }, + "required": ["organizationId", "activityId"] + }, + "GetAppProofsResponse": { + "type": "object", + "properties": { + "appProofs": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/AppProof" + } + } + }, + "required": ["appProofs"] + }, "GetAuthenticatorRequest": { "type": "object", "properties": { @@ -5765,6 +6232,57 @@ }, "required": ["authenticators"] }, + "GetBootProofRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "ephemeralKey": { + "type": "string", + "description": "Hex encoded ephemeral public key." + } + }, + "required": ["organizationId", "ephemeralKey"] + }, + "GetLatestBootProofRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "appName": { + "type": "string", + "description": "Name of enclave app." + } + }, + "required": ["organizationId", "appName"] + }, + "GetOauth2CredentialRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "oauth2CredentialId": { + "type": "string", + "description": "Unique identifier for a given OAuth 2.0 Credential." + } + }, + "required": ["organizationId", "oauth2CredentialId"] + }, + "GetOauth2CredentialResponse": { + "type": "object", + "properties": { + "oauth2Credential": { + "$ref": "#/definitions/Oauth2Credential" + } + }, + "required": ["oauth2Credential"] + }, "GetOauthProvidersRequest": { "type": "object", "properties": { @@ -5955,7 +6473,7 @@ "type": "object", "properties": { "smartContractInterface": { - "$ref": "#/definitions/data.v1.SmartContractInterface", + "$ref": "#/definitions/SmartContractInterface", "description": "Object to be used in conjunction with policies to guard transaction signing." } }, @@ -5978,7 +6496,7 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/data.v1.SmartContractInterface" + "$ref": "#/definitions/SmartContractInterface" }, "description": "A list of smart contract interfaces." } @@ -6149,6 +6667,11 @@ "x-nullable": true, "description": "Unique identifier for a given wallet. If not provided, all accounts for the organization will be returned." }, + "includeWalletDetails": { + "type": "boolean", + "x-nullable": true, + "description": "Optional flag to specify if the wallet details should be included in the response. Default = false." + }, "paginationOptions": { "$ref": "#/definitions/Pagination", "description": "Parameters used for cursor-based pagination." @@ -6445,6 +6968,11 @@ "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." + }, + "urlForSignature": { + "type": "string", + "x-nullable": true, + "description": "Optional MoonPay Widget URL to sign when using MoonPay client SDKs with URL Signing enabled." } }, "required": [ @@ -6485,6 +7013,10 @@ "onRampTransactionId": { "type": "string", "description": "Unique identifier used to retrieve transaction statuses for a given fiat on-ramp flow." + }, + "onRampUrlSignature": { + "type": "string", + "description": "Optional signature of the MoonPay Widget URL. The signature is generated if the Init Fiat On Ramp intent includes the urlForSignature field. The signature can be used to initialize the MoonPay SDKs when URL signing is enabled for your project." } }, "required": ["onRampUrl", "onRampTransactionId"] @@ -7141,6 +7673,27 @@ }, "deleteSmartContractInterfaceIntent": { "$ref": "#/definitions/DeleteSmartContractInterfaceIntent" + }, + "enableAuthProxyIntent": { + "$ref": "#/definitions/EnableAuthProxyIntent" + }, + "disableAuthProxyIntent": { + "$ref": "#/definitions/DisableAuthProxyIntent" + }, + "updateAuthProxyConfigIntent": { + "$ref": "#/definitions/UpdateAuthProxyConfigIntent" + }, + "createOauth2CredentialIntent": { + "$ref": "#/definitions/CreateOauth2CredentialIntent" + }, + "updateOauth2CredentialIntent": { + "$ref": "#/definitions/UpdateOauth2CredentialIntent" + }, + "deleteOauth2CredentialIntent": { + "$ref": "#/definitions/DeleteOauth2CredentialIntent" + }, + "oauth2AuthenticateIntent": { + "$ref": "#/definitions/Oauth2AuthenticateIntent" } } }, @@ -7179,6 +7732,29 @@ "senderUserId" ] }, + "ListOauth2CredentialsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + } + }, + "required": ["organizationId"] + }, + "ListOauth2CredentialsResponse": { + "type": "object", + "properties": { + "oauth2Credentials": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/Oauth2Credential" + } + } + }, + "required": ["oauth2Credentials"] + }, "ListPrivateKeyTagsRequest": { "type": "object", "properties": { @@ -7241,65 +7817,49 @@ "MNEMONIC_LANGUAGE_SPANISH" ] }, - "OauthIntent": { + "Oauth2AuthenticateIntent": { "type": "object", "properties": { - "oidcToken": { - "type": "string", - "description": "Base64 encoded OIDC token" - }, - "targetPublicKey": { - "type": "string", - "description": "Client-side public key generated by the user, to which the oauth bundle (credentials) will be encrypted." - }, - "apiKeyName": { + "oauth2CredentialId": { "type": "string", - "x-nullable": true, - "description": "Optional human-readable name for an API Key. If none provided, default to Oauth - \u003cTimestamp\u003e" + "description": "The OAuth 2.0 credential id whose client_id and client_secret will be used in the OAuth 2.0 flow" }, - "expirationSeconds": { + "authCode": { "type": "string", - "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." + "description": "The auth_code provided by the OAuth 2.0 provider to the end user to be exchanged for a Bearer token in the OAuth 2.0 flow" }, - "invalidateExisting": { - "type": "boolean", - "x-nullable": true, - "description": "Invalidate all other previously generated Oauth API keys" - } - }, - "required": ["oidcToken", "targetPublicKey"] - }, - "OauthLoginIntent": { - "type": "object", - "properties": { - "oidcToken": { + "redirectUri": { "type": "string", - "description": "Base64 encoded OIDC token" + "description": "The URI the user is redirected to after they have authenticated with the OAuth 2.0 provider" }, - "publicKey": { + "codeVerifier": { "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" + "description": "The code verifier used by OAuth 2.0 PKCE providers" }, - "expirationSeconds": { + "nonce": { "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." + "description": "An optional nonce used by the client to prevent replay/substitution of an ID token" }, - "invalidateExisting": { - "type": "boolean", + "bearerTokenTargetPublicKey": { + "type": "string", "x-nullable": true, - "description": "Invalidate all other previously generated Login API keys" + "description": "An optional P256 public key to which, if provided, the bearer token will be encrypted and returned via the `encrypted_bearer_token` claim of the OIDC Token" } }, - "required": ["oidcToken", "publicKey"] + "required": [ + "oauth2CredentialId", + "authCode", + "redirectUri", + "codeVerifier" + ] }, - "OauthLoginRequest": { + "Oauth2AuthenticateRequest": { "type": "object", "properties": { "type": { "type": "string", - "enum": ["ACTIVITY_TYPE_OAUTH_LOGIN"] + "enum": ["ACTIVITY_TYPE_OAUTH2_AUTHENTICATE"] }, "timestampMs": { "type": "string", @@ -7310,43 +7870,43 @@ "description": "Unique identifier for a given Organization." }, "parameters": { - "$ref": "#/definitions/OauthLoginIntent" + "$ref": "#/definitions/Oauth2AuthenticateIntent" } }, "required": ["type", "timestampMs", "organizationId", "parameters"] }, - "OauthLoginResult": { + "Oauth2AuthenticateResult": { "type": "object", "properties": { - "session": { + "oidcToken": { "type": "string", - "description": "Signed JWT containing an expiry, public key, session type, user id, and organization id" + "description": "Base64 encoded OIDC token issued by Turnkey to be used with the LoginWithOAuth activity" } }, - "required": ["session"] + "required": ["oidcToken"] }, - "OauthProvider": { + "Oauth2Credential": { "type": "object", "properties": { - "providerId": { + "oauth2CredentialId": { "type": "string", - "description": "Unique identifier for an OAuth Provider" + "description": "Unique identifier for a given OAuth 2.0 Credential." }, - "providerName": { + "organizationId": { "type": "string", - "description": "Human-readable name to identify a Provider." + "description": "Unique identifier for an Organization." }, - "issuer": { - "type": "string", - "description": "The issuer of the token, typically a URL indicating the authentication server, e.g https://accounts.google.com" + "provider": { + "$ref": "#/definitions/Oauth2Provider", + "description": "The provider for a given OAuth 2.0 Credential." }, - "audience": { + "clientId": { "type": "string", - "description": "Expected audience ('aud' attribute of the signed token) which represents the app ID" + "description": "The client id for a given OAuth 2.0 Credential." }, - "subject": { + "encryptedClientSecret": { "type": "string", - "description": "Expected subject ('sub' attribute of the signed token) which represents the user ID" + "description": "The encrypted client secret for a given OAuth 2.0 Credential encrypted to the TLS Fetcher quorum key." }, "createdAt": { "$ref": "#/definitions/external.data.v1.Timestamp" @@ -7356,10 +7916,138 @@ } }, "required": [ - "providerId", - "providerName", - "issuer", - "audience", + "oauth2CredentialId", + "organizationId", + "provider", + "clientId", + "encryptedClientSecret", + "createdAt", + "updatedAt" + ] + }, + "Oauth2Provider": { + "type": "string", + "enum": ["OAUTH2_PROVIDER_X", "OAUTH2_PROVIDER_DISCORD"] + }, + "OauthIntent": { + "type": "object", + "properties": { + "oidcToken": { + "type": "string", + "description": "Base64 encoded OIDC token" + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the oauth bundle (credentials) will be encrypted." + }, + "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", + "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": { + "providerId": { + "type": "string", + "description": "Unique identifier for an OAuth Provider" + }, + "providerName": { + "type": "string", + "description": "Human-readable name to identify a Provider." + }, + "issuer": { + "type": "string", + "description": "The issuer of the token, typically a URL indicating the authentication server, e.g https://accounts.google.com" + }, + "audience": { + "type": "string", + "description": "Expected audience ('aud' attribute of the signed token) which represents the app ID" + }, + "subject": { + "type": "string", + "description": "Expected subject ('sub' attribute of the signed token) which represents the user ID" + }, + "createdAt": { + "$ref": "#/definitions/external.data.v1.Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/external.data.v1.Timestamp" + } + }, + "required": [ + "providerId", + "providerName", + "issuer", + "audience", "subject", "createdAt", "updatedAt" @@ -7526,6 +8214,11 @@ "type": "boolean", "x-nullable": true, "description": "Invalidate all other previously generated Login API keys" + }, + "clientSignature": { + "type": "string", + "x-nullable": true, + "description": "Optional signature associated with the public key passed into the verification step. This must be a hex-encoded ECDSA signature over the verification token. Only required if a public key was provided during the verification step." } }, "required": ["verificationToken", "publicKey"] @@ -7598,7 +8291,8 @@ "enum": [ "PAYLOAD_ENCODING_HEXADECIMAL", "PAYLOAD_ENCODING_TEXT_UTF8", - "PAYLOAD_ENCODING_EIP712" + "PAYLOAD_ENCODING_EIP712", + "PAYLOAD_ENCODING_EIP7702_AUTHORIZATION" ] }, "Policy": { @@ -8148,6 +8842,27 @@ }, "deleteSmartContractInterfaceResult": { "$ref": "#/definitions/DeleteSmartContractInterfaceResult" + }, + "enableAuthProxyResult": { + "$ref": "#/definitions/EnableAuthProxyResult" + }, + "disableAuthProxyResult": { + "$ref": "#/definitions/DisableAuthProxyResult" + }, + "updateAuthProxyConfigResult": { + "$ref": "#/definitions/UpdateAuthProxyConfigResult" + }, + "createOauth2CredentialResult": { + "$ref": "#/definitions/CreateOauth2CredentialResult" + }, + "updateOauth2CredentialResult": { + "$ref": "#/definitions/UpdateOauth2CredentialResult" + }, + "deleteOauth2CredentialResult": { + "$ref": "#/definitions/DeleteOauth2CredentialResult" + }, + "oauth2AuthenticateResult": { + "$ref": "#/definitions/Oauth2AuthenticateResult" } } }, @@ -8663,6 +9378,10 @@ }, "required": ["signedTransaction"] }, + "SignatureScheme": { + "type": "string", + "enum": ["SIGNATURE_SCHEME_EPHEMERAL_KEY_P256"] + }, "SimpleClientExtensionResults": { "type": "object", "properties": { @@ -8680,6 +9399,56 @@ } } }, + "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" + ] + }, "SmartContractInterfaceType": { "type": "string", "enum": [ @@ -8795,6 +9564,156 @@ "UpdateAllowedOriginsResult": { "type": "object" }, + "UpdateAuthProxyConfigIntent": { + "type": "object", + "properties": { + "allowedOrigins": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Updated list of allowed origins for CORS." + }, + "allowedAuthMethods": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Updated list of allowed proxy authentication methods." + }, + "sendFromEmailAddress": { + "type": "string", + "x-nullable": true, + "description": "Custom 'from' address for auth-related emails." + }, + "replyToEmailAddress": { + "type": "string", + "x-nullable": true, + "description": "Custom reply-to address for auth-related emails." + }, + "emailAuthTemplateId": { + "type": "string", + "x-nullable": true, + "description": "Template ID for email-auth messages." + }, + "otpTemplateId": { + "type": "string", + "x-nullable": true, + "description": "Template ID for OTP SMS messages." + }, + "emailCustomizationParams": { + "$ref": "#/definitions/EmailCustomizationParams", + "x-nullable": true, + "description": "Overrides for auth-related email content." + }, + "smsCustomizationParams": { + "$ref": "#/definitions/SmsCustomizationParams", + "x-nullable": true, + "description": "Overrides for auth-related SMS content." + }, + "walletKitSettings": { + "$ref": "#/definitions/WalletKitSettingsParams", + "x-nullable": true, + "description": "Overrides for react wallet kit related settings." + }, + "otpExpirationSeconds": { + "type": "integer", + "format": "int32", + "x-nullable": true, + "description": "OTP code lifetime in seconds." + }, + "verificationTokenExpirationSeconds": { + "type": "integer", + "format": "int32", + "x-nullable": true, + "description": "Verification-token lifetime in seconds." + }, + "sessionExpirationSeconds": { + "type": "integer", + "format": "int32", + "x-nullable": true, + "description": "Session lifetime in seconds." + }, + "otpAlphanumeric": { + "type": "boolean", + "x-nullable": true, + "description": "Enable alphanumeric OTP codes." + }, + "otpLength": { + "type": "integer", + "format": "int32", + "x-nullable": true, + "description": "Desired OTP code length (6–9)." + } + } + }, + "UpdateAuthProxyConfigResult": { + "type": "object", + "properties": { + "configId": { + "type": "string", + "description": "Unique identifier for a given User. (representing the turnkey signer user id)" + } + } + }, + "UpdateOauth2CredentialIntent": { + "type": "object", + "properties": { + "oauth2CredentialId": { + "type": "string", + "description": "The ID of the OAuth 2.0 credential to update" + }, + "provider": { + "$ref": "#/definitions/Oauth2Provider", + "description": "The OAuth 2.0 provider" + }, + "clientId": { + "type": "string", + "description": "The Client ID issued by the OAuth 2.0 provider" + }, + "encryptedClientSecret": { + "type": "string", + "description": "The client secret issued by the OAuth 2.0 provider encrypted to the TLS Fetcher quorum key" + } + }, + "required": [ + "oauth2CredentialId", + "provider", + "clientId", + "encryptedClientSecret" + ] + }, + "UpdateOauth2CredentialRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL"] + }, + "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/UpdateOauth2CredentialIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "UpdateOauth2CredentialResult": { + "type": "object", + "properties": { + "oauth2CredentialId": { + "type": "string", + "description": "Unique identifier of the OAuth 2.0 credential that was updated" + } + }, + "required": ["oauth2CredentialId"] + }, "UpdatePolicyIntent": { "type": "object", "properties": { @@ -9549,6 +10468,11 @@ "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)" + }, + "publicKey": { + "type": "string", + "x-nullable": true, + "description": "Client-side public key generated by the user, which will be added to the JWT response and verified in subsequent requests via a client proof signature" } }, "required": ["otpId", "otpCode"] @@ -9720,6 +10644,11 @@ "type": "string", "x-nullable": true, "description": "The public component of this wallet account's underlying cryptographic key pair." + }, + "walletDetails": { + "$ref": "#/definitions/Wallet", + "x-nullable": true, + "description": "Wallet details for this account. This is only present when include_wallet_details=true." } }, "required": [ @@ -9757,6 +10686,32 @@ }, "required": ["curve", "pathFormat", "path", "addressFormat"] }, + "WalletKitSettingsParams": { + "type": "object", + "properties": { + "enabledSocialProviders": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of enabled social login providers (e.g., 'apple', 'google', 'facebook')", + "title": "Enabled Social Providers" + }, + "oauthClientIds": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Mapping of social login providers to their Oauth client IDs.", + "title": "Oauth Client IDs" + }, + "oauthRedirectUrl": { + "type": "string", + "description": "Oauth redirect URL to be used for social login flows.", + "title": "Oauth Redirect URL" + } + } + }, "WalletParams": { "type": "object", "properties": { @@ -9831,7 +10786,7 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/ump.v1.PolicyEvaluation" + "$ref": "#/definitions/common.v1.PolicyEvaluation" }, "description": "Detailed evaluation result for each Policy that was run." }, @@ -9848,66 +10803,27 @@ "createdAt" ] }, - "data.v1.Address": { + "common.v1.PolicyEvaluation": { "type": "object", "properties": { - "format": { - "$ref": "#/definitions/AddressFormat" - }, - "address": { + "policyId": { "type": "string" + }, + "outcome": { + "$ref": "#/definitions/Outcome" } } }, - "data.v1.SmartContractInterface": { + "data.v1.Address": { "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" + "format": { + "$ref": "#/definitions/AddressFormat" }, - "updatedAt": { - "$ref": "#/definitions/external.data.v1.Timestamp" + "address": { + "type": "string" } - }, - "required": [ - "organizationId", - "smartContractInterfaceId", - "smartContractAddress", - "smartContractInterface", - "type", - "label", - "notes", - "createdAt", - "updatedAt" - ] + } }, "external.data.v1.Credential": { "type": "object", @@ -9952,17 +10868,6 @@ }, "required": ["seconds", "nanos"] }, - "ump.v1.PolicyEvaluation": { - "type": "object", - "properties": { - "policyId": { - "type": "string" - }, - "outcome": { - "$ref": "#/definitions/Outcome" - } - } - }, "v1.Tag": { "type": "object", "properties": {