From 6f21a3e2eaab119cb592d799bd96751473b9d957 Mon Sep 17 00:00:00 2001 From: Andrew Min Date: Wed, 2 Oct 2024 17:58:08 -0400 Subject: [PATCH] release v2024.9.31 --- turnkey_client/.swagger-codegen/VERSION | 2 +- turnkey_client/lib/turnkey_client.rb | 5 + .../turnkey_client/api/organizations_api.rb | 58 ++++ .../turnkey_client/api/private_keys_api.rb | 4 +- .../lib/turnkey_client/api/wallets_api.rb | 4 +- .../turnkey_client/models/activity_type.rb | 2 + .../turnkey_client/models/address_format.rb | 22 ++ .../create_read_write_session_intent_v2.rb | 241 +++++++++++++++ .../create_read_write_session_request.rb | 4 +- .../create_read_write_session_result_v2.rb | 286 +++++++++++++++++ .../models/delete_sub_organization_intent.rb | 206 +++++++++++++ .../models/delete_sub_organization_request.rb | 288 ++++++++++++++++++ .../models/delete_sub_organization_result.rb | 211 +++++++++++++ .../lib/turnkey_client/models/intent.rb | 26 +- .../lib/turnkey_client/models/result.rb | 26 +- .../turnkey_client/models/transaction_type.rb | 3 +- turnkey_client_inputs/public_api.swagger.json | 175 ++++++++++- 17 files changed, 1540 insertions(+), 23 deletions(-) create mode 100644 turnkey_client/lib/turnkey_client/models/create_read_write_session_intent_v2.rb create mode 100644 turnkey_client/lib/turnkey_client/models/create_read_write_session_result_v2.rb create mode 100644 turnkey_client/lib/turnkey_client/models/delete_sub_organization_intent.rb create mode 100644 turnkey_client/lib/turnkey_client/models/delete_sub_organization_request.rb create mode 100644 turnkey_client/lib/turnkey_client/models/delete_sub_organization_result.rb diff --git a/turnkey_client/.swagger-codegen/VERSION b/turnkey_client/.swagger-codegen/VERSION index 22a2403..3041e12 100644 --- a/turnkey_client/.swagger-codegen/VERSION +++ b/turnkey_client/.swagger-codegen/VERSION @@ -1 +1 @@ -3.0.61 \ No newline at end of file +3.0.58 \ No newline at end of file diff --git a/turnkey_client/lib/turnkey_client.rb b/turnkey_client/lib/turnkey_client.rb index b01e22a..d6c3662 100644 --- a/turnkey_client/lib/turnkey_client.rb +++ b/turnkey_client/lib/turnkey_client.rb @@ -81,8 +81,10 @@ require 'turnkey_client/models/create_read_only_session_request' require 'turnkey_client/models/create_read_only_session_result' require 'turnkey_client/models/create_read_write_session_intent' +require 'turnkey_client/models/create_read_write_session_intent_v2' require 'turnkey_client/models/create_read_write_session_request' require 'turnkey_client/models/create_read_write_session_result' +require 'turnkey_client/models/create_read_write_session_result_v2' require 'turnkey_client/models/create_sub_organization_intent' require 'turnkey_client/models/create_sub_organization_intent_v2' require 'turnkey_client/models/create_sub_organization_intent_v3' @@ -137,6 +139,9 @@ require 'turnkey_client/models/delete_private_keys_intent' require 'turnkey_client/models/delete_private_keys_request' require 'turnkey_client/models/delete_private_keys_result' +require 'turnkey_client/models/delete_sub_organization_intent' +require 'turnkey_client/models/delete_sub_organization_request' +require 'turnkey_client/models/delete_sub_organization_result' require 'turnkey_client/models/delete_user_tags_intent' require 'turnkey_client/models/delete_user_tags_request' require 'turnkey_client/models/delete_user_tags_result' diff --git a/turnkey_client/lib/turnkey_client/api/organizations_api.rb b/turnkey_client/lib/turnkey_client/api/organizations_api.rb index 00470b4..5a47bcc 100644 --- a/turnkey_client/lib/turnkey_client/api/organizations_api.rb +++ b/turnkey_client/lib/turnkey_client/api/organizations_api.rb @@ -73,6 +73,64 @@ def create_sub_organization_with_http_info(body, opts = {}) end return data, status_code, headers end + # Delete Sub Organization + # Deletes a sub organization + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def delete_sub_organization(body, opts = {}) + data, _status_code, _headers = delete_sub_organization_with_http_info(body, opts) + data + end + + # Delete Sub Organization + # Deletes a sub organization + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def delete_sub_organization_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrganizationsApi.delete_sub_organization ...' + 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.delete_sub_organization" + end + # resource path + local_var_path = '/public/v1/submit/delete_sub_organization' + + # 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: OrganizationsApi#delete_sub_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end # Get Configs # Get quorum settings and features for an organization # @param body diff --git a/turnkey_client/lib/turnkey_client/api/private_keys_api.rb b/turnkey_client/lib/turnkey_client/api/private_keys_api.rb index e2c8e91..44bbf3f 100644 --- a/turnkey_client/lib/turnkey_client/api/private_keys_api.rb +++ b/turnkey_client/lib/turnkey_client/api/private_keys_api.rb @@ -73,7 +73,7 @@ def create_private_keys_with_http_info(body, opts = {}) end return data, status_code, headers end - # Delete organization private keys + # Delete Private Keys # Deletes private keys for an organization # @param body # @param [Hash] opts the optional parameters @@ -83,7 +83,7 @@ def delete_private_keys(body, opts = {}) data end - # Delete organization private keys + # Delete Private Keys # Deletes private keys for an organization # @param body # @param [Hash] opts the optional parameters diff --git a/turnkey_client/lib/turnkey_client/api/wallets_api.rb b/turnkey_client/lib/turnkey_client/api/wallets_api.rb index 9eebc9a..4af1a24 100644 --- a/turnkey_client/lib/turnkey_client/api/wallets_api.rb +++ b/turnkey_client/lib/turnkey_client/api/wallets_api.rb @@ -131,7 +131,7 @@ def create_wallet_accounts_with_http_info(body, opts = {}) end return data, status_code, headers end - # Delete organization wallets + # Delete Wallets # Deletes wallets for an organization # @param body # @param [Hash] opts the optional parameters @@ -141,7 +141,7 @@ def delete_wallets(body, opts = {}) data end - # Delete organization wallets + # Delete Wallets # Deletes wallets for an organization # @param body # @param [Hash] opts the optional parameters diff --git a/turnkey_client/lib/turnkey_client/models/activity_type.rb b/turnkey_client/lib/turnkey_client/models/activity_type.rb index d4827a2..af741ce 100644 --- a/turnkey_client/lib/turnkey_client/models/activity_type.rb +++ b/turnkey_client/lib/turnkey_client/models/activity_type.rb @@ -86,6 +86,8 @@ class ActivityType CREATE_SUB_ORGANIZATION_V6 = 'ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6'.freeze DELETE_PRIVATE_KEYS = 'ACTIVITY_TYPE_DELETE_PRIVATE_KEYS'.freeze DELETE_WALLETS = 'ACTIVITY_TYPE_DELETE_WALLETS'.freeze + CREATE_READ_WRITE_SESSION_V2 = 'ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2'.freeze + DELETE_SUB_ORGANIZATION = 'ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION'.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/address_format.rb b/turnkey_client/lib/turnkey_client/models/address_format.rb index f918dbe..526ed0e 100644 --- a/turnkey_client/lib/turnkey_client/models/address_format.rb +++ b/turnkey_client/lib/turnkey_client/models/address_format.rb @@ -18,6 +18,28 @@ class AddressFormat SOLANA = 'ADDRESS_FORMAT_SOLANA'.freeze COSMOS = 'ADDRESS_FORMAT_COSMOS'.freeze TRON = 'ADDRESS_FORMAT_TRON'.freeze + SUI = 'ADDRESS_FORMAT_SUI'.freeze + APTOS = 'ADDRESS_FORMAT_APTOS'.freeze + BITCOIN_MAINNET_P2_PKH = 'ADDRESS_FORMAT_BITCOIN_MAINNET_P2PKH'.freeze + BITCOIN_MAINNET_P2_SH = 'ADDRESS_FORMAT_BITCOIN_MAINNET_P2SH'.freeze + BITCOIN_MAINNET_P2_WPKH = 'ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH'.freeze + BITCOIN_MAINNET_P2_WSH = 'ADDRESS_FORMAT_BITCOIN_MAINNET_P2WSH'.freeze + BITCOIN_MAINNET_P2_TR = 'ADDRESS_FORMAT_BITCOIN_MAINNET_P2TR'.freeze + BITCOIN_TESTNET_P2_PKH = 'ADDRESS_FORMAT_BITCOIN_TESTNET_P2PKH'.freeze + BITCOIN_TESTNET_P2_SH = 'ADDRESS_FORMAT_BITCOIN_TESTNET_P2SH'.freeze + BITCOIN_TESTNET_P2_WPKH = 'ADDRESS_FORMAT_BITCOIN_TESTNET_P2WPKH'.freeze + BITCOIN_TESTNET_P2_WSH = 'ADDRESS_FORMAT_BITCOIN_TESTNET_P2WSH'.freeze + BITCOIN_TESTNET_P2_TR = 'ADDRESS_FORMAT_BITCOIN_TESTNET_P2TR'.freeze + BITCOIN_SIGNET_P2_PKH = 'ADDRESS_FORMAT_BITCOIN_SIGNET_P2PKH'.freeze + BITCOIN_SIGNET_P2_SH = 'ADDRESS_FORMAT_BITCOIN_SIGNET_P2SH'.freeze + BITCOIN_SIGNET_P2_WPKH = 'ADDRESS_FORMAT_BITCOIN_SIGNET_P2WPKH'.freeze + BITCOIN_SIGNET_P2_WSH = 'ADDRESS_FORMAT_BITCOIN_SIGNET_P2WSH'.freeze + BITCOIN_SIGNET_P2_TR = 'ADDRESS_FORMAT_BITCOIN_SIGNET_P2TR'.freeze + BITCOIN_REGTEST_P2_PKH = 'ADDRESS_FORMAT_BITCOIN_REGTEST_P2PKH'.freeze + BITCOIN_REGTEST_P2_SH = 'ADDRESS_FORMAT_BITCOIN_REGTEST_P2SH'.freeze + BITCOIN_REGTEST_P2_WPKH = 'ADDRESS_FORMAT_BITCOIN_REGTEST_P2WPKH'.freeze + BITCOIN_REGTEST_P2_WSH = 'ADDRESS_FORMAT_BITCOIN_REGTEST_P2WSH'.freeze + BITCOIN_REGTEST_P2_TR = 'ADDRESS_FORMAT_BITCOIN_REGTEST_P2TR'.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/create_read_write_session_intent_v2.rb b/turnkey_client/lib/turnkey_client/models/create_read_write_session_intent_v2.rb new file mode 100644 index 0000000..4f10acd --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/create_read_write_session_intent_v2.rb @@ -0,0 +1,241 @@ +=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 CreateReadWriteSessionIntentV2 + # Client-side public key generated by the user, to which the read write session bundle (credentials) will be encrypted. + attr_accessor :target_public_key + + # Unique identifier for a given User. + attr_accessor :user_id + + # Optional human-readable name for an API Key. If none provided, default to Read Write Session - + attr_accessor :api_key_name + + # Expiration window (in seconds) indicating how long the API key is valid. If not provided, a default of 15 minutes will be used. + attr_accessor :expiration_seconds + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'target_public_key' => :'targetPublicKey', + :'user_id' => :'userId', + :'api_key_name' => :'apiKeyName', + :'expiration_seconds' => :'expirationSeconds' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'target_public_key' => :'Object', + :'user_id' => :'Object', + :'api_key_name' => :'Object', + :'expiration_seconds' => :'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::CreateReadWriteSessionIntentV2` 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::CreateReadWriteSessionIntentV2`. 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?(:'target_public_key') + self.target_public_key = attributes[:'target_public_key'] + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'api_key_name') + self.api_key_name = attributes[:'api_key_name'] + end + + if attributes.key?(:'expiration_seconds') + self.expiration_seconds = attributes[:'expiration_seconds'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @target_public_key.nil? + invalid_properties.push('invalid value for "target_public_key", target_public_key cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @target_public_key.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + target_public_key == o.target_public_key && + user_id == o.user_id && + api_key_name == o.api_key_name && + expiration_seconds == o.expiration_seconds + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [target_public_key, user_id, api_key_name, expiration_seconds].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/create_read_write_session_request.rb b/turnkey_client/lib/turnkey_client/models/create_read_write_session_request.rb index b5ba789..df54946 100644 --- a/turnkey_client/lib/turnkey_client/models/create_read_write_session_request.rb +++ b/turnkey_client/lib/turnkey_client/models/create_read_write_session_request.rb @@ -129,7 +129,7 @@ def list_invalid_properties # @return true if the model is valid def valid? return false if @type.nil? - type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION']) + type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2']) return false unless type_validator.valid?(@type) return false if @timestamp_ms.nil? return false if @organization_id.nil? @@ -140,7 +140,7 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION']) + validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2']) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end diff --git a/turnkey_client/lib/turnkey_client/models/create_read_write_session_result_v2.rb b/turnkey_client/lib/turnkey_client/models/create_read_write_session_result_v2.rb new file mode 100644 index 0000000..5259ac2 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/create_read_write_session_result_v2.rb @@ -0,0 +1,286 @@ +=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 CreateReadWriteSessionResultV2 + # Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons. + attr_accessor :organization_id + + # Human-readable name for an Organization. + attr_accessor :organization_name + + # Unique identifier for a given User. + attr_accessor :user_id + + # Human-readable name for a User. + attr_accessor :username + + # Unique identifier for the created API key. + attr_accessor :api_key_id + + # HPKE encrypted credential bundle + attr_accessor :credential_bundle + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'organization_id' => :'organizationId', + :'organization_name' => :'organizationName', + :'user_id' => :'userId', + :'username' => :'username', + :'api_key_id' => :'apiKeyId', + :'credential_bundle' => :'credentialBundle' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'organization_id' => :'Object', + :'organization_name' => :'Object', + :'user_id' => :'Object', + :'username' => :'Object', + :'api_key_id' => :'Object', + :'credential_bundle' => :'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::CreateReadWriteSessionResultV2` 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::CreateReadWriteSessionResultV2`. 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?(:'organization_name') + self.organization_name = attributes[:'organization_name'] + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'username') + self.username = attributes[:'username'] + end + + if attributes.key?(:'api_key_id') + self.api_key_id = attributes[:'api_key_id'] + end + + if attributes.key?(:'credential_bundle') + self.credential_bundle = attributes[:'credential_bundle'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @organization_name.nil? + invalid_properties.push('invalid value for "organization_name", organization_name cannot be nil.') + end + + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + if @username.nil? + invalid_properties.push('invalid value for "username", username cannot be nil.') + end + + if @api_key_id.nil? + invalid_properties.push('invalid value for "api_key_id", api_key_id cannot be nil.') + end + + if @credential_bundle.nil? + invalid_properties.push('invalid value for "credential_bundle", credential_bundle cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @organization_id.nil? + return false if @organization_name.nil? + return false if @user_id.nil? + return false if @username.nil? + return false if @api_key_id.nil? + return false if @credential_bundle.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 && + organization_name == o.organization_name && + user_id == o.user_id && + username == o.username && + api_key_id == o.api_key_id && + credential_bundle == o.credential_bundle + 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, organization_name, user_id, username, api_key_id, credential_bundle].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/delete_sub_organization_intent.rb b/turnkey_client/lib/turnkey_client/models/delete_sub_organization_intent.rb new file mode 100644 index 0000000..54a6029 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/delete_sub_organization_intent.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 DeleteSubOrganizationIntent + # Sub-organization deletion, by default, requires associated wallets and private keys to be exported for security reasons. Set this boolean to true to force sub-organization deletion even if some wallets or private keys within it have not been exported yet. Default: false. + attr_accessor :delete_without_export + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'delete_without_export' => :'deleteWithoutExport' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'delete_without_export' => :'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::DeleteSubOrganizationIntent` 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::DeleteSubOrganizationIntent`. 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?(:'delete_without_export') + self.delete_without_export = attributes[:'delete_without_export'] + 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 && + delete_without_export == o.delete_without_export + 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 + [delete_without_export].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/delete_sub_organization_request.rb b/turnkey_client/lib/turnkey_client/models/delete_sub_organization_request.rb new file mode 100644 index 0000000..77504ed --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/delete_sub_organization_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 DeleteSubOrganizationRequest + 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::DeleteSubOrganizationRequest` 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::DeleteSubOrganizationRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'timestamp_ms') + self.timestamp_ms = attributes[:'timestamp_ms'] + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @timestamp_ms.nil? + invalid_properties.push('invalid value for "timestamp_ms", timestamp_ms cannot be nil.') + end + + if @organization_id.nil? + invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') + end + + if @parameters.nil? + invalid_properties.push('invalid value for "parameters", parameters cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION']) + return false unless type_validator.valid?(@type) + return false if @timestamp_ms.nil? + return false if @organization_id.nil? + return false if @parameters.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION']) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + timestamp_ms == o.timestamp_ms && + organization_id == o.organization_id && + parameters == o.parameters + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, timestamp_ms, organization_id, parameters].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/delete_sub_organization_result.rb b/turnkey_client/lib/turnkey_client/models/delete_sub_organization_result.rb new file mode 100644 index 0000000..6639fd2 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/delete_sub_organization_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 DeleteSubOrganizationResult + # Unique identifier of the sub organization that was removed + attr_accessor :sub_organization_uuid + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'sub_organization_uuid' => :'subOrganizationUuid' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'sub_organization_uuid' => :'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::DeleteSubOrganizationResult` 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::DeleteSubOrganizationResult`. 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?(:'sub_organization_uuid') + self.sub_organization_uuid = attributes[:'sub_organization_uuid'] + 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 @sub_organization_uuid.nil? + invalid_properties.push('invalid value for "sub_organization_uuid", sub_organization_uuid 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 @sub_organization_uuid.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 && + sub_organization_uuid == o.sub_organization_uuid + 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 + [sub_organization_uuid].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/intent.rb b/turnkey_client/lib/turnkey_client/models/intent.rb index d64f8bd..023f036 100644 --- a/turnkey_client/lib/turnkey_client/models/intent.rb +++ b/turnkey_client/lib/turnkey_client/models/intent.rb @@ -160,6 +160,10 @@ class Intent attr_accessor :delete_wallets_intent + attr_accessor :create_read_write_session_intent_v2 + + attr_accessor :delete_sub_organization_intent + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -236,7 +240,9 @@ def self.attribute_map :'email_auth_intent_v2' => :'emailAuthIntentV2', :'create_sub_organization_intent_v6' => :'createSubOrganizationIntentV6', :'delete_private_keys_intent' => :'deletePrivateKeysIntent', - :'delete_wallets_intent' => :'deleteWalletsIntent' + :'delete_wallets_intent' => :'deleteWalletsIntent', + :'create_read_write_session_intent_v2' => :'createReadWriteSessionIntentV2', + :'delete_sub_organization_intent' => :'deleteSubOrganizationIntent' } end @@ -316,7 +322,9 @@ def self.openapi_types :'email_auth_intent_v2' => :'Object', :'create_sub_organization_intent_v6' => :'Object', :'delete_private_keys_intent' => :'Object', - :'delete_wallets_intent' => :'Object' + :'delete_wallets_intent' => :'Object', + :'create_read_write_session_intent_v2' => :'Object', + :'delete_sub_organization_intent' => :'Object' } end @@ -636,6 +644,14 @@ def initialize(attributes = {}) if attributes.key?(:'delete_wallets_intent') self.delete_wallets_intent = attributes[:'delete_wallets_intent'] end + + if attributes.key?(:'create_read_write_session_intent_v2') + self.create_read_write_session_intent_v2 = attributes[:'create_read_write_session_intent_v2'] + end + + if attributes.key?(:'delete_sub_organization_intent') + self.delete_sub_organization_intent = attributes[:'delete_sub_organization_intent'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -729,7 +745,9 @@ def ==(o) email_auth_intent_v2 == o.email_auth_intent_v2 && create_sub_organization_intent_v6 == o.create_sub_organization_intent_v6 && delete_private_keys_intent == o.delete_private_keys_intent && - delete_wallets_intent == o.delete_wallets_intent + delete_wallets_intent == o.delete_wallets_intent && + create_read_write_session_intent_v2 == o.create_read_write_session_intent_v2 && + delete_sub_organization_intent == o.delete_sub_organization_intent end # @see the `==` method @@ -741,7 +759,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].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].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 72d8260..c48bda6 100644 --- a/turnkey_client/lib/turnkey_client/models/result.rb +++ b/turnkey_client/lib/turnkey_client/models/result.rb @@ -132,6 +132,10 @@ class Result attr_accessor :delete_wallets_result + attr_accessor :create_read_write_session_result_v2 + + attr_accessor :delete_sub_organization_result + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -194,7 +198,9 @@ def self.attribute_map :'create_read_write_session_result' => :'createReadWriteSessionResult', :'create_sub_organization_result_v6' => :'createSubOrganizationResultV6', :'delete_private_keys_result' => :'deletePrivateKeysResult', - :'delete_wallets_result' => :'deleteWalletsResult' + :'delete_wallets_result' => :'deleteWalletsResult', + :'create_read_write_session_result_v2' => :'createReadWriteSessionResultV2', + :'delete_sub_organization_result' => :'deleteSubOrganizationResult' } end @@ -260,7 +266,9 @@ def self.openapi_types :'create_read_write_session_result' => :'Object', :'create_sub_organization_result_v6' => :'Object', :'delete_private_keys_result' => :'Object', - :'delete_wallets_result' => :'Object' + :'delete_wallets_result' => :'Object', + :'create_read_write_session_result_v2' => :'Object', + :'delete_sub_organization_result' => :'Object' } end @@ -524,6 +532,14 @@ def initialize(attributes = {}) if attributes.key?(:'delete_wallets_result') self.delete_wallets_result = attributes[:'delete_wallets_result'] end + + if attributes.key?(:'create_read_write_session_result_v2') + self.create_read_write_session_result_v2 = attributes[:'create_read_write_session_result_v2'] + end + + if attributes.key?(:'delete_sub_organization_result') + self.delete_sub_organization_result = attributes[:'delete_sub_organization_result'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -603,7 +619,9 @@ def ==(o) create_read_write_session_result == o.create_read_write_session_result && create_sub_organization_result_v6 == o.create_sub_organization_result_v6 && delete_private_keys_result == o.delete_private_keys_result && - delete_wallets_result == o.delete_wallets_result + delete_wallets_result == o.delete_wallets_result && + create_read_write_session_result_v2 == o.create_read_write_session_result_v2 && + delete_sub_organization_result == o.delete_sub_organization_result end # @see the `==` method @@ -615,7 +633,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].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].hash end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/models/transaction_type.rb b/turnkey_client/lib/turnkey_client/models/transaction_type.rb index 0fa63c9..a287934 100644 --- a/turnkey_client/lib/turnkey_client/models/transaction_type.rb +++ b/turnkey_client/lib/turnkey_client/models/transaction_type.rb @@ -12,7 +12,8 @@ module TurnkeyClient class TransactionType - TRANSACTION_TYPE_ETHEREUM = 'TRANSACTION_TYPE_ETHEREUM'.freeze + ETHEREUM = 'TRANSACTION_TYPE_ETHEREUM'.freeze + SOLANA = 'TRANSACTION_TYPE_SOLANA'.freeze # Builds the enum from string # @param [String] The enum value in the form of the string diff --git a/turnkey_client_inputs/public_api.swagger.json b/turnkey_client_inputs/public_api.swagger.json index d116262..019eb65 100644 --- a/turnkey_client_inputs/public_api.swagger.json +++ b/turnkey_client_inputs/public_api.swagger.json @@ -1185,7 +1185,7 @@ }, "/public/v1/submit/delete_private_keys": { "post": { - "summary": "Delete organization private keys", + "summary": "Delete Private Keys", "description": "Deletes private keys for an organization", "operationId": "DeletePrivateKeys", "responses": { @@ -1209,6 +1209,32 @@ "tags": ["Private Keys"] } }, + "/public/v1/submit/delete_sub_organization": { + "post": { + "summary": "Delete Sub Organization", + "description": "Deletes a sub organization", + "operationId": "DeleteSubOrganization", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteSubOrganizationRequest" + } + } + ], + "tags": ["Organizations"] + } + }, "/public/v1/submit/delete_user_tags": { "post": { "summary": "Delete User Tags", @@ -1263,7 +1289,7 @@ }, "/public/v1/submit/delete_wallets": { "post": { - "summary": "Delete organization wallets", + "summary": "Delete Wallets", "description": "Deletes wallets for an organization", "operationId": "DeleteWallets", "responses": { @@ -2103,7 +2129,9 @@ "ACTIVITY_TYPE_EMAIL_AUTH_V2", "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6", "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS", - "ACTIVITY_TYPE_DELETE_WALLETS" + "ACTIVITY_TYPE_DELETE_WALLETS", + "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2", + "ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION" ] }, "AddressFormat": { @@ -2114,7 +2142,29 @@ "ADDRESS_FORMAT_ETHEREUM", "ADDRESS_FORMAT_SOLANA", "ADDRESS_FORMAT_COSMOS", - "ADDRESS_FORMAT_TRON" + "ADDRESS_FORMAT_TRON", + "ADDRESS_FORMAT_SUI", + "ADDRESS_FORMAT_APTOS", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2PKH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2SH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WSH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2TR", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2PKH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2SH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WSH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2TR", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2PKH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2SH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WSH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2TR", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2PKH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2SH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WSH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2TR" ] }, "Any": { @@ -3133,12 +3183,34 @@ }, "required": ["targetPublicKey", "email"] }, + "CreateReadWriteSessionIntentV2": { + "type": "object", + "properties": { + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the read write session bundle (credentials) will be encrypted." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "apiKeyName": { + "type": "string", + "description": "Optional human-readable name for an API Key. If none provided, default to Read Write Session - \u003cTimestamp\u003e" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the API key is valid. If not provided, a default of 15 minutes will be used." + } + }, + "required": ["targetPublicKey"] + }, "CreateReadWriteSessionRequest": { "type": "object", "properties": { "type": { "type": "string", - "enum": ["ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION"] + "enum": ["ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2"] }, "timestampMs": { "type": "string", @@ -3149,7 +3221,7 @@ "description": "Unique identifier for a given Organization." }, "parameters": { - "$ref": "#/definitions/CreateReadWriteSessionIntent" + "$ref": "#/definitions/CreateReadWriteSessionIntentV2" } }, "required": ["type", "timestampMs", "organizationId", "parameters"] @@ -3191,6 +3263,43 @@ "credentialBundle" ] }, + "CreateReadWriteSessionResultV2": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons." + }, + "organizationName": { + "type": "string", + "description": "Human-readable name for an Organization." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "username": { + "type": "string", + "description": "Human-readable name for a User." + }, + "apiKeyId": { + "type": "string", + "description": "Unique identifier for the created API key." + }, + "credentialBundle": { + "type": "string", + "description": "HPKE encrypted credential bundle" + } + }, + "required": [ + "organizationId", + "organizationName", + "userId", + "username", + "apiKeyId", + "credentialBundle" + ] + }, "CreateSubOrganizationIntent": { "type": "object", "properties": { @@ -4116,6 +4225,46 @@ }, "required": ["privateKeyIds"] }, + "DeleteSubOrganizationIntent": { + "type": "object", + "properties": { + "deleteWithoutExport": { + "type": "boolean", + "description": "Sub-organization deletion, by default, requires associated wallets and private keys to be exported for security reasons. Set this boolean to true to force sub-organization deletion even if some wallets or private keys within it have not been exported yet. Default: false." + } + } + }, + "DeleteSubOrganizationRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION"] + }, + "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/DeleteSubOrganizationIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "DeleteSubOrganizationResult": { + "type": "object", + "properties": { + "subOrganizationUuid": { + "type": "string", + "description": "Unique identifier of the sub organization that was removed" + } + }, + "required": ["subOrganizationUuid"] + }, "DeleteUserTagsIntent": { "type": "object", "properties": { @@ -5589,6 +5738,12 @@ }, "deleteWalletsIntent": { "$ref": "#/definitions/DeleteWalletsIntent" + }, + "createReadWriteSessionIntentV2": { + "$ref": "#/definitions/CreateReadWriteSessionIntentV2" + }, + "deleteSubOrganizationIntent": { + "$ref": "#/definitions/DeleteSubOrganizationIntent" } } }, @@ -6333,6 +6488,12 @@ }, "deleteWalletsResult": { "$ref": "#/definitions/DeleteWalletsResult" + }, + "createReadWriteSessionResultV2": { + "$ref": "#/definitions/CreateReadWriteSessionResultV2" + }, + "deleteSubOrganizationResult": { + "$ref": "#/definitions/DeleteSubOrganizationResult" } } }, @@ -6839,7 +7000,7 @@ }, "TransactionType": { "type": "string", - "enum": ["TRANSACTION_TYPE_ETHEREUM"] + "enum": ["TRANSACTION_TYPE_ETHEREUM", "TRANSACTION_TYPE_SOLANA"] }, "UpdateAllowedOriginsIntent": { "type": "object",