From 8d6ef21ac73c7dc3e2dab1cf712e9281fbfc71eb Mon Sep 17 00:00:00 2001 From: Omkar Shanbhag Date: Fri, 23 Aug 2024 18:12:32 -0400 Subject: [PATCH] release v2024.8.15 --- turnkey_client/.swagger-codegen/VERSION | 2 +- turnkey_client/lib/turnkey_client.rb | 6 + .../turnkey_client/api/private_keys_api.rb | 58 ++++ .../lib/turnkey_client/api/wallets_api.rb | 58 ++++ .../turnkey_client/models/activity_type.rb | 2 + .../models/delete_private_keys_intent.rb | 223 ++++++++++++++ .../models/delete_private_keys_request.rb | 288 ++++++++++++++++++ .../models/delete_private_keys_result.rb | 213 +++++++++++++ .../models/delete_wallets_intent.rb | 223 ++++++++++++++ .../models/delete_wallets_request.rb | 288 ++++++++++++++++++ .../models/delete_wallets_result.rb | 213 +++++++++++++ .../lib/turnkey_client/models/intent.rb | 26 +- .../lib/turnkey_client/models/result.rb | 26 +- turnkey_client/lib/turnkey_client/version.rb | 2 +- turnkey_client_inputs/config.json | 2 +- turnkey_client_inputs/public_api.swagger.json | 170 ++++++++++- 16 files changed, 1788 insertions(+), 12 deletions(-) create mode 100644 turnkey_client/lib/turnkey_client/models/delete_private_keys_intent.rb create mode 100644 turnkey_client/lib/turnkey_client/models/delete_private_keys_request.rb create mode 100644 turnkey_client/lib/turnkey_client/models/delete_private_keys_result.rb create mode 100644 turnkey_client/lib/turnkey_client/models/delete_wallets_intent.rb create mode 100644 turnkey_client/lib/turnkey_client/models/delete_wallets_request.rb create mode 100644 turnkey_client/lib/turnkey_client/models/delete_wallets_result.rb diff --git a/turnkey_client/.swagger-codegen/VERSION b/turnkey_client/.swagger-codegen/VERSION index 3041e12..22a2403 100644 --- a/turnkey_client/.swagger-codegen/VERSION +++ b/turnkey_client/.swagger-codegen/VERSION @@ -1 +1 @@ -3.0.58 \ No newline at end of file +3.0.61 \ No newline at end of file diff --git a/turnkey_client/lib/turnkey_client.rb b/turnkey_client/lib/turnkey_client.rb index dea3b92..b01e22a 100644 --- a/turnkey_client/lib/turnkey_client.rb +++ b/turnkey_client/lib/turnkey_client.rb @@ -134,12 +134,18 @@ require 'turnkey_client/models/delete_private_key_tags_intent' require 'turnkey_client/models/delete_private_key_tags_request' require 'turnkey_client/models/delete_private_key_tags_result' +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_user_tags_intent' require 'turnkey_client/models/delete_user_tags_request' require 'turnkey_client/models/delete_user_tags_result' require 'turnkey_client/models/delete_users_intent' require 'turnkey_client/models/delete_users_request' require 'turnkey_client/models/delete_users_result' +require 'turnkey_client/models/delete_wallets_intent' +require 'turnkey_client/models/delete_wallets_request' +require 'turnkey_client/models/delete_wallets_result' require 'turnkey_client/models/disable_private_key_intent' require 'turnkey_client/models/disable_private_key_result' require 'turnkey_client/models/effect' 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 5530744..e2c8e91 100644 --- a/turnkey_client/lib/turnkey_client/api/private_keys_api.rb +++ b/turnkey_client/lib/turnkey_client/api/private_keys_api.rb @@ -73,6 +73,64 @@ def create_private_keys_with_http_info(body, opts = {}) end return data, status_code, headers end + # Delete organization private keys + # Deletes private keys for an organization + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def delete_private_keys(body, opts = {}) + data, _status_code, _headers = delete_private_keys_with_http_info(body, opts) + data + end + + # Delete organization private keys + # Deletes private keys for an organization + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def delete_private_keys_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PrivateKeysApi.delete_private_keys ...' + 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 PrivateKeysApi.delete_private_keys" + end + # resource path + local_var_path = '/public/v1/submit/delete_private_keys' + + # 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: PrivateKeysApi#delete_private_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end # Export Private Key # Exports a Private Key # @param body diff --git a/turnkey_client/lib/turnkey_client/api/wallets_api.rb b/turnkey_client/lib/turnkey_client/api/wallets_api.rb index 5b18ef5..9eebc9a 100644 --- a/turnkey_client/lib/turnkey_client/api/wallets_api.rb +++ b/turnkey_client/lib/turnkey_client/api/wallets_api.rb @@ -131,6 +131,64 @@ def create_wallet_accounts_with_http_info(body, opts = {}) end return data, status_code, headers end + # Delete organization wallets + # Deletes wallets for an organization + # @param body + # @param [Hash] opts the optional parameters + # @return [ActivityResponse] + def delete_wallets(body, opts = {}) + data, _status_code, _headers = delete_wallets_with_http_info(body, opts) + data + end + + # Delete organization wallets + # Deletes wallets for an organization + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers + def delete_wallets_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WalletsApi.delete_wallets ...' + 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.delete_wallets" + end + # resource path + local_var_path = '/public/v1/submit/delete_wallets' + + # 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#delete_wallets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end # Export Wallet # Exports a Wallet # @param body diff --git a/turnkey_client/lib/turnkey_client/models/activity_type.rb b/turnkey_client/lib/turnkey_client/models/activity_type.rb index 10c8353..d4827a2 100644 --- a/turnkey_client/lib/turnkey_client/models/activity_type.rb +++ b/turnkey_client/lib/turnkey_client/models/activity_type.rb @@ -84,6 +84,8 @@ class ActivityType CREATE_READ_WRITE_SESSION = 'ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION'.freeze EMAIL_AUTH_V2 = 'ACTIVITY_TYPE_EMAIL_AUTH_V2'.freeze 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 # 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/delete_private_keys_intent.rb b/turnkey_client/lib/turnkey_client/models/delete_private_keys_intent.rb new file mode 100644 index 0000000..3ea9757 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/delete_private_keys_intent.rb @@ -0,0 +1,223 @@ +=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 DeletePrivateKeysIntent + # List of unique identifiers for private keys within an organization + attr_accessor :private_key_ids + + # Optional parameter for deleting the private keys, even if any have not been previously exported. If they have been exported, this field is ignored. + attr_accessor :delete_without_export + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'private_key_ids' => :'privateKeyIds', + :'delete_without_export' => :'deleteWithoutExport' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'private_key_ids' => :'Object', + :'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::DeletePrivateKeysIntent` 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::DeletePrivateKeysIntent`. 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?(:'private_key_ids') + if (value = attributes[:'private_key_ids']).is_a?(Array) + self.private_key_ids = value + end + end + + 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 + if @private_key_ids.nil? + invalid_properties.push('invalid value for "private_key_ids", private_key_ids cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @private_key_ids.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + private_key_ids == o.private_key_ids && + 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 + [private_key_ids, 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_private_keys_request.rb b/turnkey_client/lib/turnkey_client/models/delete_private_keys_request.rb new file mode 100644 index 0000000..32b4442 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/delete_private_keys_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 DeletePrivateKeysRequest + 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::DeletePrivateKeysRequest` 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::DeletePrivateKeysRequest`. 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_PRIVATE_KEYS']) + 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_PRIVATE_KEYS']) + 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_private_keys_result.rb b/turnkey_client/lib/turnkey_client/models/delete_private_keys_result.rb new file mode 100644 index 0000000..aaf3c9a --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/delete_private_keys_result.rb @@ -0,0 +1,213 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class DeletePrivateKeysResult + # A list of private key unique identifiers that were removed + attr_accessor :private_key_ids + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'private_key_ids' => :'privateKeyIds' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'private_key_ids' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::DeletePrivateKeysResult` 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::DeletePrivateKeysResult`. 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?(:'private_key_ids') + if (value = attributes[:'private_key_ids']).is_a?(Array) + self.private_key_ids = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @private_key_ids.nil? + invalid_properties.push('invalid value for "private_key_ids", private_key_ids cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @private_key_ids.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + private_key_ids == o.private_key_ids + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [private_key_ids].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/delete_wallets_intent.rb b/turnkey_client/lib/turnkey_client/models/delete_wallets_intent.rb new file mode 100644 index 0000000..4e25891 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/delete_wallets_intent.rb @@ -0,0 +1,223 @@ +=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 DeleteWalletsIntent + # List of unique identifiers for wallets within an organization + attr_accessor :wallet_ids + + # Optional parameter for deleting the wallets, even if any have not been previously exported. If they have been exported, this field is ignored. + attr_accessor :delete_without_export + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'wallet_ids' => :'walletIds', + :'delete_without_export' => :'deleteWithoutExport' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'wallet_ids' => :'Object', + :'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::DeleteWalletsIntent` 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::DeleteWalletsIntent`. 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_ids') + if (value = attributes[:'wallet_ids']).is_a?(Array) + self.wallet_ids = value + end + end + + 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 + if @wallet_ids.nil? + invalid_properties.push('invalid value for "wallet_ids", wallet_ids cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @wallet_ids.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + wallet_ids == o.wallet_ids && + 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 + [wallet_ids, 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_wallets_request.rb b/turnkey_client/lib/turnkey_client/models/delete_wallets_request.rb new file mode 100644 index 0000000..4413977 --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/delete_wallets_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 DeleteWalletsRequest + 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::DeleteWalletsRequest` 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::DeleteWalletsRequest`. 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_WALLETS']) + 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_WALLETS']) + 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_wallets_result.rb b/turnkey_client/lib/turnkey_client/models/delete_wallets_result.rb new file mode 100644 index 0000000..b4ddf6f --- /dev/null +++ b/turnkey_client/lib/turnkey_client/models/delete_wallets_result.rb @@ -0,0 +1,213 @@ +=begin +#API Reference + +#Review our [API Introduction](../api-introduction) to get started. + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +=end + +require 'date' + +module TurnkeyClient + class DeleteWalletsResult + # A list of wallet unique identifiers that were removed + attr_accessor :wallet_ids + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'wallet_ids' => :'walletIds' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'wallet_ids' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::DeleteWalletsResult` 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::DeleteWalletsResult`. 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_ids') + if (value = attributes[:'wallet_ids']).is_a?(Array) + self.wallet_ids = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @wallet_ids.nil? + invalid_properties.push('invalid value for "wallet_ids", wallet_ids cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @wallet_ids.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + wallet_ids == o.wallet_ids + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [wallet_ids].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + TurnkeyClient.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end end +end diff --git a/turnkey_client/lib/turnkey_client/models/intent.rb b/turnkey_client/lib/turnkey_client/models/intent.rb index a2cba3f..d64f8bd 100644 --- a/turnkey_client/lib/turnkey_client/models/intent.rb +++ b/turnkey_client/lib/turnkey_client/models/intent.rb @@ -156,6 +156,10 @@ class Intent attr_accessor :create_sub_organization_intent_v6 + attr_accessor :delete_private_keys_intent + + attr_accessor :delete_wallets_intent + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -230,7 +234,9 @@ def self.attribute_map :'create_api_keys_intent_v2' => :'createApiKeysIntentV2', :'create_read_write_session_intent' => :'createReadWriteSessionIntent', :'email_auth_intent_v2' => :'emailAuthIntentV2', - :'create_sub_organization_intent_v6' => :'createSubOrganizationIntentV6' + :'create_sub_organization_intent_v6' => :'createSubOrganizationIntentV6', + :'delete_private_keys_intent' => :'deletePrivateKeysIntent', + :'delete_wallets_intent' => :'deleteWalletsIntent' } end @@ -308,7 +314,9 @@ def self.openapi_types :'create_api_keys_intent_v2' => :'Object', :'create_read_write_session_intent' => :'Object', :'email_auth_intent_v2' => :'Object', - :'create_sub_organization_intent_v6' => :'Object' + :'create_sub_organization_intent_v6' => :'Object', + :'delete_private_keys_intent' => :'Object', + :'delete_wallets_intent' => :'Object' } end @@ -620,6 +628,14 @@ def initialize(attributes = {}) if attributes.key?(:'create_sub_organization_intent_v6') self.create_sub_organization_intent_v6 = attributes[:'create_sub_organization_intent_v6'] end + + if attributes.key?(:'delete_private_keys_intent') + self.delete_private_keys_intent = attributes[:'delete_private_keys_intent'] + end + + if attributes.key?(:'delete_wallets_intent') + self.delete_wallets_intent = attributes[:'delete_wallets_intent'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -711,7 +727,9 @@ def ==(o) create_api_keys_intent_v2 == o.create_api_keys_intent_v2 && create_read_write_session_intent == o.create_read_write_session_intent && email_auth_intent_v2 == o.email_auth_intent_v2 && - create_sub_organization_intent_v6 == o.create_sub_organization_intent_v6 + 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 end # @see the `==` method @@ -723,7 +741,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].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 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 bd57732..72d8260 100644 --- a/turnkey_client/lib/turnkey_client/models/result.rb +++ b/turnkey_client/lib/turnkey_client/models/result.rb @@ -128,6 +128,10 @@ class Result attr_accessor :create_sub_organization_result_v6 + attr_accessor :delete_private_keys_result + + attr_accessor :delete_wallets_result + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -188,7 +192,9 @@ def self.attribute_map :'create_sub_organization_result_v5' => :'createSubOrganizationResultV5', :'oauth_result' => :'oauthResult', :'create_read_write_session_result' => :'createReadWriteSessionResult', - :'create_sub_organization_result_v6' => :'createSubOrganizationResultV6' + :'create_sub_organization_result_v6' => :'createSubOrganizationResultV6', + :'delete_private_keys_result' => :'deletePrivateKeysResult', + :'delete_wallets_result' => :'deleteWalletsResult' } end @@ -252,7 +258,9 @@ def self.openapi_types :'create_sub_organization_result_v5' => :'Object', :'oauth_result' => :'Object', :'create_read_write_session_result' => :'Object', - :'create_sub_organization_result_v6' => :'Object' + :'create_sub_organization_result_v6' => :'Object', + :'delete_private_keys_result' => :'Object', + :'delete_wallets_result' => :'Object' } end @@ -508,6 +516,14 @@ def initialize(attributes = {}) if attributes.key?(:'create_sub_organization_result_v6') self.create_sub_organization_result_v6 = attributes[:'create_sub_organization_result_v6'] end + + if attributes.key?(:'delete_private_keys_result') + self.delete_private_keys_result = attributes[:'delete_private_keys_result'] + end + + if attributes.key?(:'delete_wallets_result') + self.delete_wallets_result = attributes[:'delete_wallets_result'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -585,7 +601,9 @@ def ==(o) create_sub_organization_result_v5 == o.create_sub_organization_result_v5 && oauth_result == o.oauth_result && create_read_write_session_result == o.create_read_write_session_result && - create_sub_organization_result_v6 == o.create_sub_organization_result_v6 + 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 end # @see the `==` method @@ -597,7 +615,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].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 end # Builds the object from hash diff --git a/turnkey_client/lib/turnkey_client/version.rb b/turnkey_client/lib/turnkey_client/version.rb index 0172bcf..089b905 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.7' + VERSION = '0.0.8' end diff --git a/turnkey_client_inputs/config.json b/turnkey_client_inputs/config.json index f22c242..871f040 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.7" + "gemVersion": "0.0.8" } diff --git a/turnkey_client_inputs/public_api.swagger.json b/turnkey_client_inputs/public_api.swagger.json index caecb22..d116262 100644 --- a/turnkey_client_inputs/public_api.swagger.json +++ b/turnkey_client_inputs/public_api.swagger.json @@ -1183,6 +1183,32 @@ "tags": ["Private Key Tags"] } }, + "/public/v1/submit/delete_private_keys": { + "post": { + "summary": "Delete organization private keys", + "description": "Deletes private keys for an organization", + "operationId": "DeletePrivateKeys", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeletePrivateKeysRequest" + } + } + ], + "tags": ["Private Keys"] + } + }, "/public/v1/submit/delete_user_tags": { "post": { "summary": "Delete User Tags", @@ -1235,6 +1261,32 @@ "tags": ["Users"] } }, + "/public/v1/submit/delete_wallets": { + "post": { + "summary": "Delete organization wallets", + "description": "Deletes wallets for an organization", + "operationId": "DeleteWallets", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteWalletsRequest" + } + } + ], + "tags": ["Wallets"] + } + }, "/public/v1/submit/email_auth": { "post": { "summary": "Perform Email Auth", @@ -2049,7 +2101,9 @@ "ACTIVITY_TYPE_CREATE_API_KEYS_V2", "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION", "ACTIVITY_TYPE_EMAIL_AUTH_V2", - "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6" + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6", + "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS", + "ACTIVITY_TYPE_DELETE_WALLETS" ] }, "AddressFormat": { @@ -4011,6 +4065,57 @@ }, "required": ["privateKeyTagIds", "privateKeyIds"] }, + "DeletePrivateKeysIntent": { + "type": "object", + "properties": { + "privateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for private keys within an organization" + }, + "deleteWithoutExport": { + "type": "boolean", + "description": "Optional parameter for deleting the private keys, even if any have not been previously exported. If they have been exported, this field is ignored." + } + }, + "required": ["privateKeyIds"] + }, + "DeletePrivateKeysRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_PRIVATE_KEYS"] + }, + "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/DeletePrivateKeysIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "DeletePrivateKeysResult": { + "type": "object", + "properties": { + "privateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of private key unique identifiers that were removed" + } + }, + "required": ["privateKeyIds"] + }, "DeleteUserTagsIntent": { "type": "object", "properties": { @@ -4112,6 +4217,57 @@ }, "required": ["userIds"] }, + "DeleteWalletsIntent": { + "type": "object", + "properties": { + "walletIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for wallets within an organization" + }, + "deleteWithoutExport": { + "type": "boolean", + "description": "Optional parameter for deleting the wallets, even if any have not been previously exported. If they have been exported, this field is ignored." + } + }, + "required": ["walletIds"] + }, + "DeleteWalletsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_WALLETS"] + }, + "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/DeleteWalletsIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "DeleteWalletsResult": { + "type": "object", + "properties": { + "walletIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of wallet unique identifiers that were removed" + } + }, + "required": ["walletIds"] + }, "DisablePrivateKeyIntent": { "type": "object", "properties": { @@ -5427,6 +5583,12 @@ }, "createSubOrganizationIntentV6": { "$ref": "#/definitions/CreateSubOrganizationIntentV6" + }, + "deletePrivateKeysIntent": { + "$ref": "#/definitions/DeletePrivateKeysIntent" + }, + "deleteWalletsIntent": { + "$ref": "#/definitions/DeleteWalletsIntent" } } }, @@ -6165,6 +6327,12 @@ }, "createSubOrganizationResultV6": { "$ref": "#/definitions/CreateSubOrganizationResultV6" + }, + "deletePrivateKeysResult": { + "$ref": "#/definitions/DeletePrivateKeysResult" + }, + "deleteWalletsResult": { + "$ref": "#/definitions/DeleteWalletsResult" } } },