From a80d3bd76392fdef4dcd22b9a6a59431fdef9e4b Mon Sep 17 00:00:00 2001 From: Andrew Min Date: Mon, 3 Feb 2025 15:47:42 -0500 Subject: [PATCH] bump per mono release v2025.1.11 --- turnkey_client/lib/turnkey_client.rb | 3 + .../lib/turnkey_client/api/wallets_api.rb | 58 ++++ .../turnkey_client/models/activity_type.rb | 1 + .../models/email_auth_intent.rb | 18 +- .../models/email_auth_intent_v2.rb | 18 +- .../models/init_otp_auth_intent.rb | 18 +- .../lib/turnkey_client/models/intent.rb | 17 +- .../lib/turnkey_client/models/result.rb | 17 +- .../models/update_wallet_intent.rb | 221 ++++++++++++++ .../models/update_wallet_request.rb | 288 ++++++++++++++++++ .../models/update_wallet_result.rb | 211 +++++++++++++ turnkey_client/lib/turnkey_client/version.rb | 2 +- turnkey_client_inputs/config.json | 2 +- turnkey_client_inputs/public_api.swagger.json | 92 +++++- 14 files changed, 943 insertions(+), 23 deletions(-) create mode 100644 turnkey_client/lib/turnkey_client/models/update_wallet_intent.rb create mode 100644 turnkey_client/lib/turnkey_client/models/update_wallet_request.rb create mode 100644 turnkey_client/lib/turnkey_client/models/update_wallet_result.rb diff --git a/turnkey_client/lib/turnkey_client.rb b/turnkey_client/lib/turnkey_client.rb index 021f281..ce05076 100644 --- a/turnkey_client/lib/turnkey_client.rb +++ b/turnkey_client/lib/turnkey_client.rb @@ -311,6 +311,9 @@ require 'turnkey_client/models/update_user_tag_intent' require 'turnkey_client/models/update_user_tag_request' require 'turnkey_client/models/update_user_tag_result' +require 'turnkey_client/models/update_wallet_intent' +require 'turnkey_client/models/update_wallet_request' +require 'turnkey_client/models/update_wallet_result' require 'turnkey_client/models/user' require 'turnkey_client/models/user_params' require 'turnkey_client/models/user_params_v2' diff --git a/turnkey_client/lib/turnkey_client/api/wallets_api.rb b/turnkey_client/lib/turnkey_client/api/wallets_api.rb index 4af1a24..c8cd39a 100644 --- a/turnkey_client/lib/turnkey_client/api/wallets_api.rb +++ b/turnkey_client/lib/turnkey_client/api/wallets_api.rb @@ -595,5 +595,63 @@ def init_import_wallet_with_http_info(body, opts = {}) end return data, status_code, headers end + # Update Wallet + # Update a wallet for an organization + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def update_wallet(body, opts = {}) + data, _status_code, _headers = update_wallet_with_http_info(body, opts) + data + end + + # Update Wallet + # Update a wallet for an organization + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def update_wallet_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WalletsApi.update_wallet ...' + 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 WalletsApi.update_wallet" + end + # resource path + local_var_path = '/public/v1/submit/update_wallet' + + # 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: WalletsApi#update_wallet\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_type.rb b/turnkey_client/lib/turnkey_client/models/activity_type.rb index 92194a7..6d99a81 100644 --- a/turnkey_client/lib/turnkey_client/models/activity_type.rb +++ b/turnkey_client/lib/turnkey_client/models/activity_type.rb @@ -91,6 +91,7 @@ class ActivityType INIT_OTP_AUTH = 'ACTIVITY_TYPE_INIT_OTP_AUTH'.freeze OTP_AUTH = 'ACTIVITY_TYPE_OTP_AUTH'.freeze CREATE_SUB_ORGANIZATION_V7 = 'ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7'.freeze + UPDATE_WALLET = 'ACTIVITY_TYPE_UPDATE_WALLET'.freeze # 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/email_auth_intent.rb b/turnkey_client/lib/turnkey_client/models/email_auth_intent.rb index dd8612e..4241129 100644 --- a/turnkey_client/lib/turnkey_client/models/email_auth_intent.rb +++ b/turnkey_client/lib/turnkey_client/models/email_auth_intent.rb @@ -29,6 +29,9 @@ class EmailAuthIntent # Invalidate all other previously generated Email Auth API keys attr_accessor :invalidate_existing + # Optional custom email address from which to send the email + attr_accessor :send_from_email_address + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -37,7 +40,8 @@ def self.attribute_map :'api_key_name' => :'apiKeyName', :'expiration_seconds' => :'expirationSeconds', :'email_customization' => :'emailCustomization', - :'invalidate_existing' => :'invalidateExisting' + :'invalidate_existing' => :'invalidateExisting', + :'send_from_email_address' => :'sendFromEmailAddress' } end @@ -49,7 +53,8 @@ def self.openapi_types :'api_key_name' => :'Object', :'expiration_seconds' => :'Object', :'email_customization' => :'Object', - :'invalidate_existing' => :'Object' + :'invalidate_existing' => :'Object', + :'send_from_email_address' => :'Object' } end @@ -97,6 +102,10 @@ def initialize(attributes = {}) if attributes.key?(:'invalidate_existing') self.invalidate_existing = attributes[:'invalidate_existing'] end + + if attributes.key?(:'send_from_email_address') + self.send_from_email_address = attributes[:'send_from_email_address'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -132,7 +141,8 @@ def ==(o) api_key_name == o.api_key_name && expiration_seconds == o.expiration_seconds && email_customization == o.email_customization && - invalidate_existing == o.invalidate_existing + invalidate_existing == o.invalidate_existing && + send_from_email_address == o.send_from_email_address end # @see the `==` method @@ -144,7 +154,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [email, target_public_key, api_key_name, expiration_seconds, email_customization, invalidate_existing].hash + [email, target_public_key, api_key_name, expiration_seconds, email_customization, invalidate_existing, send_from_email_address].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/email_auth_intent_v2.rb b/turnkey_client/lib/turnkey_client/models/email_auth_intent_v2.rb index e03d08c..0392339 100644 --- a/turnkey_client/lib/turnkey_client/models/email_auth_intent_v2.rb +++ b/turnkey_client/lib/turnkey_client/models/email_auth_intent_v2.rb @@ -29,6 +29,9 @@ class EmailAuthIntentV2 # Invalidate all other previously generated Email Auth API keys attr_accessor :invalidate_existing + # Optional custom email address from which to send the email + attr_accessor :send_from_email_address + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -37,7 +40,8 @@ def self.attribute_map :'api_key_name' => :'apiKeyName', :'expiration_seconds' => :'expirationSeconds', :'email_customization' => :'emailCustomization', - :'invalidate_existing' => :'invalidateExisting' + :'invalidate_existing' => :'invalidateExisting', + :'send_from_email_address' => :'sendFromEmailAddress' } end @@ -49,7 +53,8 @@ def self.openapi_types :'api_key_name' => :'Object', :'expiration_seconds' => :'Object', :'email_customization' => :'Object', - :'invalidate_existing' => :'Object' + :'invalidate_existing' => :'Object', + :'send_from_email_address' => :'Object' } end @@ -97,6 +102,10 @@ def initialize(attributes = {}) if attributes.key?(:'invalidate_existing') self.invalidate_existing = attributes[:'invalidate_existing'] end + + if attributes.key?(:'send_from_email_address') + self.send_from_email_address = attributes[:'send_from_email_address'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -132,7 +141,8 @@ def ==(o) api_key_name == o.api_key_name && expiration_seconds == o.expiration_seconds && email_customization == o.email_customization && - invalidate_existing == o.invalidate_existing + invalidate_existing == o.invalidate_existing && + send_from_email_address == o.send_from_email_address end # @see the `==` method @@ -144,7 +154,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [email, target_public_key, api_key_name, expiration_seconds, email_customization, invalidate_existing].hash + [email, target_public_key, api_key_name, expiration_seconds, email_customization, invalidate_existing, send_from_email_address].hash end # Builds the object from hash 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 2b55dbd..e3a2dad 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 @@ -25,6 +25,9 @@ class InitOtpAuthIntent # Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. attr_accessor :user_identifier + # Optional custom email address from which to send the OTP email + attr_accessor :send_from_email_address + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -32,7 +35,8 @@ def self.attribute_map :'contact' => :'contact', :'email_customization' => :'emailCustomization', :'sms_customization' => :'smsCustomization', - :'user_identifier' => :'userIdentifier' + :'user_identifier' => :'userIdentifier', + :'send_from_email_address' => :'sendFromEmailAddress' } end @@ -43,7 +47,8 @@ def self.openapi_types :'contact' => :'Object', :'email_customization' => :'Object', :'sms_customization' => :'Object', - :'user_identifier' => :'Object' + :'user_identifier' => :'Object', + :'send_from_email_address' => :'Object' } end @@ -87,6 +92,10 @@ def initialize(attributes = {}) if attributes.key?(:'user_identifier') self.user_identifier = attributes[:'user_identifier'] end + + if attributes.key?(:'send_from_email_address') + self.send_from_email_address = attributes[:'send_from_email_address'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -121,7 +130,8 @@ def ==(o) contact == o.contact && email_customization == o.email_customization && sms_customization == o.sms_customization && - user_identifier == o.user_identifier + user_identifier == o.user_identifier && + send_from_email_address == o.send_from_email_address end # @see the `==` method @@ -133,7 +143,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [otp_type, contact, email_customization, sms_customization, user_identifier].hash + [otp_type, contact, email_customization, sms_customization, user_identifier, send_from_email_address].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 9b8c6c2..dd406d7 100644 --- a/turnkey_client/lib/turnkey_client/models/intent.rb +++ b/turnkey_client/lib/turnkey_client/models/intent.rb @@ -170,6 +170,8 @@ class Intent attr_accessor :create_sub_organization_intent_v7 + attr_accessor :update_wallet_intent + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -251,7 +253,8 @@ def self.attribute_map :'delete_sub_organization_intent' => :'deleteSubOrganizationIntent', :'init_otp_auth_intent' => :'initOtpAuthIntent', :'otp_auth_intent' => :'otpAuthIntent', - :'create_sub_organization_intent_v7' => :'createSubOrganizationIntentV7' + :'create_sub_organization_intent_v7' => :'createSubOrganizationIntentV7', + :'update_wallet_intent' => :'updateWalletIntent' } end @@ -336,7 +339,8 @@ def self.openapi_types :'delete_sub_organization_intent' => :'Object', :'init_otp_auth_intent' => :'Object', :'otp_auth_intent' => :'Object', - :'create_sub_organization_intent_v7' => :'Object' + :'create_sub_organization_intent_v7' => :'Object', + :'update_wallet_intent' => :'Object' } end @@ -676,6 +680,10 @@ def initialize(attributes = {}) if attributes.key?(:'create_sub_organization_intent_v7') self.create_sub_organization_intent_v7 = attributes[:'create_sub_organization_intent_v7'] end + + if attributes.key?(:'update_wallet_intent') + self.update_wallet_intent = attributes[:'update_wallet_intent'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -774,7 +782,8 @@ def ==(o) delete_sub_organization_intent == o.delete_sub_organization_intent && init_otp_auth_intent == o.init_otp_auth_intent && otp_auth_intent == o.otp_auth_intent && - create_sub_organization_intent_v7 == o.create_sub_organization_intent_v7 + create_sub_organization_intent_v7 == o.create_sub_organization_intent_v7 && + update_wallet_intent == o.update_wallet_intent end # @see the `==` method @@ -786,7 +795,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].hash + [create_organization_intent, create_authenticators_intent, create_users_intent, create_private_keys_intent, sign_raw_payload_intent, create_invitations_intent, accept_invitation_intent, create_policy_intent, disable_private_key_intent, delete_users_intent, delete_authenticators_intent, delete_invitation_intent, delete_organization_intent, delete_policy_intent, create_user_tag_intent, delete_user_tags_intent, sign_transaction_intent, create_api_keys_intent, delete_api_keys_intent, approve_activity_intent, reject_activity_intent, create_private_key_tag_intent, delete_private_key_tags_intent, create_policy_intent_v2, set_payment_method_intent, activate_billing_tier_intent, delete_payment_method_intent, create_policy_intent_v3, create_api_only_users_intent, update_root_quorum_intent, update_user_tag_intent, update_private_key_tag_intent, create_authenticators_intent_v2, accept_invitation_intent_v2, create_organization_intent_v2, create_users_intent_v2, create_sub_organization_intent, create_sub_organization_intent_v2, update_allowed_origins_intent, create_private_keys_intent_v2, update_user_intent, update_policy_intent, set_payment_method_intent_v2, create_sub_organization_intent_v3, create_wallet_intent, create_wallet_accounts_intent, init_user_email_recovery_intent, recover_user_intent, set_organization_feature_intent, remove_organization_feature_intent, sign_raw_payload_intent_v2, sign_transaction_intent_v2, export_private_key_intent, export_wallet_intent, create_sub_organization_intent_v4, email_auth_intent, export_wallet_account_intent, init_import_wallet_intent, import_wallet_intent, init_import_private_key_intent, import_private_key_intent, create_policies_intent, sign_raw_payloads_intent, create_read_only_session_intent, create_oauth_providers_intent, delete_oauth_providers_intent, create_sub_organization_intent_v5, oauth_intent, create_api_keys_intent_v2, create_read_write_session_intent, email_auth_intent_v2, create_sub_organization_intent_v6, delete_private_keys_intent, delete_wallets_intent, create_read_write_session_intent_v2, delete_sub_organization_intent, init_otp_auth_intent, otp_auth_intent, create_sub_organization_intent_v7, update_wallet_intent].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/result.rb b/turnkey_client/lib/turnkey_client/models/result.rb index 522fb63..58b5ae2 100644 --- a/turnkey_client/lib/turnkey_client/models/result.rb +++ b/turnkey_client/lib/turnkey_client/models/result.rb @@ -142,6 +142,8 @@ class Result attr_accessor :create_sub_organization_result_v7 + attr_accessor :update_wallet_result + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -209,7 +211,8 @@ def self.attribute_map :'delete_sub_organization_result' => :'deleteSubOrganizationResult', :'init_otp_auth_result' => :'initOtpAuthResult', :'otp_auth_result' => :'otpAuthResult', - :'create_sub_organization_result_v7' => :'createSubOrganizationResultV7' + :'create_sub_organization_result_v7' => :'createSubOrganizationResultV7', + :'update_wallet_result' => :'updateWalletResult' } end @@ -280,7 +283,8 @@ def self.openapi_types :'delete_sub_organization_result' => :'Object', :'init_otp_auth_result' => :'Object', :'otp_auth_result' => :'Object', - :'create_sub_organization_result_v7' => :'Object' + :'create_sub_organization_result_v7' => :'Object', + :'update_wallet_result' => :'Object' } end @@ -564,6 +568,10 @@ def initialize(attributes = {}) if attributes.key?(:'create_sub_organization_result_v7') self.create_sub_organization_result_v7 = attributes[:'create_sub_organization_result_v7'] end + + if attributes.key?(:'update_wallet_result') + self.update_wallet_result = attributes[:'update_wallet_result'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -648,7 +656,8 @@ def ==(o) delete_sub_organization_result == o.delete_sub_organization_result && init_otp_auth_result == o.init_otp_auth_result && otp_auth_result == o.otp_auth_result && - create_sub_organization_result_v7 == o.create_sub_organization_result_v7 + create_sub_organization_result_v7 == o.create_sub_organization_result_v7 && + update_wallet_result == o.update_wallet_result end # @see the `==` method @@ -660,7 +669,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].hash + [create_organization_result, create_authenticators_result, create_users_result, create_private_keys_result, create_invitations_result, accept_invitation_result, sign_raw_payload_result, create_policy_result, disable_private_key_result, delete_users_result, delete_authenticators_result, delete_invitation_result, delete_organization_result, delete_policy_result, create_user_tag_result, delete_user_tags_result, sign_transaction_result, delete_api_keys_result, create_api_keys_result, create_private_key_tag_result, delete_private_key_tags_result, set_payment_method_result, activate_billing_tier_result, delete_payment_method_result, create_api_only_users_result, update_root_quorum_result, update_user_tag_result, update_private_key_tag_result, create_sub_organization_result, update_allowed_origins_result, create_private_keys_result_v2, update_user_result, update_policy_result, create_sub_organization_result_v3, create_wallet_result, create_wallet_accounts_result, init_user_email_recovery_result, recover_user_result, set_organization_feature_result, remove_organization_feature_result, export_private_key_result, export_wallet_result, create_sub_organization_result_v4, email_auth_result, export_wallet_account_result, init_import_wallet_result, import_wallet_result, init_import_private_key_result, import_private_key_result, create_policies_result, sign_raw_payloads_result, create_read_only_session_result, create_oauth_providers_result, delete_oauth_providers_result, create_sub_organization_result_v5, oauth_result, create_read_write_session_result, create_sub_organization_result_v6, delete_private_keys_result, delete_wallets_result, create_read_write_session_result_v2, delete_sub_organization_result, init_otp_auth_result, otp_auth_result, create_sub_organization_result_v7, update_wallet_result].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/update_wallet_intent.rb b/turnkey_client/lib/turnkey_client/models/update_wallet_intent.rb new file mode 100644 index 0000000..e02f05e --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_wallet_intent.rb @@ -0,0 +1,221 @@ +=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 UpdateWalletIntent + # Unique identifier for a given Wallet. + attr_accessor :wallet_id + + # Human-readable name for a Wallet. + attr_accessor :wallet_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'wallet_id' => :'walletId', + :'wallet_name' => :'walletName' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'wallet_id' => :'Object', + :'wallet_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::UpdateWalletIntent` 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::UpdateWalletIntent`. 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?(:'wallet_id') + self.wallet_id = attributes[:'wallet_id'] + end + + if attributes.key?(:'wallet_name') + self.wallet_name = attributes[:'wallet_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 @wallet_id.nil? + invalid_properties.push('invalid value for "wallet_id", wallet_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 @wallet_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 && + wallet_id == o.wallet_id && + wallet_name == o.wallet_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 + [wallet_id, wallet_name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/update_wallet_request.rb b/turnkey_client/lib/turnkey_client/models/update_wallet_request.rb new file mode 100644 index 0000000..280d1bf --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_wallet_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 UpdateWalletRequest + 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::UpdateWalletRequest` 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::UpdateWalletRequest`. 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_WALLET']) + 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_WALLET']) + 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_wallet_result.rb b/turnkey_client/lib/turnkey_client/models/update_wallet_result.rb new file mode 100644 index 0000000..f0c55b1 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/update_wallet_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 UpdateWalletResult + # A Wallet ID. + attr_accessor :wallet_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'wallet_id' => :'walletId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'wallet_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::UpdateWalletResult` 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::UpdateWalletResult`. 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?(:'wallet_id') + self.wallet_id = attributes[:'wallet_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 @wallet_id.nil? + invalid_properties.push('invalid value for "wallet_id", wallet_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 @wallet_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 && + wallet_id == o.wallet_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 + [wallet_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/version.rb b/turnkey_client/lib/turnkey_client/version.rb index fabe939..4102e07 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.11' + VERSION = '0.0.12' end diff --git a/turnkey_client_inputs/config.json b/turnkey_client_inputs/config.json index 3ed16d8..1b65f7a 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.11" + "gemVersion": "0.0.12" } diff --git a/turnkey_client_inputs/public_api.swagger.json b/turnkey_client_inputs/public_api.swagger.json index 6d9d912..3f9c9b7 100644 --- a/turnkey_client_inputs/public_api.swagger.json +++ b/turnkey_client_inputs/public_api.swagger.json @@ -1962,6 +1962,32 @@ ], "tags": ["User Tags"] } + }, + "/public/v1/submit/update_wallet": { + "post": { + "summary": "Update Wallet", + "description": "Update a wallet for an organization", + "operationId": "UpdateWallet", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateWalletRequest" + } + } + ], + "tags": ["Wallets"] + } } }, "definitions": { @@ -2212,7 +2238,8 @@ "ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION", "ACTIVITY_TYPE_INIT_OTP_AUTH", "ACTIVITY_TYPE_OTP_AUTH", - "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7" + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7", + "ACTIVITY_TYPE_UPDATE_WALLET" ] }, "AddressFormat": { @@ -4617,6 +4644,10 @@ "invalidateExisting": { "type": "boolean", "description": "Invalidate all other previously generated Email Auth API keys" + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Optional custom email address from which to send the email" } }, "required": ["email", "targetPublicKey"] @@ -4647,6 +4678,10 @@ "invalidateExisting": { "type": "boolean", "description": "Invalidate all other previously generated Email Auth API keys" + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Optional custom email address from which to send the email" } }, "required": ["email", "targetPublicKey"] @@ -5670,6 +5705,10 @@ "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." + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Optional custom email address from which to send the OTP email" } }, "required": ["otpType", "contact"] @@ -5997,6 +6036,9 @@ }, "createSubOrganizationIntentV7": { "$ref": "#/definitions/CreateSubOrganizationIntentV7" + }, + "updateWalletIntent": { + "$ref": "#/definitions/UpdateWalletIntent" } } }, @@ -6825,6 +6867,9 @@ }, "createSubOrganizationResultV7": { "$ref": "#/definitions/CreateSubOrganizationResultV7" + }, + "updateWalletResult": { + "$ref": "#/definitions/UpdateWalletResult" } } }, @@ -7681,6 +7726,51 @@ }, "required": ["userTagId"] }, + "UpdateWalletIntent": { + "type": "object", + "properties": { + "walletId": { + "type": "string", + "description": "Unique identifier for a given Wallet." + }, + "walletName": { + "type": "string", + "description": "Human-readable name for a Wallet." + } + }, + "required": ["walletId"] + }, + "UpdateWalletRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_WALLET"] + }, + "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/UpdateWalletIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "UpdateWalletResult": { + "type": "object", + "properties": { + "walletId": { + "type": "string", + "description": "A Wallet ID." + } + }, + "required": ["walletId"] + }, "User": { "type": "object", "properties": {