diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index 51e12f2..cb192d9 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -18,7 +18,7 @@ jobs: # https://github.com/ruby/setup-ruby - name: Set up Ruby - uses: ruby/setup-ruby@d4526a55538b775af234ba4af27118ed6f8f6677 # v1.172.0 + uses: ruby/setup-ruby@086ffb1a2090c870a3f881cc91ea83aa4243d408 # v1.195.0 with: ruby-version: '3.3' diff --git a/turnkey_client/lib/turnkey_client.rb b/turnkey_client/lib/turnkey_client.rb index 490495a..021f281 100644 --- a/turnkey_client/lib/turnkey_client.rb +++ b/turnkey_client/lib/turnkey_client.rb @@ -204,6 +204,8 @@ require 'turnkey_client/models/get_user_response' require 'turnkey_client/models/get_users_request' require 'turnkey_client/models/get_users_response' +require 'turnkey_client/models/get_verified_sub_org_ids_request' +require 'turnkey_client/models/get_verified_sub_org_ids_response' require 'turnkey_client/models/get_wallet_accounts_request' require 'turnkey_client/models/get_wallet_accounts_response' require 'turnkey_client/models/get_wallet_request' @@ -288,6 +290,7 @@ require 'turnkey_client/models/sign_transaction_request' require 'turnkey_client/models/sign_transaction_result' require 'turnkey_client/models/simple_client_extension_results' +require 'turnkey_client/models/sms_customization_params' require 'turnkey_client/models/status' require 'turnkey_client/models/tag_type' require 'turnkey_client/models/transaction_type' diff --git a/turnkey_client/lib/turnkey_client/api/organizations_api.rb b/turnkey_client/lib/turnkey_client/api/organizations_api.rb index 738c674..d4a23db 100644 --- a/turnkey_client/lib/turnkey_client/api/organizations_api.rb +++ b/turnkey_client/lib/turnkey_client/api/organizations_api.rb @@ -247,6 +247,64 @@ def get_sub_org_ids_with_http_info(body, opts = {}) end return data, status_code, headers end + # Get Verified Suborgs + # Get all email or phone verified suborg IDs associated given a parent org ID. + # @param body + # @param [Hash] opts the optional parameters + # @return [GetVerifiedSubOrgIdsResponse] + def get_verified_sub_org_ids(body, opts = {}) + data, _status_code, _headers = get_verified_sub_org_ids_with_http_info(body, opts) + data + end + + # Get Verified Suborgs + # Get all email or phone verified suborg IDs associated given a parent org ID. + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(GetVerifiedSubOrgIdsResponse, Integer, Hash)>] GetVerifiedSubOrgIdsResponse data, response status code and response headers + def get_verified_sub_org_ids_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrganizationsApi.get_verified_sub_org_ids ...' + 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 OrganizationsApi.get_verified_sub_org_ids" + end + # resource path + local_var_path = '/public/v1/query/list_verified_suborgs' + + # 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] || 'GetVerifiedSubOrgIdsResponse' + + 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: OrganizationsApi#get_verified_sub_org_ids\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end # Update Root Quorum # Set the threshold and members of the root quorum. This activity must be approved by the current root quorum. # @param body 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 1970f86..b20deea 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,122 @@ class UserAuthApi def initialize(api_client = ApiClient.default) @api_client = api_client end + # Create Oauth Providers + # Creates Oauth providers for a specified user - BETA + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def create_oauth_providers(body, opts = {}) + data, _status_code, _headers = create_oauth_providers_with_http_info(body, opts) + data + end + + # Create Oauth Providers + # Creates Oauth providers for a specified user - BETA + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def create_oauth_providers_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserAuthApi.create_oauth_providers ...' + 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_oauth_providers" + end + # resource path + local_var_path = '/public/v1/submit/create_oauth_providers' + + # 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_oauth_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete Oauth Providers + # Removes Oauth providers for a specified user - BETA + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def delete_oauth_providers(body, opts = {}) + data, _status_code, _headers = delete_oauth_providers_with_http_info(body, opts) + data + end + + # Delete Oauth Providers + # Removes Oauth providers for a specified user - BETA + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def delete_oauth_providers_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserAuthApi.delete_oauth_providers ...' + 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_oauth_providers" + end + # resource path + local_var_path = '/public/v1/submit/delete_oauth_providers' + + # 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_oauth_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end # Perform Email Auth # Authenticate a user via Email # @param body @@ -73,5 +189,237 @@ def email_auth_with_http_info(body, opts = {}) end return data, status_code, headers end + # Get Oauth providers + # Get details about Oauth providers for a user + # @param body + # @param [Hash] opts the optional parameters + # @return [GetOauthProvidersResponse] + def get_oauth_providers(body, opts = {}) + data, _status_code, _headers = get_oauth_providers_with_http_info(body, opts) + data + end + + # Get Oauth providers + # Get details about Oauth providers for a user + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(GetOauthProvidersResponse, Integer, Hash)>] GetOauthProvidersResponse data, response status code and response headers + def get_oauth_providers_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserAuthApi.get_oauth_providers ...' + 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.get_oauth_providers" + end + # resource path + local_var_path = '/public/v1/query/get_oauth_providers' + + # 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] || 'GetOauthProvidersResponse' + + 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#get_oauth_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Init OTP auth + # Initiate an OTP auth activity + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def init_otp_auth(body, opts = {}) + data, _status_code, _headers = init_otp_auth_with_http_info(body, opts) + data + end + + # Init OTP auth + # Initiate an OTP auth activity + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def init_otp_auth_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserAuthApi.init_otp_auth ...' + 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.init_otp_auth" + end + # resource path + local_var_path = '/public/v1/submit/init_otp_auth' + + # 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#init_otp_auth\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) - BETA + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def oauth(body, opts = {}) + data, _status_code, _headers = oauth_with_http_info(body, opts) + data + end + + # Oauth + # Authenticate a user with an Oidc token (Oauth) - BETA + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def oauth_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserAuthApi.oauth ...' + 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.oauth" + end + # resource path + local_var_path = '/public/v1/submit/oauth' + + # 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#oauth\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 + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def otp_auth(body, opts = {}) + data, _status_code, _headers = otp_auth_with_http_info(body, opts) + data + end + + # OTP auth + # Authenticate a user with an OTP code sent via email or SMS + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def otp_auth_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserAuthApi.otp_auth ...' + 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.otp_auth" + end + # resource path + local_var_path = '/public/v1/submit/otp_auth' + + # 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#otp_auth\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/turnkey_client/lib/turnkey_client/api/users_api.rb b/turnkey_client/lib/turnkey_client/api/users_api.rb index 5fec3cd..74ad51a 100644 --- a/turnkey_client/lib/turnkey_client/api/users_api.rb +++ b/turnkey_client/lib/turnkey_client/api/users_api.rb @@ -15,64 +15,6 @@ class UsersApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create Oauth Providers - # Creates Oauth providers for a specified user - BETA - # @param body - # @param [Hash] opts the optional parameters - # @return [ActivityResponse] - def create_oauth_providers(body, opts = {}) - data, _status_code, _headers = create_oauth_providers_with_http_info(body, opts) - data - end - - # Create Oauth Providers - # Creates Oauth providers for a specified user - BETA - # @param body - # @param [Hash] opts the optional parameters - # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers - def create_oauth_providers_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UsersApi.create_oauth_providers ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.create_oauth_providers" - end - # resource path - local_var_path = '/public/v1/submit/create_oauth_providers' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'ActivityResponse' - - auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UsersApi#create_oauth_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end # Create Users # Create Users in an existing Organization # @param body @@ -131,64 +73,6 @@ def create_users_with_http_info(body, opts = {}) end return data, status_code, headers end - # Delete Oauth Providers - # Removes Oauth providers for a specified user - BETA - # @param body - # @param [Hash] opts the optional parameters - # @return [ActivityResponse] - def delete_oauth_providers(body, opts = {}) - data, _status_code, _headers = delete_oauth_providers_with_http_info(body, opts) - data - end - - # Delete Oauth Providers - # Removes Oauth providers for a specified user - BETA - # @param body - # @param [Hash] opts the optional parameters - # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers - def delete_oauth_providers_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UsersApi.delete_oauth_providers ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.delete_oauth_providers" - end - # resource path - local_var_path = '/public/v1/submit/delete_oauth_providers' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'ActivityResponse' - - auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UsersApi#delete_oauth_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end # Delete Users # Delete Users within an Organization # @param body @@ -247,64 +131,6 @@ def delete_users_with_http_info(body, opts = {}) end return data, status_code, headers end - # Get Oauth providers - # Get details about Oauth providers for a user - # @param body - # @param [Hash] opts the optional parameters - # @return [GetOauthProvidersResponse] - def get_oauth_providers(body, opts = {}) - data, _status_code, _headers = get_oauth_providers_with_http_info(body, opts) - data - end - - # Get Oauth providers - # Get details about Oauth providers for a user - # @param body - # @param [Hash] opts the optional parameters - # @return [Array<(GetOauthProvidersResponse, Integer, Hash)>] GetOauthProvidersResponse data, response status code and response headers - def get_oauth_providers_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UsersApi.get_oauth_providers ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.get_oauth_providers" - end - # resource path - local_var_path = '/public/v1/query/get_oauth_providers' - - # 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] || 'GetOauthProvidersResponse' - - auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UsersApi#get_oauth_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end # Get User # Get details about a User # @param body @@ -421,180 +247,6 @@ def get_users_with_http_info(body, opts = {}) end return data, status_code, headers end - # Init OTP auth - # Initiate an OTP auth activity - # @param body - # @param [Hash] opts the optional parameters - # @return [ActivityResponse] - def init_otp_auth(body, opts = {}) - data, _status_code, _headers = init_otp_auth_with_http_info(body, opts) - data - end - - # Init OTP auth - # Initiate an OTP auth activity - # @param body - # @param [Hash] opts the optional parameters - # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers - def init_otp_auth_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UsersApi.init_otp_auth ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.init_otp_auth" - end - # resource path - local_var_path = '/public/v1/submit/init_otp_auth' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'ActivityResponse' - - auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UsersApi#init_otp_auth\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) - BETA - # @param body - # @param [Hash] opts the optional parameters - # @return [ActivityResponse] - def oauth(body, opts = {}) - data, _status_code, _headers = oauth_with_http_info(body, opts) - data - end - - # Oauth - # Authenticate a user with an Oidc token (Oauth) - BETA - # @param body - # @param [Hash] opts the optional parameters - # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers - def oauth_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UsersApi.oauth ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.oauth" - end - # resource path - local_var_path = '/public/v1/submit/oauth' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'ActivityResponse' - - auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UsersApi#oauth\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 - # @param [Hash] opts the optional parameters - # @return [ActivityResponse] - def otp_auth(body, opts = {}) - data, _status_code, _headers = otp_auth_with_http_info(body, opts) - data - end - - # OTP auth - # Authenticate a user with an OTP code sent via email or SMS - # @param body - # @param [Hash] opts the optional parameters - # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers - def otp_auth_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UsersApi.otp_auth ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.otp_auth" - end - # resource path - local_var_path = '/public/v1/submit/otp_auth' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'ActivityResponse' - - auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UsersApi#otp_auth\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end # Update User # Update a User in an existing Organization # @param body diff --git a/turnkey_client/lib/turnkey_client/models/address_format.rb b/turnkey_client/lib/turnkey_client/models/address_format.rb index 1f08fe7..959d093 100644 --- a/turnkey_client/lib/turnkey_client/models/address_format.rb +++ b/turnkey_client/lib/turnkey_client/models/address_format.rb @@ -46,6 +46,7 @@ class AddressFormat DOGE_TESTNET = 'ADDRESS_FORMAT_DOGE_TESTNET'.freeze TON_V3_R2 = 'ADDRESS_FORMAT_TON_V3R2'.freeze TON_V4_R2 = 'ADDRESS_FORMAT_TON_V4R2'.freeze + XRP = 'ADDRESS_FORMAT_XRP'.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_sub_org_ids_request.rb b/turnkey_client/lib/turnkey_client/models/get_sub_org_ids_request.rb index 9bc5ee9..bafba1f 100644 --- a/turnkey_client/lib/turnkey_client/models/get_sub_org_ids_request.rb +++ b/turnkey_client/lib/turnkey_client/models/get_sub_org_ids_request.rb @@ -15,7 +15,7 @@ class GetSubOrgIdsRequest # Unique identifier for the parent Organization. This is used to find sub-organizations within it. attr_accessor :organization_id - # Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'OIDC_TOKEN' or 'PUBLIC_KEY' + # Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN' or 'PUBLIC_KEY' attr_accessor :filter_type # The value of the filter to apply for the specified type. For example, a specific email or name string. diff --git a/turnkey_client/lib/turnkey_client/models/get_verified_sub_org_ids_request.rb b/turnkey_client/lib/turnkey_client/models/get_verified_sub_org_ids_request.rb new file mode 100644 index 0000000..9bc21a3 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/get_verified_sub_org_ids_request.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 GetVerifiedSubOrgIdsRequest + # Unique identifier for the parent Organization. This is used to find sub-organizations within it. + attr_accessor :organization_id + + # Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER' + attr_accessor :filter_type + + # The value of the filter to apply for the specified type. For example, a specific email or phone number string. + attr_accessor :filter_value + + attr_accessor :pagination_options + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'organization_id' => :'organizationId', + :'filter_type' => :'filterType', + :'filter_value' => :'filterValue', + :'pagination_options' => :'paginationOptions' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'organization_id' => :'Object', + :'filter_type' => :'Object', + :'filter_value' => :'Object', + :'pagination_options' => :'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::GetVerifiedSubOrgIdsRequest` 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::GetVerifiedSubOrgIdsRequest`. 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?(:'filter_type') + self.filter_type = attributes[:'filter_type'] + end + + if attributes.key?(:'filter_value') + self.filter_value = attributes[:'filter_value'] + end + + if attributes.key?(:'pagination_options') + self.pagination_options = attributes[:'pagination_options'] + 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 && + filter_type == o.filter_type && + filter_value == o.filter_value && + pagination_options == o.pagination_options + 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, filter_type, filter_value, pagination_options].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_verified_sub_org_ids_response.rb b/turnkey_client/lib/turnkey_client/models/get_verified_sub_org_ids_response.rb new file mode 100644 index 0000000..1314483 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/get_verified_sub_org_ids_response.rb @@ -0,0 +1,213 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class GetVerifiedSubOrgIdsResponse + # List of unique identifiers for the matching sub-organizations. + attr_accessor :organization_ids + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'organization_ids' => :'organizationIds' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'organization_ids' => :'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::GetVerifiedSubOrgIdsResponse` 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::GetVerifiedSubOrgIdsResponse`. 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_ids') + if (value = attributes[:'organization_ids']).is_a?(Array) + self.organization_ids = 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 @organization_ids.nil? + invalid_properties.push('invalid value for "organization_ids", organization_ids 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_ids.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_ids == o.organization_ids + 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_ids].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/init_otp_auth_intent.rb b/turnkey_client/lib/turnkey_client/models/init_otp_auth_intent.rb index b5d892b..2b55dbd 100644 --- a/turnkey_client/lib/turnkey_client/models/init_otp_auth_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/init_otp_auth_intent.rb @@ -20,12 +20,19 @@ class InitOtpAuthIntent attr_accessor :email_customization + attr_accessor :sms_customization + + # Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. + attr_accessor :user_identifier + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'otp_type' => :'otpType', :'contact' => :'contact', - :'email_customization' => :'emailCustomization' + :'email_customization' => :'emailCustomization', + :'sms_customization' => :'smsCustomization', + :'user_identifier' => :'userIdentifier' } end @@ -34,7 +41,9 @@ def self.openapi_types { :'otp_type' => :'Object', :'contact' => :'Object', - :'email_customization' => :'Object' + :'email_customization' => :'Object', + :'sms_customization' => :'Object', + :'user_identifier' => :'Object' } end @@ -70,6 +79,14 @@ def initialize(attributes = {}) if attributes.key?(:'email_customization') self.email_customization = attributes[:'email_customization'] end + + if attributes.key?(:'sms_customization') + self.sms_customization = attributes[:'sms_customization'] + end + + if attributes.key?(:'user_identifier') + self.user_identifier = attributes[:'user_identifier'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -102,7 +119,9 @@ def ==(o) self.class == o.class && otp_type == o.otp_type && contact == o.contact && - email_customization == o.email_customization + email_customization == o.email_customization && + sms_customization == o.sms_customization && + user_identifier == o.user_identifier end # @see the `==` method @@ -114,7 +133,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [otp_type, contact, email_customization].hash + [otp_type, contact, email_customization, sms_customization, user_identifier].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/sms_customization_params.rb b/turnkey_client/lib/turnkey_client/models/sms_customization_params.rb new file mode 100644 index 0000000..4797236 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/sms_customization_params.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 SmsCustomizationParams + # Template containing references to .OtpCode i.e Your OTP is {{.OtpCode}} + attr_accessor :template + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'template' => :'template' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'template' => :'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::SmsCustomizationParams` 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::SmsCustomizationParams`. 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?(:'template') + self.template = attributes[:'template'] + 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 && + template == o.template + 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 + [template].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/wallet_account.rb b/turnkey_client/lib/turnkey_client/models/wallet_account.rb index c74bbed..25cd3ef 100644 --- a/turnkey_client/lib/turnkey_client/models/wallet_account.rb +++ b/turnkey_client/lib/turnkey_client/models/wallet_account.rb @@ -12,6 +12,9 @@ module TurnkeyClient class WalletAccount + # Unique identifier for a given Wallet Account. + attr_accessor :wallet_account_id + # The Organization the Account belongs to. attr_accessor :organization_id @@ -37,6 +40,7 @@ class WalletAccount # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'wallet_account_id' => :'walletAccountId', :'organization_id' => :'organizationId', :'wallet_id' => :'walletId', :'curve' => :'curve', @@ -52,6 +56,7 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { + :'wallet_account_id' => :'Object', :'organization_id' => :'Object', :'wallet_id' => :'Object', :'curve' => :'Object', @@ -85,6 +90,10 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'wallet_account_id') + self.wallet_account_id = attributes[:'wallet_account_id'] + end + if attributes.key?(:'organization_id') self.organization_id = attributes[:'organization_id'] end @@ -126,6 +135,10 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @wallet_account_id.nil? + invalid_properties.push('invalid value for "wallet_account_id", wallet_account_id cannot be nil.') + end + if @organization_id.nil? invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') end @@ -168,6 +181,7 @@ def list_invalid_properties # 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 @wallet_account_id.nil? return false if @organization_id.nil? return false if @wallet_id.nil? return false if @curve.nil? @@ -185,6 +199,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && + wallet_account_id == o.wallet_account_id && organization_id == o.organization_id && wallet_id == o.wallet_id && curve == o.curve && @@ -205,7 +220,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [organization_id, wallet_id, curve, path_format, path, address_format, address, created_at, updated_at].hash + [wallet_account_id, organization_id, wallet_id, curve, path_format, path, address_format, address, created_at, updated_at].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/version.rb b/turnkey_client/lib/turnkey_client/version.rb index 9349ab0..fabe939 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.10' + VERSION = '0.0.11' end diff --git a/turnkey_client_inputs/config.json b/turnkey_client_inputs/config.json index 302976b..3ed16d8 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.10" + "gemVersion": "0.0.11" } diff --git a/turnkey_client_inputs/public_api.swagger.json b/turnkey_client_inputs/public_api.swagger.json index bb1d5b8..6d9d912 100644 --- a/turnkey_client_inputs/public_api.swagger.json +++ b/turnkey_client_inputs/public_api.swagger.json @@ -218,7 +218,7 @@ } } ], - "tags": ["Users"] + "tags": ["User Auth"] } }, "/public/v1/query/get_organization_configs": { @@ -533,6 +533,32 @@ "tags": ["Users"] } }, + "/public/v1/query/list_verified_suborgs": { + "post": { + "summary": "Get Verified Suborgs", + "description": "Get all email or phone verified suborg IDs associated given a parent org ID.", + "operationId": "GetVerifiedSubOrgIds", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetVerifiedSubOrgIdsResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GetVerifiedSubOrgIdsRequest" + } + } + ], + "tags": ["Organizations"] + } + }, "/public/v1/query/list_wallet_accounts": { "post": { "summary": "List Wallets Accounts", @@ -738,7 +764,7 @@ } } ], - "tags": ["Users"] + "tags": ["User Auth"] } }, "/public/v1/submit/create_policies": { @@ -1128,7 +1154,7 @@ } } ], - "tags": ["Users"] + "tags": ["User Auth"] } }, "/public/v1/submit/delete_policy": { @@ -1544,7 +1570,7 @@ } } ], - "tags": ["Users"] + "tags": ["User Auth"] } }, "/public/v1/submit/init_user_email_recovery": { @@ -1596,7 +1622,7 @@ } } ], - "tags": ["Users"] + "tags": ["User Auth"] } }, "/public/v1/submit/otp_auth": { @@ -1622,7 +1648,7 @@ } } ], - "tags": ["Users"] + "tags": ["User Auth"] } }, "/public/v1/submit/recover_user": { @@ -2225,7 +2251,8 @@ "ADDRESS_FORMAT_DOGE_MAINNET", "ADDRESS_FORMAT_DOGE_TESTNET", "ADDRESS_FORMAT_TON_V3R2", - "ADDRESS_FORMAT_TON_V4R2" + "ADDRESS_FORMAT_TON_V4R2", + "ADDRESS_FORMAT_XRP" ] }, "Any": { @@ -5171,7 +5198,7 @@ }, "filterType": { "type": "string", - "description": "Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'OIDC_TOKEN' or 'PUBLIC_KEY'" + "description": "Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN' or 'PUBLIC_KEY'" }, "filterValue": { "type": "string", @@ -5245,6 +5272,41 @@ }, "required": ["users"] }, + "GetVerifiedSubOrgIdsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for the parent Organization. This is used to find sub-organizations within it." + }, + "filterType": { + "type": "string", + "description": "Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER'" + }, + "filterValue": { + "type": "string", + "description": "The value of the filter to apply for the specified type. For example, a specific email or phone number string." + }, + "paginationOptions": { + "$ref": "#/definitions/Pagination", + "description": "Parameters used for cursor-based pagination." + } + }, + "required": ["organizationId"] + }, + "GetVerifiedSubOrgIdsResponse": { + "type": "object", + "properties": { + "organizationIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for the matching sub-organizations." + } + }, + "required": ["organizationIds"] + }, "GetWalletAccountsRequest": { "type": "object", "properties": { @@ -5600,6 +5662,14 @@ "emailCustomization": { "$ref": "#/definitions/EmailCustomizationParams", "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "smsCustomization": { + "$ref": "#/definitions/SmsCustomizationParams", + "description": "Optional parameters for customizing SMS message. If not provided, the default sms message will be used." + }, + "userIdentifier": { + "type": "string", + "description": "Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address." } }, "required": ["otpType", "contact"] @@ -7278,6 +7348,15 @@ } } }, + "SmsCustomizationParams": { + "type": "object", + "properties": { + "template": { + "type": "string", + "description": "Template containing references to .OtpCode i.e Your OTP is {{.OtpCode}}" + } + } + }, "Status": { "type": "object", "properties": { @@ -7848,6 +7927,10 @@ "WalletAccount": { "type": "object", "properties": { + "walletAccountId": { + "type": "string", + "description": "Unique identifier for a given Wallet Account." + }, "organizationId": { "type": "string", "description": "The Organization the Account belongs to." @@ -7884,6 +7967,7 @@ } }, "required": [ + "walletAccountId", "organizationId", "walletId", "curve",