From 35e69a20b0c5bd2a6cf3bdd42d2828f7e5e4096d Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Thu, 26 Aug 2021 20:32:02 -0700 Subject: [PATCH 01/15] Update to generator 5.0.0 --- lib/patch_ruby.rb | 2 +- lib/patch_ruby/api/estimates_api.rb | 2 +- lib/patch_ruby/api/orders_api.rb | 2 +- lib/patch_ruby/api/preferences_api.rb | 2 +- lib/patch_ruby/api/projects_api.rb | 2 +- lib/patch_ruby/api_client.rb | 96 ++++++++++--------- lib/patch_ruby/api_error.rb | 2 +- lib/patch_ruby/configuration.rb | 39 ++++++-- lib/patch_ruby/models/allocation.rb | 30 +++--- .../models/create_bitcoin_estimate_request.rb | 34 ++++--- .../create_ethereum_estimate_request.rb | 38 ++++---- .../models/create_mass_estimate_request.rb | 30 +++--- lib/patch_ruby/models/create_order_request.rb | 34 ++++--- .../models/create_preference_request.rb | 19 ++-- lib/patch_ruby/models/error_response.rb | 30 +++--- lib/patch_ruby/models/estimate.rb | 38 ++++---- .../models/estimate_list_response.rb | 37 +++---- lib/patch_ruby/models/estimate_response.rb | 30 +++--- lib/patch_ruby/models/meta_index_object.rb | 26 +++-- lib/patch_ruby/models/order.rb | 61 ++++++------ lib/patch_ruby/models/order_list_response.rb | 37 +++---- lib/patch_ruby/models/order_response.rb | 30 +++--- lib/patch_ruby/models/photo.rb | 26 +++-- lib/patch_ruby/models/preference.rb | 30 +++--- .../models/preference_list_response.rb | 37 +++---- lib/patch_ruby/models/preference_response.rb | 30 +++--- lib/patch_ruby/models/project.rb | 72 +++++++------- .../models/project_list_response.rb | 37 +++---- lib/patch_ruby/models/project_response.rb | 30 +++--- lib/patch_ruby/models/sdg.rb | 34 ++++--- lib/patch_ruby/models/standard.rb | 30 +++--- spec/api_client_spec.rb | 47 ++++++--- spec/configuration_spec.rb | 2 +- spec/spec_helper.rb | 34 ++----- 34 files changed, 588 insertions(+), 442 deletions(-) diff --git a/lib/patch_ruby.rb b/lib/patch_ruby.rb index 520e35a..f37a4d5 100644 --- a/lib/patch_ruby.rb +++ b/lib/patch_ruby.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end diff --git a/lib/patch_ruby/api/estimates_api.rb b/lib/patch_ruby/api/estimates_api.rb index 1c81b11..ff13da6 100644 --- a/lib/patch_ruby/api/estimates_api.rb +++ b/lib/patch_ruby/api/estimates_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end diff --git a/lib/patch_ruby/api/orders_api.rb b/lib/patch_ruby/api/orders_api.rb index 901c8ad..5e06533 100644 --- a/lib/patch_ruby/api/orders_api.rb +++ b/lib/patch_ruby/api/orders_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end diff --git a/lib/patch_ruby/api/preferences_api.rb b/lib/patch_ruby/api/preferences_api.rb index 4d3f868..4d0dbca 100644 --- a/lib/patch_ruby/api/preferences_api.rb +++ b/lib/patch_ruby/api/preferences_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end diff --git a/lib/patch_ruby/api/projects_api.rb b/lib/patch_ruby/api/projects_api.rb index 15b05c7..d2e2625 100644 --- a/lib/patch_ruby/api/projects_api.rb +++ b/lib/patch_ruby/api/projects_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end diff --git a/lib/patch_ruby/api_client.rb b/lib/patch_ruby/api_client.rb index 517be7d..da4ff2f 100644 --- a/lib/patch_ruby/api_client.rb +++ b/lib/patch_ruby/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end @@ -14,6 +14,7 @@ require 'json' require 'logger' require 'tempfile' +require 'time' require 'typhoeus' module Patch @@ -86,7 +87,7 @@ def call_api(http_method, path, opts = {}) # @option opts [Object] :body HTTP body (JSON/XML) # @return [Typhoeus::Request] A Typhoeus Request def build_request(http_method, path, opts = {}) - url = build_request_url(path) + url = build_request_url(path, opts) http_method = http_method.to_sym.downcase header_params = @default_headers.merge(opts[:header_params] || {}) @@ -155,6 +156,44 @@ def build_request_body(header_params, form_params, body) data end + # Save response body into a file in (the defined) temporary folder, using the filename + # from the "Content-Disposition" header if provided, otherwise a random filename. + # The response body is written to the file in chunks in order to handle files which + # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby + # process can use. + # + # @see Configuration#temp_folder_path + def download_file(request) + tempfile = nil + encoding = nil + request.on_headers do |response| + content_disposition = response.headers['Content-Disposition'] + if content_disposition && content_disposition =~ /filename=/i + filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] + prefix = sanitize_filename(filename) + else + prefix = 'download-' + end + prefix = prefix + '-' unless prefix.end_with?('-') + encoding = response.body.encoding + tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) + @tempfile = tempfile + end + request.on_body do |chunk| + chunk.force_encoding(encoding) + tempfile.write(chunk) + end + request.on_complete do |response| + if tempfile + tempfile.close + @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + end + end + end + # Check if the given MIME is a JSON MIME. # JSON MIME examples: # application/json @@ -191,7 +230,7 @@ def deserialize(response, return_type) begin data = JSON.parse("[#{body}]", :symbolize_names => true)[0] rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) + if %w(String Date Time).include?(return_type) data = body else raise e @@ -216,9 +255,9 @@ def convert_to_type(data, return_type) data.to_f when 'Boolean' data == true - when 'DateTime' + when 'Time' # parse date time (expecting ISO 8601 format) - DateTime.parse data + Time.parse data when 'Date' # parse date time (expecting ISO 8601 format) Date.parse data @@ -236,46 +275,9 @@ def convert_to_type(data, return_type) data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } end else - # models, e.g. Pet - Patch.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end + # models (e.g. Pet) or oneOf + klass = Patch.const_get(return_type) + klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data) end end @@ -288,10 +290,10 @@ def sanitize_filename(filename) filename.gsub(/.*[\/\\]/, '') end - def build_request_url(path) + def build_request_url(path, opts = {}) # Add leading and trailing slashes to path path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path + @config.base_url(opts[:operation]) + path end # Update hearder and query params based on authentication settings. diff --git a/lib/patch_ruby/api_error.rb b/lib/patch_ruby/api_error.rb index 611c81e..3de701e 100644 --- a/lib/patch_ruby/api_error.rb +++ b/lib/patch_ruby/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end diff --git a/lib/patch_ruby/configuration.rb b/lib/patch_ruby/configuration.rb index 641dc97..616b383 100644 --- a/lib/patch_ruby/configuration.rb +++ b/lib/patch_ruby/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end @@ -21,6 +21,18 @@ class Configuration # Defines url base path attr_accessor :base_path + # Define server configuration index + attr_accessor :server_index + + # Define server operation configuration index + attr_accessor :server_operation_index + + # Default server variables + attr_accessor :server_variables + + # Default server operation variables + attr_accessor :server_operation_variables + # Defines API keys used with API Key authentications. # # @return [Hash] key: parameter name, value: parameter value (API key) @@ -129,6 +141,10 @@ def initialize @scheme = 'https' @host = 'api.patch.io' @base_path = '' + @server_index = 0 + @server_operation_index = {} + @server_variables = {} + @server_operation_variables = {} @api_key = {} @api_key_prefix = {} @timeout = 0 @@ -171,8 +187,12 @@ def base_path=(base_path) @base_path = '' if @base_path == '/' end - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') + # Returns base URL for specified operation based on server settings + def base_url(operation = nil) + index = server_operation_index.fetch(operation, server_index) + return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil + + server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) end # Gets API key (with prefix if set). @@ -219,12 +239,17 @@ def server_settings ] end + def operation_server_settings + { + } + end + # Returns URL based on server settings # # @param index array index of the server settings # @param variables hash of variable and the corresponding value - def server_url(index, variables = {}) - servers = server_settings + def server_url(index, variables = {}, servers = nil) + servers = server_settings if servers == nil # check array index out of bound if (index < 0 || index >= servers.size) @@ -234,10 +259,12 @@ def server_url(index, variables = {}) server = servers[index] url = server[:url] + return url unless server.key? :variables + # go through variable and assign a value server[:variables].each do |name, variable| if variables.key?(name) - if (server[:variables][name][:enum_values].include? variables[name]) + if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name])) url.gsub! "{" + name.to_s + "}", variables[name] else fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}." diff --git a/lib/patch_ruby/models/allocation.rb b/lib/patch_ruby/models/allocation.rb index 47d40b8..2855e92 100644 --- a/lib/patch_ruby/models/allocation.rb +++ b/lib/patch_ruby/models/allocation.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class Allocation @@ -26,8 +27,8 @@ class Allocation # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'id' => :'id', - :'production' => :'production', + :'id' => :'id' + :'production' => :'production' :'mass_g' => :'mass_g' } end @@ -35,8 +36,8 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'id' => :'String', - :'production' => :'Boolean', + :'id' => :'String' + :'production' => :'Boolean' :'mass_g' => :'Integer' } end @@ -134,7 +135,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, production, mass_g].hash + [idproductionmass_g].hash end # Builds the object from hash @@ -150,7 +151,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -158,7 +161,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -170,8 +173,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -201,7 +204,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -227,7 +232,7 @@ def to_hash 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 @@ -250,5 +255,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/create_bitcoin_estimate_request.rb b/lib/patch_ruby/models/create_bitcoin_estimate_request.rb index 6ef64aa..8f1ca61 100644 --- a/lib/patch_ruby/models/create_bitcoin_estimate_request.rb +++ b/lib/patch_ruby/models/create_bitcoin_estimate_request.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class CreateBitcoinEstimateRequest @@ -25,9 +26,9 @@ class CreateBitcoinEstimateRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'timestamp' => :'timestamp', - :'transaction_value_btc_sats' => :'transaction_value_btc_sats', - :'project_id' => :'project_id', + :'timestamp' => :'timestamp' + :'transaction_value_btc_sats' => :'transaction_value_btc_sats' + :'project_id' => :'project_id' :'create_order' => :'create_order' } end @@ -35,9 +36,9 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'timestamp' => :'String', - :'transaction_value_btc_sats' => :'Integer', - :'project_id' => :'String', + :'timestamp' => :'String' + :'transaction_value_btc_sats' => :'Integer' + :'project_id' => :'String' :'create_order' => :'Boolean' } end @@ -133,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [timestamp, transaction_value_btc_sats, project_id, create_order].hash + [timestamptransaction_value_btc_satsproject_idcreate_order].hash end # Builds the object from hash @@ -149,7 +150,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -157,7 +160,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -169,8 +172,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -200,7 +203,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -226,7 +231,7 @@ def to_hash 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 @@ -249,5 +254,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/create_ethereum_estimate_request.rb b/lib/patch_ruby/models/create_ethereum_estimate_request.rb index b5d30bf..43976e5 100644 --- a/lib/patch_ruby/models/create_ethereum_estimate_request.rb +++ b/lib/patch_ruby/models/create_ethereum_estimate_request.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class CreateEthereumEstimateRequest @@ -27,10 +28,10 @@ class CreateEthereumEstimateRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'timestamp' => :'timestamp', - :'gas_used' => :'gas_used', - :'transaction_value_eth_gwei' => :'transaction_value_eth_gwei', - :'project_id' => :'project_id', + :'timestamp' => :'timestamp' + :'gas_used' => :'gas_used' + :'transaction_value_eth_gwei' => :'transaction_value_eth_gwei' + :'project_id' => :'project_id' :'create_order' => :'create_order' } end @@ -38,10 +39,10 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'timestamp' => :'String', - :'gas_used' => :'Integer', - :'transaction_value_eth_gwei' => :'Integer', - :'project_id' => :'String', + :'timestamp' => :'String' + :'gas_used' => :'Integer' + :'transaction_value_eth_gwei' => :'Integer' + :'project_id' => :'String' :'create_order' => :'Boolean' } end @@ -144,7 +145,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [timestamp, gas_used, transaction_value_eth_gwei, project_id, create_order].hash + [timestampgas_usedtransaction_value_eth_gweiproject_idcreate_order].hash end # Builds the object from hash @@ -160,7 +161,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -168,7 +171,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -180,8 +183,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -211,7 +214,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -237,7 +242,7 @@ def to_hash 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 @@ -260,5 +265,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/create_mass_estimate_request.rb b/lib/patch_ruby/models/create_mass_estimate_request.rb index 0646ba9..95d99a6 100644 --- a/lib/patch_ruby/models/create_mass_estimate_request.rb +++ b/lib/patch_ruby/models/create_mass_estimate_request.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class CreateMassEstimateRequest @@ -23,8 +24,8 @@ class CreateMassEstimateRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'mass_g' => :'mass_g', - :'create_order' => :'create_order', + :'mass_g' => :'mass_g' + :'create_order' => :'create_order' :'project_id' => :'project_id' } end @@ -32,8 +33,8 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'mass_g' => :'Integer', - :'create_order' => :'Boolean', + :'mass_g' => :'Integer' + :'create_order' => :'Boolean' :'project_id' => :'String' } end @@ -151,7 +152,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [mass_g, create_order, project_id].hash + [mass_gcreate_orderproject_id].hash end # Builds the object from hash @@ -167,7 +168,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -175,7 +178,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -187,8 +190,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -218,7 +221,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -244,7 +249,7 @@ def to_hash 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 @@ -267,5 +272,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/create_order_request.rb b/lib/patch_ruby/models/create_order_request.rb index 127efbc..c0546d9 100644 --- a/lib/patch_ruby/models/create_order_request.rb +++ b/lib/patch_ruby/models/create_order_request.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class CreateOrderRequest @@ -25,9 +26,9 @@ class CreateOrderRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'mass_g' => :'mass_g', - :'total_price_cents_usd' => :'total_price_cents_usd', - :'project_id' => :'project_id', + :'mass_g' => :'mass_g' + :'total_price_cents_usd' => :'total_price_cents_usd' + :'project_id' => :'project_id' :'metadata' => :'metadata' } end @@ -35,9 +36,9 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'mass_g' => :'Integer', - :'total_price_cents_usd' => :'Integer', - :'project_id' => :'String', + :'mass_g' => :'Integer' + :'total_price_cents_usd' => :'Integer' + :'project_id' => :'String' :'metadata' => :'Object' } end @@ -164,7 +165,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [mass_g, total_price_cents_usd, project_id, metadata].hash + [mass_gtotal_price_cents_usdproject_idmetadata].hash end # Builds the object from hash @@ -180,7 +181,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -188,7 +191,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -200,8 +203,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -231,7 +234,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -257,7 +262,7 @@ def to_hash 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 @@ -280,5 +285,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/create_preference_request.rb b/lib/patch_ruby/models/create_preference_request.rb index d069ac7..726fa19 100644 --- a/lib/patch_ruby/models/create_preference_request.rb +++ b/lib/patch_ruby/models/create_preference_request.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class CreatePreferenceRequest @@ -119,7 +120,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -127,7 +130,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -139,8 +142,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -170,7 +173,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -196,7 +201,7 @@ def to_hash 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 diff --git a/lib/patch_ruby/models/error_response.rb b/lib/patch_ruby/models/error_response.rb index dd0ff95..b94095b 100644 --- a/lib/patch_ruby/models/error_response.rb +++ b/lib/patch_ruby/models/error_response.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class ErrorResponse @@ -23,8 +24,8 @@ class ErrorResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success', - :'error' => :'error', + :'success' => :'success' + :'error' => :'error' :'data' => :'data' } end @@ -32,8 +33,8 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean', - :'error' => :'Object', + :'success' => :'Boolean' + :'error' => :'Object' :'data' => :'Object' } end @@ -128,7 +129,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [success, error, data].hash + [successerrordata].hash end # Builds the object from hash @@ -144,7 +145,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -152,7 +155,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -164,8 +167,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -195,7 +198,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -221,7 +226,7 @@ def to_hash 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 @@ -244,5 +249,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/estimate.rb b/lib/patch_ruby/models/estimate.rb index 3ab7b3d..be76188 100644 --- a/lib/patch_ruby/models/estimate.rb +++ b/lib/patch_ruby/models/estimate.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class Estimate @@ -32,10 +33,10 @@ class Estimate # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'id' => :'id', - :'production' => :'production', - :'type' => :'type', - :'mass_g' => :'mass_g', + :'id' => :'id' + :'production' => :'production' + :'type' => :'type' + :'mass_g' => :'mass_g' :'order' => :'order' } end @@ -43,10 +44,10 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'id' => :'String', - :'production' => :'Boolean', - :'type' => :'String', - :'mass_g' => :'Integer', + :'id' => :'String' + :'production' => :'Boolean' + :'type' => :'String' + :'mass_g' => :'Integer' :'order' => :'Order' } end @@ -156,7 +157,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, production, type, mass_g, order].hash + [idproductiontypemass_gorder].hash end # Builds the object from hash @@ -172,7 +173,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -180,7 +183,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -192,8 +195,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -223,7 +226,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -249,7 +254,7 @@ def to_hash 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 @@ -272,5 +277,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/estimate_list_response.rb b/lib/patch_ruby/models/estimate_list_response.rb index 8762d98..e0732fb 100644 --- a/lib/patch_ruby/models/estimate_list_response.rb +++ b/lib/patch_ruby/models/estimate_list_response.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class EstimateListResponse @@ -25,9 +26,9 @@ class EstimateListResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success', - :'error' => :'error', - :'data' => :'data', + :'success' => :'success' + :'error' => :'error' + :'data' => :'data' :'meta' => :'meta' } end @@ -35,9 +36,9 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean', - :'error' => :'Object', - :'data' => :'Array', + :'success' => :'Boolean' + :'error' => :'Object' + :'data' => :'Array' :'meta' => :'MetaIndexObject' } end @@ -86,9 +87,6 @@ def initialize(attributes = {}) end if attributes.key?(:'data') - if (value = attributes[:'data']).is_a?(Array) - self.data = value - end end if attributes.key?(:'meta') @@ -144,7 +142,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [success, error, data, meta].hash + [successerrordatameta].hash end # Builds the object from hash @@ -160,7 +158,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -168,7 +168,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -180,8 +180,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -211,7 +211,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -237,7 +239,7 @@ def to_hash 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 @@ -260,5 +262,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/estimate_response.rb b/lib/patch_ruby/models/estimate_response.rb index bc36f5f..76d7f2e 100644 --- a/lib/patch_ruby/models/estimate_response.rb +++ b/lib/patch_ruby/models/estimate_response.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class EstimateResponse @@ -23,8 +24,8 @@ class EstimateResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success', - :'error' => :'error', + :'success' => :'success' + :'error' => :'error' :'data' => :'data' } end @@ -32,8 +33,8 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean', - :'error' => :'Object', + :'success' => :'Boolean' + :'error' => :'Object' :'data' => :'Estimate' } end @@ -128,7 +129,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [success, error, data].hash + [successerrordata].hash end # Builds the object from hash @@ -144,7 +145,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -152,7 +155,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -164,8 +167,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -195,7 +198,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -221,7 +226,7 @@ def to_hash 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 @@ -244,5 +249,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/meta_index_object.rb b/lib/patch_ruby/models/meta_index_object.rb index 5eac744..96c6e01 100644 --- a/lib/patch_ruby/models/meta_index_object.rb +++ b/lib/patch_ruby/models/meta_index_object.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class MetaIndexObject @@ -21,7 +22,7 @@ class MetaIndexObject # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'prev_page' => :'prev_page', + :'prev_page' => :'prev_page' :'next_page' => :'next_page' } end @@ -29,7 +30,7 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'prev_page' => :'Integer', + :'prev_page' => :'Integer' :'next_page' => :'Integer' } end @@ -111,7 +112,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [prev_page, next_page].hash + [prev_pagenext_page].hash end # Builds the object from hash @@ -127,7 +128,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -135,7 +138,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -147,8 +150,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -178,7 +181,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -204,7 +209,7 @@ def to_hash 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 @@ -227,5 +232,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/order.rb b/lib/patch_ruby/models/order.rb index 57a232a..4c6f253 100644 --- a/lib/patch_ruby/models/order.rb +++ b/lib/patch_ruby/models/order.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class Order @@ -69,15 +70,15 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'id' => :'id', - :'mass_g' => :'mass_g', - :'production' => :'production', - :'state' => :'state', - :'allocation_state' => :'allocation_state', - :'price_cents_usd' => :'price_cents_usd', - :'patch_fee_cents_usd' => :'patch_fee_cents_usd', - :'allocations' => :'allocations', - :'registry_url' => :'registry_url', + :'id' => :'id' + :'mass_g' => :'mass_g' + :'production' => :'production' + :'state' => :'state' + :'allocation_state' => :'allocation_state' + :'price_cents_usd' => :'price_cents_usd' + :'patch_fee_cents_usd' => :'patch_fee_cents_usd' + :'allocations' => :'allocations' + :'registry_url' => :'registry_url' :'metadata' => :'metadata' } end @@ -85,15 +86,15 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'id' => :'String', - :'mass_g' => :'Integer', - :'production' => :'Boolean', - :'state' => :'String', - :'allocation_state' => :'String', - :'price_cents_usd' => :'Integer', - :'patch_fee_cents_usd' => :'Integer', - :'allocations' => :'Array', - :'registry_url' => :'String', + :'id' => :'String' + :'mass_g' => :'Integer' + :'production' => :'Boolean' + :'state' => :'String' + :'allocation_state' => :'String' + :'price_cents_usd' => :'Integer' + :'patch_fee_cents_usd' => :'Integer' + :'allocations' => :'Array' + :'registry_url' => :'String' :'metadata' => :'Object' } end @@ -164,9 +165,6 @@ def initialize(attributes = {}) end if attributes.key?(:'allocations') - if (value = attributes[:'allocations']).is_a?(Array) - self.allocations = value - end end if attributes.key?(:'registry_url') @@ -304,7 +302,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, mass_g, production, state, allocation_state, price_cents_usd, patch_fee_cents_usd, allocations, registry_url, metadata].hash + [idmass_gproductionstateallocation_stateprice_cents_usdpatch_fee_cents_usdallocationsregistry_urlmetadata].hash end # Builds the object from hash @@ -320,7 +318,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -328,7 +328,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -340,8 +340,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -371,7 +371,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -397,7 +399,7 @@ def to_hash 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 @@ -420,5 +422,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/order_list_response.rb b/lib/patch_ruby/models/order_list_response.rb index 5786b7c..6821a45 100644 --- a/lib/patch_ruby/models/order_list_response.rb +++ b/lib/patch_ruby/models/order_list_response.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class OrderListResponse @@ -25,9 +26,9 @@ class OrderListResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success', - :'error' => :'error', - :'data' => :'data', + :'success' => :'success' + :'error' => :'error' + :'data' => :'data' :'meta' => :'meta' } end @@ -35,9 +36,9 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean', - :'error' => :'Object', - :'data' => :'Array', + :'success' => :'Boolean' + :'error' => :'Object' + :'data' => :'Array' :'meta' => :'MetaIndexObject' } end @@ -86,9 +87,6 @@ def initialize(attributes = {}) end if attributes.key?(:'data') - if (value = attributes[:'data']).is_a?(Array) - self.data = value - end end if attributes.key?(:'meta') @@ -144,7 +142,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [success, error, data, meta].hash + [successerrordatameta].hash end # Builds the object from hash @@ -160,7 +158,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -168,7 +168,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -180,8 +180,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -211,7 +211,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -237,7 +239,7 @@ def to_hash 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 @@ -260,5 +262,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/order_response.rb b/lib/patch_ruby/models/order_response.rb index f42405a..1de4860 100644 --- a/lib/patch_ruby/models/order_response.rb +++ b/lib/patch_ruby/models/order_response.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class OrderResponse @@ -23,8 +24,8 @@ class OrderResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success', - :'error' => :'error', + :'success' => :'success' + :'error' => :'error' :'data' => :'data' } end @@ -32,8 +33,8 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean', - :'error' => :'Object', + :'success' => :'Boolean' + :'error' => :'Object' :'data' => :'Order' } end @@ -128,7 +129,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [success, error, data].hash + [successerrordata].hash end # Builds the object from hash @@ -144,7 +145,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -152,7 +155,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -164,8 +167,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -195,7 +198,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -221,7 +226,7 @@ def to_hash 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 @@ -244,5 +249,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/photo.rb b/lib/patch_ruby/models/photo.rb index 81b69db..d851b76 100644 --- a/lib/patch_ruby/models/photo.rb +++ b/lib/patch_ruby/models/photo.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class Photo @@ -21,7 +22,7 @@ class Photo # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'url' => :'url', + :'url' => :'url' :'id' => :'id' } end @@ -29,7 +30,7 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'url' => :'String', + :'url' => :'String' :'id' => :'String' } end @@ -117,7 +118,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [url, id].hash + [urlid].hash end # Builds the object from hash @@ -133,7 +134,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -141,7 +144,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -153,8 +156,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -184,7 +187,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -210,7 +215,7 @@ def to_hash 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 @@ -233,5 +238,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/preference.rb b/lib/patch_ruby/models/preference.rb index 48678c6..2ea0faa 100644 --- a/lib/patch_ruby/models/preference.rb +++ b/lib/patch_ruby/models/preference.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class Preference @@ -26,8 +27,8 @@ class Preference # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'id' => :'id', - :'allocation_percentage' => :'allocation_percentage', + :'id' => :'id' + :'allocation_percentage' => :'allocation_percentage' :'project' => :'project' } end @@ -35,8 +36,8 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'id' => :'String', - :'allocation_percentage' => :'Integer', + :'id' => :'String' + :'allocation_percentage' => :'Integer' :'project' => :'Project' } end @@ -134,7 +135,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, allocation_percentage, project].hash + [idallocation_percentageproject].hash end # Builds the object from hash @@ -150,7 +151,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -158,7 +161,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -170,8 +173,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -201,7 +204,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -227,7 +232,7 @@ def to_hash 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 @@ -250,5 +255,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/preference_list_response.rb b/lib/patch_ruby/models/preference_list_response.rb index 94ff4fc..cd31ce2 100644 --- a/lib/patch_ruby/models/preference_list_response.rb +++ b/lib/patch_ruby/models/preference_list_response.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class PreferenceListResponse @@ -25,9 +26,9 @@ class PreferenceListResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success', - :'error' => :'error', - :'data' => :'data', + :'success' => :'success' + :'error' => :'error' + :'data' => :'data' :'meta' => :'meta' } end @@ -35,9 +36,9 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean', - :'error' => :'Object', - :'data' => :'Array', + :'success' => :'Boolean' + :'error' => :'Object' + :'data' => :'Array' :'meta' => :'MetaIndexObject' } end @@ -86,9 +87,6 @@ def initialize(attributes = {}) end if attributes.key?(:'data') - if (value = attributes[:'data']).is_a?(Array) - self.data = value - end end if attributes.key?(:'meta') @@ -144,7 +142,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [success, error, data, meta].hash + [successerrordatameta].hash end # Builds the object from hash @@ -160,7 +158,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -168,7 +168,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -180,8 +180,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -211,7 +211,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -237,7 +239,7 @@ def to_hash 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 @@ -260,5 +262,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/preference_response.rb b/lib/patch_ruby/models/preference_response.rb index b3af523..9249fe0 100644 --- a/lib/patch_ruby/models/preference_response.rb +++ b/lib/patch_ruby/models/preference_response.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class PreferenceResponse @@ -23,8 +24,8 @@ class PreferenceResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success', - :'error' => :'error', + :'success' => :'success' + :'error' => :'error' :'data' => :'data' } end @@ -32,8 +33,8 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean', - :'error' => :'Object', + :'success' => :'Boolean' + :'error' => :'Object' :'data' => :'Preference' } end @@ -128,7 +129,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [success, error, data].hash + [successerrordata].hash end # Builds the object from hash @@ -144,7 +145,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -152,7 +155,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -164,8 +167,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -195,7 +198,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -221,7 +226,7 @@ def to_hash 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 @@ -244,5 +249,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/project.rb b/lib/patch_ruby/models/project.rb index 3e76d2b..eb3b8a7 100644 --- a/lib/patch_ruby/models/project.rb +++ b/lib/patch_ruby/models/project.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class Project @@ -75,17 +76,17 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'id' => :'id', - :'production' => :'production', - :'name' => :'name', - :'description' => :'description', - :'type' => :'type', - :'country' => :'country', - :'developer' => :'developer', - :'photos' => :'photos', - :'average_price_per_tonne_cents_usd' => :'average_price_per_tonne_cents_usd', - :'remaining_mass_g' => :'remaining_mass_g', - :'standard' => :'standard', + :'id' => :'id' + :'production' => :'production' + :'name' => :'name' + :'description' => :'description' + :'type' => :'type' + :'country' => :'country' + :'developer' => :'developer' + :'photos' => :'photos' + :'average_price_per_tonne_cents_usd' => :'average_price_per_tonne_cents_usd' + :'remaining_mass_g' => :'remaining_mass_g' + :'standard' => :'standard' :'sdgs' => :'sdgs' } end @@ -93,17 +94,17 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'id' => :'String', - :'production' => :'Boolean', - :'name' => :'String', - :'description' => :'String', - :'type' => :'String', - :'country' => :'String', - :'developer' => :'String', - :'photos' => :'Array', - :'average_price_per_tonne_cents_usd' => :'Integer', - :'remaining_mass_g' => :'Integer', - :'standard' => :'Standard', + :'id' => :'String' + :'production' => :'Boolean' + :'name' => :'String' + :'description' => :'String' + :'type' => :'String' + :'country' => :'String' + :'developer' => :'String' + :'photos' => :'Array' + :'average_price_per_tonne_cents_usd' => :'Integer' + :'remaining_mass_g' => :'Integer' + :'standard' => :'Standard' :'sdgs' => :'Array' } end @@ -176,9 +177,6 @@ def initialize(attributes = {}) end if attributes.key?(:'photos') - if (value = attributes[:'photos']).is_a?(Array) - self.photos = value - end end if attributes.key?(:'average_price_per_tonne_cents_usd') @@ -194,9 +192,6 @@ def initialize(attributes = {}) end if attributes.key?(:'sdgs') - if (value = attributes[:'sdgs']).is_a?(Array) - self.sdgs = value - end end end @@ -293,7 +288,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, production, name, description, type, country, developer, photos, average_price_per_tonne_cents_usd, remaining_mass_g, standard, sdgs].hash + [idproductionnamedescriptiontypecountrydeveloperphotosaverage_price_per_tonne_cents_usdremaining_mass_gstandardsdgs].hash end # Builds the object from hash @@ -309,7 +304,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -317,7 +314,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -329,8 +326,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -360,7 +357,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -386,7 +385,7 @@ def to_hash 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 @@ -409,5 +408,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/project_list_response.rb b/lib/patch_ruby/models/project_list_response.rb index c3ccb92..805828c 100644 --- a/lib/patch_ruby/models/project_list_response.rb +++ b/lib/patch_ruby/models/project_list_response.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class ProjectListResponse @@ -25,9 +26,9 @@ class ProjectListResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success', - :'error' => :'error', - :'data' => :'data', + :'success' => :'success' + :'error' => :'error' + :'data' => :'data' :'meta' => :'meta' } end @@ -35,9 +36,9 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean', - :'error' => :'Object', - :'data' => :'Array', + :'success' => :'Boolean' + :'error' => :'Object' + :'data' => :'Array' :'meta' => :'MetaIndexObject' } end @@ -86,9 +87,6 @@ def initialize(attributes = {}) end if attributes.key?(:'data') - if (value = attributes[:'data']).is_a?(Array) - self.data = value - end end if attributes.key?(:'meta') @@ -144,7 +142,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [success, error, data, meta].hash + [successerrordatameta].hash end # Builds the object from hash @@ -160,7 +158,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -168,7 +168,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -180,8 +180,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -211,7 +211,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -237,7 +239,7 @@ def to_hash 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 @@ -260,5 +262,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/project_response.rb b/lib/patch_ruby/models/project_response.rb index 96cb48b..0e3a298 100644 --- a/lib/patch_ruby/models/project_response.rb +++ b/lib/patch_ruby/models/project_response.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class ProjectResponse @@ -23,8 +24,8 @@ class ProjectResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success', - :'error' => :'error', + :'success' => :'success' + :'error' => :'error' :'data' => :'data' } end @@ -32,8 +33,8 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean', - :'error' => :'Object', + :'success' => :'Boolean' + :'error' => :'Object' :'data' => :'Project' } end @@ -128,7 +129,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [success, error, data].hash + [successerrordata].hash end # Builds the object from hash @@ -144,7 +145,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -152,7 +155,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -164,8 +167,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -195,7 +198,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -221,7 +226,7 @@ def to_hash 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 @@ -244,5 +249,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/sdg.rb b/lib/patch_ruby/models/sdg.rb index 3258317..0d7c905 100644 --- a/lib/patch_ruby/models/sdg.rb +++ b/lib/patch_ruby/models/sdg.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class Sdg @@ -29,9 +30,9 @@ class Sdg # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'title' => :'title', - :'number' => :'number', - :'description' => :'description', + :'title' => :'title' + :'number' => :'number' + :'description' => :'description' :'url' => :'url' } end @@ -39,9 +40,9 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'title' => :'String', - :'number' => :'Integer', - :'description' => :'String', + :'title' => :'String' + :'number' => :'Integer' + :'description' => :'String' :'url' => :'String' } end @@ -149,7 +150,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [title, number, description, url].hash + [titlenumberdescriptionurl].hash end # Builds the object from hash @@ -165,7 +166,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -173,7 +176,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -185,8 +188,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -216,7 +219,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -242,7 +247,7 @@ def to_hash 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 @@ -265,5 +270,6 @@ def _to_hash(value) value end end + end end diff --git a/lib/patch_ruby/models/standard.rb b/lib/patch_ruby/models/standard.rb index 04a9cf1..a4b52d6 100644 --- a/lib/patch_ruby/models/standard.rb +++ b/lib/patch_ruby/models/standard.rb @@ -6,11 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end require 'date' +require 'time' module Patch class Standard @@ -26,8 +27,8 @@ class Standard # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'type' => :'type', - :'acronym' => :'acronym', + :'type' => :'type' + :'acronym' => :'acronym' :'description' => :'description' } end @@ -35,8 +36,8 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { - :'type' => :'String', - :'acronym' => :'String', + :'type' => :'String' + :'acronym' => :'String' :'description' => :'String' } end @@ -134,7 +135,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type, acronym, description].hash + [typeacronymdescription].hash end # Builds the object from hash @@ -150,7 +151,9 @@ def self.build_from_hash(attributes) 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 + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif 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) @@ -158,7 +161,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -170,8 +173,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -201,7 +204,9 @@ def _deserialize(type, value) end end else # model - Patch.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Patch.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -227,7 +232,7 @@ def to_hash 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 @@ -250,5 +255,6 @@ def _to_hash(value) value end end + end end diff --git a/spec/api_client_spec.rb b/spec/api_client_spec.rb index 323a5bf..ba96b36 100644 --- a/spec/api_client_spec.rb +++ b/spec/api_client_spec.rb @@ -6,26 +6,47 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end +require 'spec_helper' + describe Patch::ApiClient do context 'initialization' do - context 'base_path' do - it "prepends a slash to base_path" do - Patch.configure { |c| c.base_path = 'v4/dog' } - expect(Patch::Configuration.default.base_path).to eq('/v4/dog') - end - - it "doesn't prepend a slash if one is already there" do - Patch.configure { |c| c.base_path = '/v4/dog' } - expect(Patch::Configuration.default.base_path).to eq('/v4/dog') + context 'URL stuff' do + context 'host' do + it 'removes http from host' do + Patch.configure { |c| c.host = 'http://example.com' } + expect(Patch::Configuration.default.host).to eq('example.com') + end + + it 'removes https from host' do + Patch.configure { |c| c.host = 'https://wookiee.com' } + expect(Patch::ApiClient.default.config.host).to eq('wookiee.com') + end + + it 'removes trailing path from host' do + Patch.configure { |c| c.host = 'hobo.com/v4' } + expect(Patch::Configuration.default.host).to eq('hobo.com') + end end - it "ends up as a blank string if nil" do - Patch.configure { |c| c.base_path = nil } - expect(Patch::Configuration.default.base_path).to eq('') + context 'base_path' do + it "prepends a slash to base_path" do + Patch.configure { |c| c.base_path = 'v4/dog' } + expect(Patch::Configuration.default.base_path).to eq('/v4/dog') + end + + it "doesn't prepend a slash if one is already there" do + Patch.configure { |c| c.base_path = '/v4/dog' } + expect(Patch::Configuration.default.base_path).to eq('/v4/dog') + end + + it "ends up as a blank string if nil" do + Patch.configure { |c| c.base_path = nil } + expect(Patch::Configuration.default.base_path).to eq('') + end end end end diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb index f9faa7a..a3a1efc 100644 --- a/spec/configuration_spec.rb +++ b/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7dd5a5d..ba1c91e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,17 +6,12 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.0.0 =end # load the gem require 'patch_ruby' -require 'constants' -require 'factory_bot' - -# Require shared spec examples -Dir["./spec/support/**/*.rb"].sort.each { |f| require f } # The following was generated by the `rspec --init` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. @@ -37,21 +32,6 @@ # # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| - # Use FactoryBot for test factories - config.include FactoryBot::Syntax::Methods - config.before(:suite) do - FactoryBot.find_definitions - Patch.configure do |config| - if ENV.fetch('LOCAL_SDK_TEST', false) - config.access_token = ENV.fetch('LOCAL_PATCH_API_KEY') - config.scheme = 'http' - config.host = 'api.patch.test:3000' - else - config.access_token = ENV.fetch('SANDBOX_API_KEY') - end - end - end - # rspec-expectations config goes here. You can use an alternate # assertion/expectation library such as wrong or the stdlib/minitest # assertions if you prefer. @@ -75,12 +55,6 @@ mocks.verify_partial_doubles = true end - # Run specs in random order to surface order dependencies. If you find an - # order dependency and want to debug it, you can fix the order by providing - # the seed, which is printed after each run. - # --seed 1234 - config.order = :random - # The settings below are suggested to provide a good initial experience # with RSpec, but feel free to customize to your heart's content. =begin @@ -122,6 +96,12 @@ # particularly slow. config.profile_examples = 10 + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + # Seed global randomization in this process using the `--seed` CLI option. # Setting this allows you to use `--seed` to deterministically reproduce # test failures related to randomization by passing the same `--seed` value From f07b3a18ee0b90570b983baf7791fa4742030e02 Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Thu, 26 Aug 2021 21:29:40 -0700 Subject: [PATCH 02/15] 5.1.0 --- lib/patch_ruby.rb | 2 +- lib/patch_ruby/api/estimates_api.rb | 2 +- lib/patch_ruby/api/orders_api.rb | 2 +- lib/patch_ruby/api/preferences_api.rb | 2 +- lib/patch_ruby/api/projects_api.rb | 2 +- lib/patch_ruby/api_client.rb | 4 ++-- lib/patch_ruby/api_error.rb | 2 +- lib/patch_ruby/configuration.rb | 10 ++++++---- lib/patch_ruby/models/allocation.rb | 2 +- .../models/create_bitcoin_estimate_request.rb | 2 +- .../models/create_ethereum_estimate_request.rb | 2 +- lib/patch_ruby/models/create_mass_estimate_request.rb | 2 +- lib/patch_ruby/models/create_order_request.rb | 2 +- lib/patch_ruby/models/create_preference_request.rb | 2 +- lib/patch_ruby/models/error_response.rb | 2 +- lib/patch_ruby/models/estimate.rb | 2 +- lib/patch_ruby/models/estimate_list_response.rb | 2 +- lib/patch_ruby/models/estimate_response.rb | 2 +- lib/patch_ruby/models/meta_index_object.rb | 2 +- lib/patch_ruby/models/order.rb | 2 +- lib/patch_ruby/models/order_list_response.rb | 2 +- lib/patch_ruby/models/order_response.rb | 2 +- lib/patch_ruby/models/photo.rb | 2 +- lib/patch_ruby/models/preference.rb | 2 +- lib/patch_ruby/models/preference_list_response.rb | 2 +- lib/patch_ruby/models/preference_response.rb | 2 +- lib/patch_ruby/models/project.rb | 2 +- lib/patch_ruby/models/project_list_response.rb | 2 +- lib/patch_ruby/models/project_response.rb | 2 +- lib/patch_ruby/models/sdg.rb | 2 +- lib/patch_ruby/models/standard.rb | 2 +- spec/api_client_spec.rb | 2 +- spec/configuration_spec.rb | 2 +- spec/spec_helper.rb | 2 +- 34 files changed, 40 insertions(+), 38 deletions(-) diff --git a/lib/patch_ruby.rb b/lib/patch_ruby.rb index f37a4d5..3116fc9 100644 --- a/lib/patch_ruby.rb +++ b/lib/patch_ruby.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/api/estimates_api.rb b/lib/patch_ruby/api/estimates_api.rb index ff13da6..ba8ea3c 100644 --- a/lib/patch_ruby/api/estimates_api.rb +++ b/lib/patch_ruby/api/estimates_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/api/orders_api.rb b/lib/patch_ruby/api/orders_api.rb index 5e06533..6e012ae 100644 --- a/lib/patch_ruby/api/orders_api.rb +++ b/lib/patch_ruby/api/orders_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/api/preferences_api.rb b/lib/patch_ruby/api/preferences_api.rb index 4d0dbca..1519347 100644 --- a/lib/patch_ruby/api/preferences_api.rb +++ b/lib/patch_ruby/api/preferences_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/api/projects_api.rb b/lib/patch_ruby/api/projects_api.rb index d2e2625..1225081 100644 --- a/lib/patch_ruby/api/projects_api.rb +++ b/lib/patch_ruby/api/projects_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/api_client.rb b/lib/patch_ruby/api_client.rb index da4ff2f..0c19584 100644 --- a/lib/patch_ruby/api_client.rb +++ b/lib/patch_ruby/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end @@ -308,7 +308,7 @@ def update_params_for_auth!(header_params, query_params, auth_names) case auth_setting[:in] when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' + else fail ArgumentError, 'Authentication token must be in `query` or `header`' end end end diff --git a/lib/patch_ruby/api_error.rb b/lib/patch_ruby/api_error.rb index 3de701e..2e334c2 100644 --- a/lib/patch_ruby/api_error.rb +++ b/lib/patch_ruby/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/configuration.rb b/lib/patch_ruby/configuration.rb index 616b383..e8c545b 100644 --- a/lib/patch_ruby/configuration.rb +++ b/lib/patch_ruby/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end @@ -197,11 +197,13 @@ def base_url(operation = nil) # Gets API key (with prefix if set). # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) + def api_key_with_prefix(param_name, param_alias = nil) + key = @api_key[param_name] + key = @api_key.fetch(param_alias, key) unless param_alias.nil? if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" + "#{@api_key_prefix[param_name]} #{key}" else - @api_key[param_name] + key end end diff --git a/lib/patch_ruby/models/allocation.rb b/lib/patch_ruby/models/allocation.rb index 2855e92..98919d2 100644 --- a/lib/patch_ruby/models/allocation.rb +++ b/lib/patch_ruby/models/allocation.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/create_bitcoin_estimate_request.rb b/lib/patch_ruby/models/create_bitcoin_estimate_request.rb index 8f1ca61..9f430af 100644 --- a/lib/patch_ruby/models/create_bitcoin_estimate_request.rb +++ b/lib/patch_ruby/models/create_bitcoin_estimate_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/create_ethereum_estimate_request.rb b/lib/patch_ruby/models/create_ethereum_estimate_request.rb index 43976e5..9a52d9a 100644 --- a/lib/patch_ruby/models/create_ethereum_estimate_request.rb +++ b/lib/patch_ruby/models/create_ethereum_estimate_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/create_mass_estimate_request.rb b/lib/patch_ruby/models/create_mass_estimate_request.rb index 95d99a6..a33ec8a 100644 --- a/lib/patch_ruby/models/create_mass_estimate_request.rb +++ b/lib/patch_ruby/models/create_mass_estimate_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/create_order_request.rb b/lib/patch_ruby/models/create_order_request.rb index c0546d9..9f8370b 100644 --- a/lib/patch_ruby/models/create_order_request.rb +++ b/lib/patch_ruby/models/create_order_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/create_preference_request.rb b/lib/patch_ruby/models/create_preference_request.rb index 726fa19..d4aa6b5 100644 --- a/lib/patch_ruby/models/create_preference_request.rb +++ b/lib/patch_ruby/models/create_preference_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/error_response.rb b/lib/patch_ruby/models/error_response.rb index b94095b..8813888 100644 --- a/lib/patch_ruby/models/error_response.rb +++ b/lib/patch_ruby/models/error_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/estimate.rb b/lib/patch_ruby/models/estimate.rb index be76188..995bf3b 100644 --- a/lib/patch_ruby/models/estimate.rb +++ b/lib/patch_ruby/models/estimate.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/estimate_list_response.rb b/lib/patch_ruby/models/estimate_list_response.rb index e0732fb..64c213c 100644 --- a/lib/patch_ruby/models/estimate_list_response.rb +++ b/lib/patch_ruby/models/estimate_list_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/estimate_response.rb b/lib/patch_ruby/models/estimate_response.rb index 76d7f2e..54ba69d 100644 --- a/lib/patch_ruby/models/estimate_response.rb +++ b/lib/patch_ruby/models/estimate_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/meta_index_object.rb b/lib/patch_ruby/models/meta_index_object.rb index 96c6e01..20f9fa1 100644 --- a/lib/patch_ruby/models/meta_index_object.rb +++ b/lib/patch_ruby/models/meta_index_object.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/order.rb b/lib/patch_ruby/models/order.rb index 4c6f253..ba30f52 100644 --- a/lib/patch_ruby/models/order.rb +++ b/lib/patch_ruby/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/order_list_response.rb b/lib/patch_ruby/models/order_list_response.rb index 6821a45..3925033 100644 --- a/lib/patch_ruby/models/order_list_response.rb +++ b/lib/patch_ruby/models/order_list_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/order_response.rb b/lib/patch_ruby/models/order_response.rb index 1de4860..2b64432 100644 --- a/lib/patch_ruby/models/order_response.rb +++ b/lib/patch_ruby/models/order_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/photo.rb b/lib/patch_ruby/models/photo.rb index d851b76..69daef6 100644 --- a/lib/patch_ruby/models/photo.rb +++ b/lib/patch_ruby/models/photo.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/preference.rb b/lib/patch_ruby/models/preference.rb index 2ea0faa..7c60ac7 100644 --- a/lib/patch_ruby/models/preference.rb +++ b/lib/patch_ruby/models/preference.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/preference_list_response.rb b/lib/patch_ruby/models/preference_list_response.rb index cd31ce2..4d6a313 100644 --- a/lib/patch_ruby/models/preference_list_response.rb +++ b/lib/patch_ruby/models/preference_list_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/preference_response.rb b/lib/patch_ruby/models/preference_response.rb index 9249fe0..db56e0a 100644 --- a/lib/patch_ruby/models/preference_response.rb +++ b/lib/patch_ruby/models/preference_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/project.rb b/lib/patch_ruby/models/project.rb index eb3b8a7..3f6dccd 100644 --- a/lib/patch_ruby/models/project.rb +++ b/lib/patch_ruby/models/project.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/project_list_response.rb b/lib/patch_ruby/models/project_list_response.rb index 805828c..887be58 100644 --- a/lib/patch_ruby/models/project_list_response.rb +++ b/lib/patch_ruby/models/project_list_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/project_response.rb b/lib/patch_ruby/models/project_response.rb index 0e3a298..39eb3fc 100644 --- a/lib/patch_ruby/models/project_response.rb +++ b/lib/patch_ruby/models/project_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/sdg.rb b/lib/patch_ruby/models/sdg.rb index 0d7c905..066488d 100644 --- a/lib/patch_ruby/models/sdg.rb +++ b/lib/patch_ruby/models/sdg.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/lib/patch_ruby/models/standard.rb b/lib/patch_ruby/models/standard.rb index a4b52d6..d638c7e 100644 --- a/lib/patch_ruby/models/standard.rb +++ b/lib/patch_ruby/models/standard.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/spec/api_client_spec.rb b/spec/api_client_spec.rb index ba96b36..e906496 100644 --- a/spec/api_client_spec.rb +++ b/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb index a3a1efc..0a2271f 100644 --- a/spec/configuration_spec.rb +++ b/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ba1c91e..2dc541d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0 +OpenAPI Generator version: 5.1.0 =end From 70e76daf4ad77ad4c7fddeffe39daee9ae3ac550 Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Fri, 27 Aug 2021 08:15:41 -0700 Subject: [PATCH 03/15] Test with standard for model generic --- lib/patch_ruby/models/allocation.rb | 34 +++----- .../models/create_bitcoin_estimate_request.rb | 50 +++++------ .../create_ethereum_estimate_request.rb | 57 +++++-------- .../models/create_mass_estimate_request.rb | 37 +++----- lib/patch_ruby/models/create_order_request.rb | 38 ++++----- .../models/create_preference_request.rb | 23 ++--- lib/patch_ruby/models/error_response.rb | 37 +++----- lib/patch_ruby/models/estimate.rb | 45 ++++------ .../models/estimate_list_response.rb | 44 +++++----- lib/patch_ruby/models/estimate_response.rb | 37 +++----- lib/patch_ruby/models/meta_index_object.rb | 36 +++----- lib/patch_ruby/models/order.rb | 71 +++++++--------- lib/patch_ruby/models/order_list_response.rb | 44 +++++----- lib/patch_ruby/models/order_response.rb | 37 +++----- lib/patch_ruby/models/photo.rb | 30 +++---- lib/patch_ruby/models/preference.rb | 34 +++----- .../models/preference_list_response.rb | 44 +++++----- lib/patch_ruby/models/preference_response.rb | 37 +++----- lib/patch_ruby/models/project.rb | 85 +++++++++---------- .../models/project_list_response.rb | 44 +++++----- lib/patch_ruby/models/project_response.rb | 37 +++----- lib/patch_ruby/models/sdg.rb | 38 ++++----- lib/patch_ruby/models/standard.rb | 34 +++----- 23 files changed, 392 insertions(+), 581 deletions(-) diff --git a/lib/patch_ruby/models/allocation.rb b/lib/patch_ruby/models/allocation.rb index 98919d2..229220b 100644 --- a/lib/patch_ruby/models/allocation.rb +++ b/lib/patch_ruby/models/allocation.rb @@ -27,37 +27,30 @@ class Allocation # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'id' => :'id' - :'production' => :'production' + :'id' => :'id', + :'production' => :'production', :'mass_g' => :'mass_g' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'id' => :'String' - :'production' => :'Boolean' + :'id' => :'String', + :'production' => :'Boolean', :'mass_g' => :'Integer' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::AllocationsApi::OPERATIONS') && Patch::AllocationsApi::OPERATIONS.include?(message) - Patch::AllocationsApi.new.send(message, *args) - else - super - end + Set.new([ + ]) end # Initializes the object @@ -135,7 +128,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [idproductionmass_g].hash + [id, production, mass_g].hash end # Builds the object from hash @@ -255,6 +248,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/create_bitcoin_estimate_request.rb b/lib/patch_ruby/models/create_bitcoin_estimate_request.rb index 9f430af..4b70382 100644 --- a/lib/patch_ruby/models/create_bitcoin_estimate_request.rb +++ b/lib/patch_ruby/models/create_bitcoin_estimate_request.rb @@ -26,47 +26,36 @@ class CreateBitcoinEstimateRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'timestamp' => :'timestamp' - :'transaction_value_btc_sats' => :'transaction_value_btc_sats' - :'project_id' => :'project_id' + :'timestamp' => :'timestamp', + :'transaction_value_btc_sats' => :'transaction_value_btc_sats', + :'project_id' => :'project_id', :'create_order' => :'create_order' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'timestamp' => :'String' - :'transaction_value_btc_sats' => :'Integer' - :'project_id' => :'String' + :'timestamp' => :'String', + :'transaction_value_btc_sats' => :'Integer', + :'project_id' => :'String', :'create_order' => :'Boolean' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties.add("timestamp") - - nullable_properties.add("transaction_value_btc_sats") - - nullable_properties.add("project_id") - - nullable_properties.add("create_order") - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::CreateBitcoinEstimateRequestsApi::OPERATIONS') && Patch::CreateBitcoinEstimateRequestsApi::OPERATIONS.include?(message) - Patch::CreateBitcoinEstimateRequestsApi.new.send(message, *args) - else - super - end + Set.new([ + :'timestamp', + :'transaction_value_btc_sats', + :'project_id', + :'create_order' + ]) end # Initializes the object @@ -134,7 +123,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [timestamptransaction_value_btc_satsproject_idcreate_order].hash + [timestamp, transaction_value_btc_sats, project_id, create_order].hash end # Builds the object from hash @@ -254,6 +243,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/create_ethereum_estimate_request.rb b/lib/patch_ruby/models/create_ethereum_estimate_request.rb index 9a52d9a..79f3964 100644 --- a/lib/patch_ruby/models/create_ethereum_estimate_request.rb +++ b/lib/patch_ruby/models/create_ethereum_estimate_request.rb @@ -28,51 +28,39 @@ class CreateEthereumEstimateRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'timestamp' => :'timestamp' - :'gas_used' => :'gas_used' - :'transaction_value_eth_gwei' => :'transaction_value_eth_gwei' - :'project_id' => :'project_id' + :'timestamp' => :'timestamp', + :'gas_used' => :'gas_used', + :'transaction_value_eth_gwei' => :'transaction_value_eth_gwei', + :'project_id' => :'project_id', :'create_order' => :'create_order' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'timestamp' => :'String' - :'gas_used' => :'Integer' - :'transaction_value_eth_gwei' => :'Integer' - :'project_id' => :'String' + :'timestamp' => :'String', + :'gas_used' => :'Integer', + :'transaction_value_eth_gwei' => :'Integer', + :'project_id' => :'String', :'create_order' => :'Boolean' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties.add("timestamp") - - nullable_properties.add("gas_used") - - nullable_properties.add("transaction_value_eth_gwei") - - nullable_properties.add("project_id") - - nullable_properties.add("create_order") - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::CreateEthereumEstimateRequestsApi::OPERATIONS') && Patch::CreateEthereumEstimateRequestsApi::OPERATIONS.include?(message) - Patch::CreateEthereumEstimateRequestsApi.new.send(message, *args) - else - super - end + Set.new([ + :'timestamp', + :'gas_used', + :'transaction_value_eth_gwei', + :'project_id', + :'create_order' + ]) end # Initializes the object @@ -145,7 +133,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [timestampgas_usedtransaction_value_eth_gweiproject_idcreate_order].hash + [timestamp, gas_used, transaction_value_eth_gwei, project_id, create_order].hash end # Builds the object from hash @@ -265,6 +253,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/create_mass_estimate_request.rb b/lib/patch_ruby/models/create_mass_estimate_request.rb index a33ec8a..a6dafb4 100644 --- a/lib/patch_ruby/models/create_mass_estimate_request.rb +++ b/lib/patch_ruby/models/create_mass_estimate_request.rb @@ -24,39 +24,31 @@ class CreateMassEstimateRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'mass_g' => :'mass_g' - :'create_order' => :'create_order' + :'mass_g' => :'mass_g', + :'create_order' => :'create_order', :'project_id' => :'project_id' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'mass_g' => :'Integer' - :'create_order' => :'Boolean' + :'mass_g' => :'Integer', + :'create_order' => :'Boolean', :'project_id' => :'String' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties.add("create_order") - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::CreateMassEstimateRequestsApi::OPERATIONS') && Patch::CreateMassEstimateRequestsApi::OPERATIONS.include?(message) - Patch::CreateMassEstimateRequestsApi.new.send(message, *args) - else - super - end + Set.new([ + :'create_order', + ]) end # Initializes the object @@ -152,7 +144,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [mass_gcreate_orderproject_id].hash + [mass_g, create_order, project_id].hash end # Builds the object from hash @@ -272,6 +264,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/create_order_request.rb b/lib/patch_ruby/models/create_order_request.rb index 9f8370b..480c338 100644 --- a/lib/patch_ruby/models/create_order_request.rb +++ b/lib/patch_ruby/models/create_order_request.rb @@ -26,39 +26,32 @@ class CreateOrderRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'mass_g' => :'mass_g' - :'total_price_cents_usd' => :'total_price_cents_usd' - :'project_id' => :'project_id' + :'mass_g' => :'mass_g', + :'total_price_cents_usd' => :'total_price_cents_usd', + :'project_id' => :'project_id', :'metadata' => :'metadata' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'mass_g' => :'Integer' - :'total_price_cents_usd' => :'Integer' - :'project_id' => :'String' + :'mass_g' => :'Integer', + :'total_price_cents_usd' => :'Integer', + :'project_id' => :'String', :'metadata' => :'Object' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::CreateOrderRequestsApi::OPERATIONS') && Patch::CreateOrderRequestsApi::OPERATIONS.include?(message) - Patch::CreateOrderRequestsApi.new.send(message, *args) - else - super - end + Set.new([ + ]) end # Initializes the object @@ -165,7 +158,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [mass_gtotal_price_cents_usdproject_idmetadata].hash + [mass_g, total_price_cents_usd, project_id, metadata].hash end # Builds the object from hash @@ -285,6 +278,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/create_preference_request.rb b/lib/patch_ruby/models/create_preference_request.rb index d4aa6b5..6b8b3fe 100644 --- a/lib/patch_ruby/models/create_preference_request.rb +++ b/lib/patch_ruby/models/create_preference_request.rb @@ -24,6 +24,11 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { @@ -31,22 +36,10 @@ def self.openapi_types } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::CreatePreferenceRequestsApi::OPERATIONS') && Patch::CreatePreferenceRequestsApi::OPERATIONS.include?(message) - Patch::CreatePreferenceRequestsApi.new.send(message, *args) - else - super - end + Set.new([ + ]) end # Initializes the object diff --git a/lib/patch_ruby/models/error_response.rb b/lib/patch_ruby/models/error_response.rb index 8813888..91f5e87 100644 --- a/lib/patch_ruby/models/error_response.rb +++ b/lib/patch_ruby/models/error_response.rb @@ -24,39 +24,31 @@ class ErrorResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success' - :'error' => :'error' + :'success' => :'success', + :'error' => :'error', :'data' => :'data' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean' - :'error' => :'Object' + :'success' => :'Boolean', + :'error' => :'Object', :'data' => :'Object' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties.add("data") - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::ErrorResponsesApi::OPERATIONS') && Patch::ErrorResponsesApi::OPERATIONS.include?(message) - Patch::ErrorResponsesApi.new.send(message, *args) - else - super - end + Set.new([ + :'data' + ]) end # Initializes the object @@ -129,7 +121,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [successerrordata].hash + [success, error, data].hash end # Builds the object from hash @@ -249,6 +241,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/estimate.rb b/lib/patch_ruby/models/estimate.rb index 995bf3b..4d3ac31 100644 --- a/lib/patch_ruby/models/estimate.rb +++ b/lib/patch_ruby/models/estimate.rb @@ -33,43 +33,35 @@ class Estimate # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'id' => :'id' - :'production' => :'production' - :'type' => :'type' - :'mass_g' => :'mass_g' + :'id' => :'id', + :'production' => :'production', + :'type' => :'type', + :'mass_g' => :'mass_g', :'order' => :'order' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'id' => :'String' - :'production' => :'Boolean' - :'type' => :'String' - :'mass_g' => :'Integer' + :'id' => :'String', + :'production' => :'Boolean', + :'type' => :'String', + :'mass_g' => :'Integer', :'order' => :'Order' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties.add("order") - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::EstimatesApi::OPERATIONS') && Patch::EstimatesApi::OPERATIONS.include?(message) - Patch::EstimatesApi.new.send(message, *args) - else - super - end + Set.new([ + :'order' + ]) end # Initializes the object @@ -157,7 +149,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [idproductiontypemass_gorder].hash + [id, production, type, mass_g, order].hash end # Builds the object from hash @@ -277,6 +269,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/estimate_list_response.rb b/lib/patch_ruby/models/estimate_list_response.rb index 64c213c..0cf85ca 100644 --- a/lib/patch_ruby/models/estimate_list_response.rb +++ b/lib/patch_ruby/models/estimate_list_response.rb @@ -26,41 +26,33 @@ class EstimateListResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success' - :'error' => :'error' - :'data' => :'data' + :'success' => :'success', + :'error' => :'error', + :'data' => :'data', :'meta' => :'meta' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean' - :'error' => :'Object' - :'data' => :'Array' + :'success' => :'Boolean', + :'error' => :'Object', + :'data' => :'Array', :'meta' => :'MetaIndexObject' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties.add("error") - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::EstimateListResponsesApi::OPERATIONS') && Patch::EstimateListResponsesApi::OPERATIONS.include?(message) - Patch::EstimateListResponsesApi.new.send(message, *args) - else - super - end + Set.new([ + :'error', + ]) end # Initializes the object @@ -87,6 +79,9 @@ def initialize(attributes = {}) end if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end end if attributes.key?(:'meta') @@ -142,7 +137,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [successerrordatameta].hash + [success, error, data, meta].hash end # Builds the object from hash @@ -262,6 +257,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/estimate_response.rb b/lib/patch_ruby/models/estimate_response.rb index 54ba69d..40239d6 100644 --- a/lib/patch_ruby/models/estimate_response.rb +++ b/lib/patch_ruby/models/estimate_response.rb @@ -24,39 +24,31 @@ class EstimateResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success' - :'error' => :'error' + :'success' => :'success', + :'error' => :'error', :'data' => :'data' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean' - :'error' => :'Object' + :'success' => :'Boolean', + :'error' => :'Object', :'data' => :'Estimate' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties.add("error") - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::EstimateResponsesApi::OPERATIONS') && Patch::EstimateResponsesApi::OPERATIONS.include?(message) - Patch::EstimateResponsesApi.new.send(message, *args) - else - super - end + Set.new([ + :'error', + ]) end # Initializes the object @@ -129,7 +121,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [successerrordata].hash + [success, error, data].hash end # Builds the object from hash @@ -249,6 +241,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/meta_index_object.rb b/lib/patch_ruby/models/meta_index_object.rb index 20f9fa1..0f8595e 100644 --- a/lib/patch_ruby/models/meta_index_object.rb +++ b/lib/patch_ruby/models/meta_index_object.rb @@ -22,39 +22,30 @@ class MetaIndexObject # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'prev_page' => :'prev_page' + :'prev_page' => :'prev_page', :'next_page' => :'next_page' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'prev_page' => :'Integer' + :'prev_page' => :'Integer', :'next_page' => :'Integer' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties.add("prev_page") - - nullable_properties.add("next_page") - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::MetaIndexObjectsApi::OPERATIONS') && Patch::MetaIndexObjectsApi::OPERATIONS.include?(message) - Patch::MetaIndexObjectsApi.new.send(message, *args) - else - super - end + Set.new([ + :'prev_page', + :'next_page' + ]) end # Initializes the object @@ -112,7 +103,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [prev_pagenext_page].hash + [prev_page, next_page].hash end # Builds the object from hash @@ -232,6 +223,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/order.rb b/lib/patch_ruby/models/order.rb index ba30f52..e3421ad 100644 --- a/lib/patch_ruby/models/order.rb +++ b/lib/patch_ruby/models/order.rb @@ -70,55 +70,46 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'id' => :'id' - :'mass_g' => :'mass_g' - :'production' => :'production' - :'state' => :'state' - :'allocation_state' => :'allocation_state' - :'price_cents_usd' => :'price_cents_usd' - :'patch_fee_cents_usd' => :'patch_fee_cents_usd' - :'allocations' => :'allocations' - :'registry_url' => :'registry_url' + :'id' => :'id', + :'mass_g' => :'mass_g', + :'production' => :'production', + :'state' => :'state', + :'allocation_state' => :'allocation_state', + :'price_cents_usd' => :'price_cents_usd', + :'patch_fee_cents_usd' => :'patch_fee_cents_usd', + :'allocations' => :'allocations', + :'registry_url' => :'registry_url', :'metadata' => :'metadata' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'id' => :'String' - :'mass_g' => :'Integer' - :'production' => :'Boolean' - :'state' => :'String' - :'allocation_state' => :'String' - :'price_cents_usd' => :'Integer' - :'patch_fee_cents_usd' => :'Integer' - :'allocations' => :'Array' - :'registry_url' => :'String' + :'id' => :'String', + :'mass_g' => :'Integer', + :'production' => :'Boolean', + :'state' => :'String', + :'allocation_state' => :'String', + :'price_cents_usd' => :'Integer', + :'patch_fee_cents_usd' => :'Integer', + :'allocations' => :'Array', + :'registry_url' => :'String', :'metadata' => :'Object' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties.add("price_cents_usd") - - nullable_properties.add("patch_fee_cents_usd") - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::OrdersApi::OPERATIONS') && Patch::OrdersApi::OPERATIONS.include?(message) - Patch::OrdersApi.new.send(message, *args) - else - super - end + Set.new([ + :'price_cents_usd', + :'patch_fee_cents_usd', + ]) end # Initializes the object @@ -165,6 +156,9 @@ def initialize(attributes = {}) end if attributes.key?(:'allocations') + if (value = attributes[:'allocations']).is_a?(Array) + self.allocations = value + end end if attributes.key?(:'registry_url') @@ -302,7 +296,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [idmass_gproductionstateallocation_stateprice_cents_usdpatch_fee_cents_usdallocationsregistry_urlmetadata].hash + [id, mass_g, production, state, allocation_state, price_cents_usd, patch_fee_cents_usd, allocations, registry_url, metadata].hash end # Builds the object from hash @@ -422,6 +416,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/order_list_response.rb b/lib/patch_ruby/models/order_list_response.rb index 3925033..2da46b6 100644 --- a/lib/patch_ruby/models/order_list_response.rb +++ b/lib/patch_ruby/models/order_list_response.rb @@ -26,41 +26,33 @@ class OrderListResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success' - :'error' => :'error' - :'data' => :'data' + :'success' => :'success', + :'error' => :'error', + :'data' => :'data', :'meta' => :'meta' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean' - :'error' => :'Object' - :'data' => :'Array' + :'success' => :'Boolean', + :'error' => :'Object', + :'data' => :'Array', :'meta' => :'MetaIndexObject' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties.add("error") - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::OrderListResponsesApi::OPERATIONS') && Patch::OrderListResponsesApi::OPERATIONS.include?(message) - Patch::OrderListResponsesApi.new.send(message, *args) - else - super - end + Set.new([ + :'error', + ]) end # Initializes the object @@ -87,6 +79,9 @@ def initialize(attributes = {}) end if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end end if attributes.key?(:'meta') @@ -142,7 +137,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [successerrordatameta].hash + [success, error, data, meta].hash end # Builds the object from hash @@ -262,6 +257,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/order_response.rb b/lib/patch_ruby/models/order_response.rb index 2b64432..f77ec7a 100644 --- a/lib/patch_ruby/models/order_response.rb +++ b/lib/patch_ruby/models/order_response.rb @@ -24,39 +24,31 @@ class OrderResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success' - :'error' => :'error' + :'success' => :'success', + :'error' => :'error', :'data' => :'data' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean' - :'error' => :'Object' + :'success' => :'Boolean', + :'error' => :'Object', :'data' => :'Order' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties.add("error") - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::OrderResponsesApi::OPERATIONS') && Patch::OrderResponsesApi::OPERATIONS.include?(message) - Patch::OrderResponsesApi.new.send(message, *args) - else - super - end + Set.new([ + :'error', + ]) end # Initializes the object @@ -129,7 +121,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [successerrordata].hash + [success, error, data].hash end # Builds the object from hash @@ -249,6 +241,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/photo.rb b/lib/patch_ruby/models/photo.rb index 69daef6..cff0d18 100644 --- a/lib/patch_ruby/models/photo.rb +++ b/lib/patch_ruby/models/photo.rb @@ -22,35 +22,28 @@ class Photo # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'url' => :'url' + :'url' => :'url', :'id' => :'id' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'url' => :'String' + :'url' => :'String', :'id' => :'String' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::PhotosApi::OPERATIONS') && Patch::PhotosApi::OPERATIONS.include?(message) - Patch::PhotosApi.new.send(message, *args) - else - super - end + Set.new([ + ]) end # Initializes the object @@ -118,7 +111,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [urlid].hash + [url, id].hash end # Builds the object from hash @@ -238,6 +231,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/preference.rb b/lib/patch_ruby/models/preference.rb index 7c60ac7..ce3fe7e 100644 --- a/lib/patch_ruby/models/preference.rb +++ b/lib/patch_ruby/models/preference.rb @@ -27,37 +27,30 @@ class Preference # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'id' => :'id' - :'allocation_percentage' => :'allocation_percentage' + :'id' => :'id', + :'allocation_percentage' => :'allocation_percentage', :'project' => :'project' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'id' => :'String' - :'allocation_percentage' => :'Integer' + :'id' => :'String', + :'allocation_percentage' => :'Integer', :'project' => :'Project' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::PreferencesApi::OPERATIONS') && Patch::PreferencesApi::OPERATIONS.include?(message) - Patch::PreferencesApi.new.send(message, *args) - else - super - end + Set.new([ + ]) end # Initializes the object @@ -135,7 +128,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [idallocation_percentageproject].hash + [id, allocation_percentage, project].hash end # Builds the object from hash @@ -255,6 +248,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/preference_list_response.rb b/lib/patch_ruby/models/preference_list_response.rb index 4d6a313..f492760 100644 --- a/lib/patch_ruby/models/preference_list_response.rb +++ b/lib/patch_ruby/models/preference_list_response.rb @@ -26,41 +26,33 @@ class PreferenceListResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success' - :'error' => :'error' - :'data' => :'data' + :'success' => :'success', + :'error' => :'error', + :'data' => :'data', :'meta' => :'meta' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean' - :'error' => :'Object' - :'data' => :'Array' + :'success' => :'Boolean', + :'error' => :'Object', + :'data' => :'Array', :'meta' => :'MetaIndexObject' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties.add("error") - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::PreferenceListResponsesApi::OPERATIONS') && Patch::PreferenceListResponsesApi::OPERATIONS.include?(message) - Patch::PreferenceListResponsesApi.new.send(message, *args) - else - super - end + Set.new([ + :'error', + ]) end # Initializes the object @@ -87,6 +79,9 @@ def initialize(attributes = {}) end if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end end if attributes.key?(:'meta') @@ -142,7 +137,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [successerrordatameta].hash + [success, error, data, meta].hash end # Builds the object from hash @@ -262,6 +257,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/preference_response.rb b/lib/patch_ruby/models/preference_response.rb index db56e0a..69c52cd 100644 --- a/lib/patch_ruby/models/preference_response.rb +++ b/lib/patch_ruby/models/preference_response.rb @@ -24,39 +24,31 @@ class PreferenceResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success' - :'error' => :'error' + :'success' => :'success', + :'error' => :'error', :'data' => :'data' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean' - :'error' => :'Object' + :'success' => :'Boolean', + :'error' => :'Object', :'data' => :'Preference' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties.add("error") - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::PreferenceResponsesApi::OPERATIONS') && Patch::PreferenceResponsesApi::OPERATIONS.include?(message) - Patch::PreferenceResponsesApi.new.send(message, *args) - else - super - end + Set.new([ + :'error', + ]) end # Initializes the object @@ -129,7 +121,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [successerrordata].hash + [success, error, data].hash end # Builds the object from hash @@ -249,6 +241,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/project.rb b/lib/patch_ruby/models/project.rb index 3f6dccd..0cd15eb 100644 --- a/lib/patch_ruby/models/project.rb +++ b/lib/patch_ruby/models/project.rb @@ -76,61 +76,51 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'id' => :'id' - :'production' => :'production' - :'name' => :'name' - :'description' => :'description' - :'type' => :'type' - :'country' => :'country' - :'developer' => :'developer' - :'photos' => :'photos' - :'average_price_per_tonne_cents_usd' => :'average_price_per_tonne_cents_usd' - :'remaining_mass_g' => :'remaining_mass_g' - :'standard' => :'standard' + :'id' => :'id', + :'production' => :'production', + :'name' => :'name', + :'description' => :'description', + :'type' => :'type', + :'country' => :'country', + :'developer' => :'developer', + :'photos' => :'photos', + :'average_price_per_tonne_cents_usd' => :'average_price_per_tonne_cents_usd', + :'remaining_mass_g' => :'remaining_mass_g', + :'standard' => :'standard', :'sdgs' => :'sdgs' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'id' => :'String' - :'production' => :'Boolean' - :'name' => :'String' - :'description' => :'String' - :'type' => :'String' - :'country' => :'String' - :'developer' => :'String' - :'photos' => :'Array' - :'average_price_per_tonne_cents_usd' => :'Integer' - :'remaining_mass_g' => :'Integer' - :'standard' => :'Standard' + :'id' => :'String', + :'production' => :'Boolean', + :'name' => :'String', + :'description' => :'String', + :'type' => :'String', + :'country' => :'String', + :'developer' => :'String', + :'photos' => :'Array', + :'average_price_per_tonne_cents_usd' => :'Integer', + :'remaining_mass_g' => :'Integer', + :'standard' => :'Standard', :'sdgs' => :'Array' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties.add("photos") - - nullable_properties.add("standard") - - nullable_properties.add("sdgs") - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::ProjectsApi::OPERATIONS') && Patch::ProjectsApi::OPERATIONS.include?(message) - Patch::ProjectsApi.new.send(message, *args) - else - super - end + Set.new([ + :'photos', + :'standard', + :'sdgs' + ]) end # Initializes the object @@ -177,6 +167,9 @@ def initialize(attributes = {}) end if attributes.key?(:'photos') + if (value = attributes[:'photos']).is_a?(Array) + self.photos = value + end end if attributes.key?(:'average_price_per_tonne_cents_usd') @@ -192,6 +185,9 @@ def initialize(attributes = {}) end if attributes.key?(:'sdgs') + if (value = attributes[:'sdgs']).is_a?(Array) + self.sdgs = value + end end end @@ -288,7 +284,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [idproductionnamedescriptiontypecountrydeveloperphotosaverage_price_per_tonne_cents_usdremaining_mass_gstandardsdgs].hash + [id, production, name, description, type, country, developer, photos, average_price_per_tonne_cents_usd, remaining_mass_g, standard, sdgs].hash end # Builds the object from hash @@ -408,6 +404,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/project_list_response.rb b/lib/patch_ruby/models/project_list_response.rb index 887be58..b63b974 100644 --- a/lib/patch_ruby/models/project_list_response.rb +++ b/lib/patch_ruby/models/project_list_response.rb @@ -26,41 +26,33 @@ class ProjectListResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success' - :'error' => :'error' - :'data' => :'data' + :'success' => :'success', + :'error' => :'error', + :'data' => :'data', :'meta' => :'meta' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean' - :'error' => :'Object' - :'data' => :'Array' + :'success' => :'Boolean', + :'error' => :'Object', + :'data' => :'Array', :'meta' => :'MetaIndexObject' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties.add("error") - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::ProjectListResponsesApi::OPERATIONS') && Patch::ProjectListResponsesApi::OPERATIONS.include?(message) - Patch::ProjectListResponsesApi.new.send(message, *args) - else - super - end + Set.new([ + :'error', + ]) end # Initializes the object @@ -87,6 +79,9 @@ def initialize(attributes = {}) end if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end end if attributes.key?(:'meta') @@ -142,7 +137,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [successerrordatameta].hash + [success, error, data, meta].hash end # Builds the object from hash @@ -262,6 +257,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/project_response.rb b/lib/patch_ruby/models/project_response.rb index 39eb3fc..50ce93f 100644 --- a/lib/patch_ruby/models/project_response.rb +++ b/lib/patch_ruby/models/project_response.rb @@ -24,39 +24,31 @@ class ProjectResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success' - :'error' => :'error' + :'success' => :'success', + :'error' => :'error', :'data' => :'data' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean' - :'error' => :'Object' + :'success' => :'Boolean', + :'error' => :'Object', :'data' => :'Project' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties.add("error") - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::ProjectResponsesApi::OPERATIONS') && Patch::ProjectResponsesApi::OPERATIONS.include?(message) - Patch::ProjectResponsesApi.new.send(message, *args) - else - super - end + Set.new([ + :'error', + ]) end # Initializes the object @@ -129,7 +121,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [successerrordata].hash + [success, error, data].hash end # Builds the object from hash @@ -249,6 +241,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/sdg.rb b/lib/patch_ruby/models/sdg.rb index 066488d..132d811 100644 --- a/lib/patch_ruby/models/sdg.rb +++ b/lib/patch_ruby/models/sdg.rb @@ -30,39 +30,32 @@ class Sdg # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'title' => :'title' - :'number' => :'number' - :'description' => :'description' + :'title' => :'title', + :'number' => :'number', + :'description' => :'description', :'url' => :'url' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'title' => :'String' - :'number' => :'Integer' - :'description' => :'String' + :'title' => :'String', + :'number' => :'Integer', + :'description' => :'String', :'url' => :'String' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::SdgsApi::OPERATIONS') && Patch::SdgsApi::OPERATIONS.include?(message) - Patch::SdgsApi.new.send(message, *args) - else - super - end + Set.new([ + ]) end # Initializes the object @@ -150,7 +143,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [titlenumberdescriptionurl].hash + [title, number, description, url].hash end # Builds the object from hash @@ -270,6 +263,5 @@ def _to_hash(value) value end end - end end diff --git a/lib/patch_ruby/models/standard.rb b/lib/patch_ruby/models/standard.rb index d638c7e..2e4e9fd 100644 --- a/lib/patch_ruby/models/standard.rb +++ b/lib/patch_ruby/models/standard.rb @@ -27,37 +27,30 @@ class Standard # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'type' => :'type' - :'acronym' => :'acronym' + :'type' => :'type', + :'acronym' => :'acronym', :'description' => :'description' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'type' => :'String' - :'acronym' => :'String' + :'type' => :'String', + :'acronym' => :'String', :'description' => :'String' } end - # Set with nullable attributes. + # List of attributes with nullable: true def self.openapi_nullable - nullable_properties = Set.new - - nullable_properties - end - - # Allows models with corresponding API classes to delegate API operations to those API classes - # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id - # Eg. Order.create_order delegates to OrdersApi.new.create_order - def self.method_missing(message, *args, &block) - if Object.const_defined?('Patch::StandardsApi::OPERATIONS') && Patch::StandardsApi::OPERATIONS.include?(message) - Patch::StandardsApi.new.send(message, *args) - else - super - end + Set.new([ + ]) end # Initializes the object @@ -135,7 +128,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [typeacronymdescription].hash + [type, acronym, description].hash end # Builds the object from hash @@ -255,6 +248,5 @@ def _to_hash(value) value end end - end end From c315d862019e7c0a68d06be241d905f6e829c22d Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Fri, 27 Aug 2021 08:26:44 -0700 Subject: [PATCH 04/15] Re-add partial --- lib/patch_ruby/models/allocation.rb | 12 ++++++++++++ .../models/create_bitcoin_estimate_request.rb | 12 ++++++++++++ .../models/create_ethereum_estimate_request.rb | 12 ++++++++++++ .../models/create_mass_estimate_request.rb | 12 ++++++++++++ lib/patch_ruby/models/create_order_request.rb | 12 ++++++++++++ lib/patch_ruby/models/create_preference_request.rb | 12 ++++++++++++ lib/patch_ruby/models/error_response.rb | 12 ++++++++++++ lib/patch_ruby/models/estimate.rb | 12 ++++++++++++ lib/patch_ruby/models/estimate_list_response.rb | 12 ++++++++++++ lib/patch_ruby/models/estimate_response.rb | 12 ++++++++++++ lib/patch_ruby/models/meta_index_object.rb | 12 ++++++++++++ lib/patch_ruby/models/order.rb | 12 ++++++++++++ lib/patch_ruby/models/order_list_response.rb | 12 ++++++++++++ lib/patch_ruby/models/order_response.rb | 12 ++++++++++++ lib/patch_ruby/models/photo.rb | 12 ++++++++++++ lib/patch_ruby/models/preference.rb | 12 ++++++++++++ lib/patch_ruby/models/preference_list_response.rb | 12 ++++++++++++ lib/patch_ruby/models/preference_response.rb | 12 ++++++++++++ lib/patch_ruby/models/project.rb | 12 ++++++++++++ lib/patch_ruby/models/project_list_response.rb | 12 ++++++++++++ lib/patch_ruby/models/project_response.rb | 12 ++++++++++++ lib/patch_ruby/models/sdg.rb | 12 ++++++++++++ lib/patch_ruby/models/standard.rb | 12 ++++++++++++ 23 files changed, 276 insertions(+) diff --git a/lib/patch_ruby/models/allocation.rb b/lib/patch_ruby/models/allocation.rb index 229220b..133572c 100644 --- a/lib/patch_ruby/models/allocation.rb +++ b/lib/patch_ruby/models/allocation.rb @@ -53,6 +53,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::AllocationsApi::OPERATIONS') && Patch::AllocationsApi::OPERATIONS.include?(message) + Patch::AllocationsApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/create_bitcoin_estimate_request.rb b/lib/patch_ruby/models/create_bitcoin_estimate_request.rb index 4b70382..4f4aff5 100644 --- a/lib/patch_ruby/models/create_bitcoin_estimate_request.rb +++ b/lib/patch_ruby/models/create_bitcoin_estimate_request.rb @@ -58,6 +58,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::CreateBitcoinEstimateRequestsApi::OPERATIONS') && Patch::CreateBitcoinEstimateRequestsApi::OPERATIONS.include?(message) + Patch::CreateBitcoinEstimateRequestsApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/create_ethereum_estimate_request.rb b/lib/patch_ruby/models/create_ethereum_estimate_request.rb index 79f3964..d728174 100644 --- a/lib/patch_ruby/models/create_ethereum_estimate_request.rb +++ b/lib/patch_ruby/models/create_ethereum_estimate_request.rb @@ -63,6 +63,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::CreateEthereumEstimateRequestsApi::OPERATIONS') && Patch::CreateEthereumEstimateRequestsApi::OPERATIONS.include?(message) + Patch::CreateEthereumEstimateRequestsApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/create_mass_estimate_request.rb b/lib/patch_ruby/models/create_mass_estimate_request.rb index a6dafb4..e8c8537 100644 --- a/lib/patch_ruby/models/create_mass_estimate_request.rb +++ b/lib/patch_ruby/models/create_mass_estimate_request.rb @@ -51,6 +51,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::CreateMassEstimateRequestsApi::OPERATIONS') && Patch::CreateMassEstimateRequestsApi::OPERATIONS.include?(message) + Patch::CreateMassEstimateRequestsApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/create_order_request.rb b/lib/patch_ruby/models/create_order_request.rb index 480c338..cdd0b0c 100644 --- a/lib/patch_ruby/models/create_order_request.rb +++ b/lib/patch_ruby/models/create_order_request.rb @@ -54,6 +54,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::CreateOrderRequestsApi::OPERATIONS') && Patch::CreateOrderRequestsApi::OPERATIONS.include?(message) + Patch::CreateOrderRequestsApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/create_preference_request.rb b/lib/patch_ruby/models/create_preference_request.rb index 6b8b3fe..ed9f0d8 100644 --- a/lib/patch_ruby/models/create_preference_request.rb +++ b/lib/patch_ruby/models/create_preference_request.rb @@ -42,6 +42,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::CreatePreferenceRequestsApi::OPERATIONS') && Patch::CreatePreferenceRequestsApi::OPERATIONS.include?(message) + Patch::CreatePreferenceRequestsApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/error_response.rb b/lib/patch_ruby/models/error_response.rb index 91f5e87..6c9a273 100644 --- a/lib/patch_ruby/models/error_response.rb +++ b/lib/patch_ruby/models/error_response.rb @@ -51,6 +51,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::ErrorResponsesApi::OPERATIONS') && Patch::ErrorResponsesApi::OPERATIONS.include?(message) + Patch::ErrorResponsesApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/estimate.rb b/lib/patch_ruby/models/estimate.rb index 4d3ac31..d6f40fc 100644 --- a/lib/patch_ruby/models/estimate.rb +++ b/lib/patch_ruby/models/estimate.rb @@ -64,6 +64,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::EstimatesApi::OPERATIONS') && Patch::EstimatesApi::OPERATIONS.include?(message) + Patch::EstimatesApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/estimate_list_response.rb b/lib/patch_ruby/models/estimate_list_response.rb index 0cf85ca..ea3896f 100644 --- a/lib/patch_ruby/models/estimate_list_response.rb +++ b/lib/patch_ruby/models/estimate_list_response.rb @@ -55,6 +55,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::EstimateListResponsesApi::OPERATIONS') && Patch::EstimateListResponsesApi::OPERATIONS.include?(message) + Patch::EstimateListResponsesApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/estimate_response.rb b/lib/patch_ruby/models/estimate_response.rb index 40239d6..6888295 100644 --- a/lib/patch_ruby/models/estimate_response.rb +++ b/lib/patch_ruby/models/estimate_response.rb @@ -51,6 +51,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::EstimateResponsesApi::OPERATIONS') && Patch::EstimateResponsesApi::OPERATIONS.include?(message) + Patch::EstimateResponsesApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/meta_index_object.rb b/lib/patch_ruby/models/meta_index_object.rb index 0f8595e..3513a6c 100644 --- a/lib/patch_ruby/models/meta_index_object.rb +++ b/lib/patch_ruby/models/meta_index_object.rb @@ -48,6 +48,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::MetaIndexObjectsApi::OPERATIONS') && Patch::MetaIndexObjectsApi::OPERATIONS.include?(message) + Patch::MetaIndexObjectsApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/order.rb b/lib/patch_ruby/models/order.rb index e3421ad..d246034 100644 --- a/lib/patch_ruby/models/order.rb +++ b/lib/patch_ruby/models/order.rb @@ -112,6 +112,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::OrdersApi::OPERATIONS') && Patch::OrdersApi::OPERATIONS.include?(message) + Patch::OrdersApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/order_list_response.rb b/lib/patch_ruby/models/order_list_response.rb index 2da46b6..b3face1 100644 --- a/lib/patch_ruby/models/order_list_response.rb +++ b/lib/patch_ruby/models/order_list_response.rb @@ -55,6 +55,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::OrderListResponsesApi::OPERATIONS') && Patch::OrderListResponsesApi::OPERATIONS.include?(message) + Patch::OrderListResponsesApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/order_response.rb b/lib/patch_ruby/models/order_response.rb index f77ec7a..68002b8 100644 --- a/lib/patch_ruby/models/order_response.rb +++ b/lib/patch_ruby/models/order_response.rb @@ -51,6 +51,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::OrderResponsesApi::OPERATIONS') && Patch::OrderResponsesApi::OPERATIONS.include?(message) + Patch::OrderResponsesApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/photo.rb b/lib/patch_ruby/models/photo.rb index cff0d18..bc471d6 100644 --- a/lib/patch_ruby/models/photo.rb +++ b/lib/patch_ruby/models/photo.rb @@ -46,6 +46,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::PhotosApi::OPERATIONS') && Patch::PhotosApi::OPERATIONS.include?(message) + Patch::PhotosApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/preference.rb b/lib/patch_ruby/models/preference.rb index ce3fe7e..3834c5b 100644 --- a/lib/patch_ruby/models/preference.rb +++ b/lib/patch_ruby/models/preference.rb @@ -53,6 +53,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::PreferencesApi::OPERATIONS') && Patch::PreferencesApi::OPERATIONS.include?(message) + Patch::PreferencesApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/preference_list_response.rb b/lib/patch_ruby/models/preference_list_response.rb index f492760..f6d3064 100644 --- a/lib/patch_ruby/models/preference_list_response.rb +++ b/lib/patch_ruby/models/preference_list_response.rb @@ -55,6 +55,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::PreferenceListResponsesApi::OPERATIONS') && Patch::PreferenceListResponsesApi::OPERATIONS.include?(message) + Patch::PreferenceListResponsesApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/preference_response.rb b/lib/patch_ruby/models/preference_response.rb index 69c52cd..ad4beeb 100644 --- a/lib/patch_ruby/models/preference_response.rb +++ b/lib/patch_ruby/models/preference_response.rb @@ -51,6 +51,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::PreferenceResponsesApi::OPERATIONS') && Patch::PreferenceResponsesApi::OPERATIONS.include?(message) + Patch::PreferenceResponsesApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/project.rb b/lib/patch_ruby/models/project.rb index 0cd15eb..3396796 100644 --- a/lib/patch_ruby/models/project.rb +++ b/lib/patch_ruby/models/project.rb @@ -123,6 +123,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::ProjectsApi::OPERATIONS') && Patch::ProjectsApi::OPERATIONS.include?(message) + Patch::ProjectsApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/project_list_response.rb b/lib/patch_ruby/models/project_list_response.rb index b63b974..7ec73b7 100644 --- a/lib/patch_ruby/models/project_list_response.rb +++ b/lib/patch_ruby/models/project_list_response.rb @@ -55,6 +55,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::ProjectListResponsesApi::OPERATIONS') && Patch::ProjectListResponsesApi::OPERATIONS.include?(message) + Patch::ProjectListResponsesApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/project_response.rb b/lib/patch_ruby/models/project_response.rb index 50ce93f..cb55982 100644 --- a/lib/patch_ruby/models/project_response.rb +++ b/lib/patch_ruby/models/project_response.rb @@ -51,6 +51,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::ProjectResponsesApi::OPERATIONS') && Patch::ProjectResponsesApi::OPERATIONS.include?(message) + Patch::ProjectResponsesApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/sdg.rb b/lib/patch_ruby/models/sdg.rb index 132d811..d301261 100644 --- a/lib/patch_ruby/models/sdg.rb +++ b/lib/patch_ruby/models/sdg.rb @@ -58,6 +58,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::SdgsApi::OPERATIONS') && Patch::SdgsApi::OPERATIONS.include?(message) + Patch::SdgsApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) diff --git a/lib/patch_ruby/models/standard.rb b/lib/patch_ruby/models/standard.rb index 2e4e9fd..079e4a4 100644 --- a/lib/patch_ruby/models/standard.rb +++ b/lib/patch_ruby/models/standard.rb @@ -53,6 +53,18 @@ def self.openapi_nullable ]) end + + # Allows models with corresponding API classes to delegate API operations to those API classes + # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id + # Eg. Order.create_order delegates to OrdersApi.new.create_order + def self.method_missing(message, *args, &block) + if Object.const_defined?('Patch::StandardsApi::OPERATIONS') && Patch::StandardsApi::OPERATIONS.include?(message) + Patch::StandardsApi.new.send(message, *args) + else + super + end + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) From 9d1afded9f48013e0324c07e432acdabc468a45c Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Fri, 27 Aug 2021 08:38:34 -0700 Subject: [PATCH 05/15] Bite some bullets --- lib/patch_ruby/api/estimates_api.rb | 67 +++++++++---------- lib/patch_ruby/api/orders_api.rb | 43 ++++++------ lib/patch_ruby/api/preferences_api.rb | 35 +++++----- lib/patch_ruby/api/projects_api.rb | 19 +++--- lib/patch_ruby/models/allocation.rb | 1 - .../models/create_bitcoin_estimate_request.rb | 1 - .../create_ethereum_estimate_request.rb | 1 - .../models/create_mass_estimate_request.rb | 1 - lib/patch_ruby/models/create_order_request.rb | 1 - .../models/create_preference_request.rb | 1 - lib/patch_ruby/models/error_response.rb | 1 - lib/patch_ruby/models/estimate.rb | 1 - .../models/estimate_list_response.rb | 1 - lib/patch_ruby/models/estimate_response.rb | 1 - lib/patch_ruby/models/meta_index_object.rb | 1 - lib/patch_ruby/models/order.rb | 1 - lib/patch_ruby/models/order_list_response.rb | 1 - lib/patch_ruby/models/order_response.rb | 1 - lib/patch_ruby/models/photo.rb | 1 - lib/patch_ruby/models/preference.rb | 1 - .../models/preference_list_response.rb | 1 - lib/patch_ruby/models/preference_response.rb | 1 - lib/patch_ruby/models/project.rb | 1 - .../models/project_list_response.rb | 1 - lib/patch_ruby/models/project_response.rb | 1 - lib/patch_ruby/models/sdg.rb | 1 - lib/patch_ruby/models/standard.rb | 1 - 27 files changed, 76 insertions(+), 111 deletions(-) diff --git a/lib/patch_ruby/api/estimates_api.rb b/lib/patch_ruby/api/estimates_api.rb index ba8ea3c..20d1339 100644 --- a/lib/patch_ruby/api/estimates_api.rb +++ b/lib/patch_ruby/api/estimates_api.rb @@ -14,17 +14,6 @@ module Patch class EstimatesApi - OPERATIONS = [ - :create_bitcoin_estimate, - :create_ethereum_estimate, - :create_flight_estimate, - :create_mass_estimate, - :create_shipping_estimate, - :create_vehicle_estimate, - :retrieve_estimate, - :retrieve_estimates, - ] - attr_accessor :api_client def initialize(api_client = ApiClient.default) @@ -70,15 +59,16 @@ def create_bitcoin_estimate_with_http_info(create_bitcoin_estimate_request, opts form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(create_bitcoin_estimate_request) + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_bitcoin_estimate_request) # return_type - return_type = opts[:return_type] || 'EstimateResponse' + return_type = opts[:debug_return_type] || 'EstimateResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"EstimatesApi.create_bitcoin_estimate", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -134,15 +124,16 @@ def create_ethereum_estimate_with_http_info(create_ethereum_estimate_request, op form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(create_ethereum_estimate_request) + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_ethereum_estimate_request) # return_type - return_type = opts[:return_type] || 'EstimateResponse' + return_type = opts[:debug_return_type] || 'EstimateResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"EstimatesApi.create_ethereum_estimate", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -198,15 +189,16 @@ def create_flight_estimate_with_http_info(create_flight_estimate_request, opts = form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(create_flight_estimate_request) + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_flight_estimate_request) # return_type - return_type = opts[:return_type] || 'EstimateResponse' + return_type = opts[:debug_return_type] || 'EstimateResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"EstimatesApi.create_flight_estimate", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -262,15 +254,16 @@ def create_mass_estimate_with_http_info(create_mass_estimate_request, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(create_mass_estimate_request) + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_mass_estimate_request) # return_type - return_type = opts[:return_type] || 'EstimateResponse' + return_type = opts[:debug_return_type] || 'EstimateResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"EstimatesApi.create_mass_estimate", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -326,15 +319,16 @@ def create_shipping_estimate_with_http_info(create_shipping_estimate_request, op form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(create_shipping_estimate_request) + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_shipping_estimate_request) # return_type - return_type = opts[:return_type] || 'EstimateResponse' + return_type = opts[:debug_return_type] || 'EstimateResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"EstimatesApi.create_shipping_estimate", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -390,15 +384,16 @@ def create_vehicle_estimate_with_http_info(create_vehicle_estimate_request, opts form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(create_vehicle_estimate_request) + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_vehicle_estimate_request) # return_type - return_type = opts[:return_type] || 'EstimateResponse' + return_type = opts[:debug_return_type] || 'EstimateResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"EstimatesApi.create_vehicle_estimate", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -452,15 +447,16 @@ def retrieve_estimate_with_http_info(id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] + post_body = opts[:debug_body] # return_type - return_type = opts[:return_type] || 'EstimateResponse' + return_type = opts[:debug_return_type] || 'EstimateResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"EstimatesApi.retrieve_estimate", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -511,15 +507,16 @@ def retrieve_estimates_with_http_info(opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] + post_body = opts[:debug_body] # return_type - return_type = opts[:return_type] || 'EstimateListResponse' + return_type = opts[:debug_return_type] || 'EstimateListResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"EstimatesApi.retrieve_estimates", :header_params => header_params, :query_params => query_params, :form_params => form_params, diff --git a/lib/patch_ruby/api/orders_api.rb b/lib/patch_ruby/api/orders_api.rb index 6e012ae..95b9500 100644 --- a/lib/patch_ruby/api/orders_api.rb +++ b/lib/patch_ruby/api/orders_api.rb @@ -14,14 +14,6 @@ module Patch class OrdersApi - OPERATIONS = [ - :cancel_order, - :create_order, - :place_order, - :retrieve_order, - :retrieve_orders, - ] - attr_accessor :api_client def initialize(api_client = ApiClient.default) @@ -65,15 +57,16 @@ def cancel_order_with_http_info(id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] + post_body = opts[:debug_body] # return_type - return_type = opts[:return_type] || 'OrderResponse' + return_type = opts[:debug_return_type] || 'OrderResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"OrdersApi.cancel_order", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -129,15 +122,16 @@ def create_order_with_http_info(create_order_request, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(create_order_request) + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_order_request) # return_type - return_type = opts[:return_type] || 'OrderResponse' + return_type = opts[:debug_return_type] || 'OrderResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"OrdersApi.create_order", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -191,15 +185,16 @@ def place_order_with_http_info(id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] + post_body = opts[:debug_body] # return_type - return_type = opts[:return_type] || 'OrderResponse' + return_type = opts[:debug_return_type] || 'OrderResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"OrdersApi.place_order", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -253,15 +248,16 @@ def retrieve_order_with_http_info(id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] + post_body = opts[:debug_body] # return_type - return_type = opts[:return_type] || 'OrderResponse' + return_type = opts[:debug_return_type] || 'OrderResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"OrdersApi.retrieve_order", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -321,15 +317,16 @@ def retrieve_orders_with_http_info(opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] + post_body = opts[:debug_body] # return_type - return_type = opts[:return_type] || 'OrderListResponse' + return_type = opts[:debug_return_type] || 'OrderListResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"OrdersApi.retrieve_orders", :header_params => header_params, :query_params => query_params, :form_params => form_params, diff --git a/lib/patch_ruby/api/preferences_api.rb b/lib/patch_ruby/api/preferences_api.rb index 1519347..a37dbac 100644 --- a/lib/patch_ruby/api/preferences_api.rb +++ b/lib/patch_ruby/api/preferences_api.rb @@ -14,13 +14,6 @@ module Patch class PreferencesApi - OPERATIONS = [ - :create_preference, - :delete_preference, - :retrieve_preference, - :retrieve_preferences, - ] - attr_accessor :api_client def initialize(api_client = ApiClient.default) @@ -66,15 +59,16 @@ def create_preference_with_http_info(create_preference_request, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(create_preference_request) + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_preference_request) # return_type - return_type = opts[:return_type] || 'PreferenceResponse' + return_type = opts[:debug_return_type] || 'PreferenceResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"PreferencesApi.create_preference", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -128,15 +122,16 @@ def delete_preference_with_http_info(id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] + post_body = opts[:debug_body] # return_type - return_type = opts[:return_type] || 'PreferenceResponse' + return_type = opts[:debug_return_type] || 'PreferenceResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"PreferencesApi.delete_preference", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -190,15 +185,16 @@ def retrieve_preference_with_http_info(id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] + post_body = opts[:debug_body] # return_type - return_type = opts[:return_type] || 'PreferenceResponse' + return_type = opts[:debug_return_type] || 'PreferenceResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"PreferencesApi.retrieve_preference", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -249,15 +245,16 @@ def retrieve_preferences_with_http_info(opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] + post_body = opts[:debug_body] # return_type - return_type = opts[:return_type] || 'PreferenceListResponse' + return_type = opts[:debug_return_type] || 'PreferenceListResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"PreferencesApi.retrieve_preferences", :header_params => header_params, :query_params => query_params, :form_params => form_params, diff --git a/lib/patch_ruby/api/projects_api.rb b/lib/patch_ruby/api/projects_api.rb index 1225081..d1a4156 100644 --- a/lib/patch_ruby/api/projects_api.rb +++ b/lib/patch_ruby/api/projects_api.rb @@ -14,11 +14,6 @@ module Patch class ProjectsApi - OPERATIONS = [ - :retrieve_project, - :retrieve_projects, - ] - attr_accessor :api_client def initialize(api_client = ApiClient.default) @@ -62,15 +57,16 @@ def retrieve_project_with_http_info(id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] + post_body = opts[:debug_body] # return_type - return_type = opts[:return_type] || 'ProjectResponse' + return_type = opts[:debug_return_type] || 'ProjectResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"ProjectsApi.retrieve_project", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -130,15 +126,16 @@ def retrieve_projects_with_http_info(opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:body] + post_body = opts[:debug_body] # return_type - return_type = opts[:return_type] || 'ProjectListResponse' + return_type = opts[:debug_return_type] || 'ProjectListResponse' # auth_names - auth_names = opts[:auth_names] || ['bearer_auth'] + auth_names = opts[:debug_auth_names] || ['bearer_auth'] new_options = opts.merge( + :operation => :"ProjectsApi.retrieve_projects", :header_params => header_params, :query_params => query_params, :form_params => form_params, diff --git a/lib/patch_ruby/models/allocation.rb b/lib/patch_ruby/models/allocation.rb index 133572c..332232f 100644 --- a/lib/patch_ruby/models/allocation.rb +++ b/lib/patch_ruby/models/allocation.rb @@ -142,7 +142,6 @@ def eql?(o) def hash [id, production, mass_g].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/create_bitcoin_estimate_request.rb b/lib/patch_ruby/models/create_bitcoin_estimate_request.rb index 4f4aff5..3a96c33 100644 --- a/lib/patch_ruby/models/create_bitcoin_estimate_request.rb +++ b/lib/patch_ruby/models/create_bitcoin_estimate_request.rb @@ -137,7 +137,6 @@ def eql?(o) def hash [timestamp, transaction_value_btc_sats, project_id, create_order].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/create_ethereum_estimate_request.rb b/lib/patch_ruby/models/create_ethereum_estimate_request.rb index d728174..c9dc897 100644 --- a/lib/patch_ruby/models/create_ethereum_estimate_request.rb +++ b/lib/patch_ruby/models/create_ethereum_estimate_request.rb @@ -147,7 +147,6 @@ def eql?(o) def hash [timestamp, gas_used, transaction_value_eth_gwei, project_id, create_order].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/create_mass_estimate_request.rb b/lib/patch_ruby/models/create_mass_estimate_request.rb index e8c8537..349691b 100644 --- a/lib/patch_ruby/models/create_mass_estimate_request.rb +++ b/lib/patch_ruby/models/create_mass_estimate_request.rb @@ -158,7 +158,6 @@ def eql?(o) def hash [mass_g, create_order, project_id].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/create_order_request.rb b/lib/patch_ruby/models/create_order_request.rb index cdd0b0c..0d688a6 100644 --- a/lib/patch_ruby/models/create_order_request.rb +++ b/lib/patch_ruby/models/create_order_request.rb @@ -172,7 +172,6 @@ def eql?(o) def hash [mass_g, total_price_cents_usd, project_id, metadata].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/create_preference_request.rb b/lib/patch_ruby/models/create_preference_request.rb index ed9f0d8..cfc747c 100644 --- a/lib/patch_ruby/models/create_preference_request.rb +++ b/lib/patch_ruby/models/create_preference_request.rb @@ -111,7 +111,6 @@ def eql?(o) def hash [project_id].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/error_response.rb b/lib/patch_ruby/models/error_response.rb index 6c9a273..75cea4c 100644 --- a/lib/patch_ruby/models/error_response.rb +++ b/lib/patch_ruby/models/error_response.rb @@ -135,7 +135,6 @@ def eql?(o) def hash [success, error, data].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/estimate.rb b/lib/patch_ruby/models/estimate.rb index d6f40fc..934bbf7 100644 --- a/lib/patch_ruby/models/estimate.rb +++ b/lib/patch_ruby/models/estimate.rb @@ -163,7 +163,6 @@ def eql?(o) def hash [id, production, type, mass_g, order].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/estimate_list_response.rb b/lib/patch_ruby/models/estimate_list_response.rb index ea3896f..71dde52 100644 --- a/lib/patch_ruby/models/estimate_list_response.rb +++ b/lib/patch_ruby/models/estimate_list_response.rb @@ -151,7 +151,6 @@ def eql?(o) def hash [success, error, data, meta].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/estimate_response.rb b/lib/patch_ruby/models/estimate_response.rb index 6888295..9206759 100644 --- a/lib/patch_ruby/models/estimate_response.rb +++ b/lib/patch_ruby/models/estimate_response.rb @@ -135,7 +135,6 @@ def eql?(o) def hash [success, error, data].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/meta_index_object.rb b/lib/patch_ruby/models/meta_index_object.rb index 3513a6c..d10929e 100644 --- a/lib/patch_ruby/models/meta_index_object.rb +++ b/lib/patch_ruby/models/meta_index_object.rb @@ -117,7 +117,6 @@ def eql?(o) def hash [prev_page, next_page].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/order.rb b/lib/patch_ruby/models/order.rb index d246034..c7a63fd 100644 --- a/lib/patch_ruby/models/order.rb +++ b/lib/patch_ruby/models/order.rb @@ -310,7 +310,6 @@ def eql?(o) def hash [id, mass_g, production, state, allocation_state, price_cents_usd, patch_fee_cents_usd, allocations, registry_url, metadata].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/order_list_response.rb b/lib/patch_ruby/models/order_list_response.rb index b3face1..3ecf35f 100644 --- a/lib/patch_ruby/models/order_list_response.rb +++ b/lib/patch_ruby/models/order_list_response.rb @@ -151,7 +151,6 @@ def eql?(o) def hash [success, error, data, meta].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/order_response.rb b/lib/patch_ruby/models/order_response.rb index 68002b8..b38ed61 100644 --- a/lib/patch_ruby/models/order_response.rb +++ b/lib/patch_ruby/models/order_response.rb @@ -135,7 +135,6 @@ def eql?(o) def hash [success, error, data].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/photo.rb b/lib/patch_ruby/models/photo.rb index bc471d6..566a187 100644 --- a/lib/patch_ruby/models/photo.rb +++ b/lib/patch_ruby/models/photo.rb @@ -125,7 +125,6 @@ def eql?(o) def hash [url, id].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/preference.rb b/lib/patch_ruby/models/preference.rb index 3834c5b..a9a903a 100644 --- a/lib/patch_ruby/models/preference.rb +++ b/lib/patch_ruby/models/preference.rb @@ -142,7 +142,6 @@ def eql?(o) def hash [id, allocation_percentage, project].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/preference_list_response.rb b/lib/patch_ruby/models/preference_list_response.rb index f6d3064..3170d77 100644 --- a/lib/patch_ruby/models/preference_list_response.rb +++ b/lib/patch_ruby/models/preference_list_response.rb @@ -151,7 +151,6 @@ def eql?(o) def hash [success, error, data, meta].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/preference_response.rb b/lib/patch_ruby/models/preference_response.rb index ad4beeb..5de8cd7 100644 --- a/lib/patch_ruby/models/preference_response.rb +++ b/lib/patch_ruby/models/preference_response.rb @@ -135,7 +135,6 @@ def eql?(o) def hash [success, error, data].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/project.rb b/lib/patch_ruby/models/project.rb index 3396796..42309e9 100644 --- a/lib/patch_ruby/models/project.rb +++ b/lib/patch_ruby/models/project.rb @@ -298,7 +298,6 @@ def eql?(o) def hash [id, production, name, description, type, country, developer, photos, average_price_per_tonne_cents_usd, remaining_mass_g, standard, sdgs].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/project_list_response.rb b/lib/patch_ruby/models/project_list_response.rb index 7ec73b7..5ad0e59 100644 --- a/lib/patch_ruby/models/project_list_response.rb +++ b/lib/patch_ruby/models/project_list_response.rb @@ -151,7 +151,6 @@ def eql?(o) def hash [success, error, data, meta].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/project_response.rb b/lib/patch_ruby/models/project_response.rb index cb55982..986c4d1 100644 --- a/lib/patch_ruby/models/project_response.rb +++ b/lib/patch_ruby/models/project_response.rb @@ -135,7 +135,6 @@ def eql?(o) def hash [success, error, data].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/sdg.rb b/lib/patch_ruby/models/sdg.rb index d301261..464b60d 100644 --- a/lib/patch_ruby/models/sdg.rb +++ b/lib/patch_ruby/models/sdg.rb @@ -157,7 +157,6 @@ def eql?(o) def hash [title, number, description, url].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/standard.rb b/lib/patch_ruby/models/standard.rb index 079e4a4..b1b16af 100644 --- a/lib/patch_ruby/models/standard.rb +++ b/lib/patch_ruby/models/standard.rb @@ -142,7 +142,6 @@ def eql?(o) def hash [type, acronym, description].hash end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself From 4448463a804ea3d44ea1a7567146ef51768cd763 Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Fri, 27 Aug 2021 08:40:54 -0700 Subject: [PATCH 06/15] Remove custom template --- lib/patch_ruby/models/allocation.rb | 1 + lib/patch_ruby/models/create_bitcoin_estimate_request.rb | 1 + lib/patch_ruby/models/create_ethereum_estimate_request.rb | 1 + lib/patch_ruby/models/create_mass_estimate_request.rb | 1 + lib/patch_ruby/models/create_order_request.rb | 1 + lib/patch_ruby/models/create_preference_request.rb | 1 + lib/patch_ruby/models/error_response.rb | 1 + lib/patch_ruby/models/estimate.rb | 1 + lib/patch_ruby/models/estimate_list_response.rb | 1 + lib/patch_ruby/models/estimate_response.rb | 1 + lib/patch_ruby/models/meta_index_object.rb | 1 + lib/patch_ruby/models/order.rb | 1 + lib/patch_ruby/models/order_list_response.rb | 1 + lib/patch_ruby/models/order_response.rb | 1 + lib/patch_ruby/models/photo.rb | 1 + lib/patch_ruby/models/preference.rb | 1 + lib/patch_ruby/models/preference_list_response.rb | 1 + lib/patch_ruby/models/preference_response.rb | 1 + lib/patch_ruby/models/project.rb | 1 + lib/patch_ruby/models/project_list_response.rb | 1 + lib/patch_ruby/models/project_response.rb | 1 + lib/patch_ruby/models/sdg.rb | 1 + lib/patch_ruby/models/standard.rb | 1 + 23 files changed, 23 insertions(+) diff --git a/lib/patch_ruby/models/allocation.rb b/lib/patch_ruby/models/allocation.rb index 332232f..133572c 100644 --- a/lib/patch_ruby/models/allocation.rb +++ b/lib/patch_ruby/models/allocation.rb @@ -142,6 +142,7 @@ def eql?(o) def hash [id, production, mass_g].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/create_bitcoin_estimate_request.rb b/lib/patch_ruby/models/create_bitcoin_estimate_request.rb index 3a96c33..4f4aff5 100644 --- a/lib/patch_ruby/models/create_bitcoin_estimate_request.rb +++ b/lib/patch_ruby/models/create_bitcoin_estimate_request.rb @@ -137,6 +137,7 @@ def eql?(o) def hash [timestamp, transaction_value_btc_sats, project_id, create_order].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/create_ethereum_estimate_request.rb b/lib/patch_ruby/models/create_ethereum_estimate_request.rb index c9dc897..d728174 100644 --- a/lib/patch_ruby/models/create_ethereum_estimate_request.rb +++ b/lib/patch_ruby/models/create_ethereum_estimate_request.rb @@ -147,6 +147,7 @@ def eql?(o) def hash [timestamp, gas_used, transaction_value_eth_gwei, project_id, create_order].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/create_mass_estimate_request.rb b/lib/patch_ruby/models/create_mass_estimate_request.rb index 349691b..e8c8537 100644 --- a/lib/patch_ruby/models/create_mass_estimate_request.rb +++ b/lib/patch_ruby/models/create_mass_estimate_request.rb @@ -158,6 +158,7 @@ def eql?(o) def hash [mass_g, create_order, project_id].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/create_order_request.rb b/lib/patch_ruby/models/create_order_request.rb index 0d688a6..cdd0b0c 100644 --- a/lib/patch_ruby/models/create_order_request.rb +++ b/lib/patch_ruby/models/create_order_request.rb @@ -172,6 +172,7 @@ def eql?(o) def hash [mass_g, total_price_cents_usd, project_id, metadata].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/create_preference_request.rb b/lib/patch_ruby/models/create_preference_request.rb index cfc747c..ed9f0d8 100644 --- a/lib/patch_ruby/models/create_preference_request.rb +++ b/lib/patch_ruby/models/create_preference_request.rb @@ -111,6 +111,7 @@ def eql?(o) def hash [project_id].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/error_response.rb b/lib/patch_ruby/models/error_response.rb index 75cea4c..6c9a273 100644 --- a/lib/patch_ruby/models/error_response.rb +++ b/lib/patch_ruby/models/error_response.rb @@ -135,6 +135,7 @@ def eql?(o) def hash [success, error, data].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/estimate.rb b/lib/patch_ruby/models/estimate.rb index 934bbf7..d6f40fc 100644 --- a/lib/patch_ruby/models/estimate.rb +++ b/lib/patch_ruby/models/estimate.rb @@ -163,6 +163,7 @@ def eql?(o) def hash [id, production, type, mass_g, order].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/estimate_list_response.rb b/lib/patch_ruby/models/estimate_list_response.rb index 71dde52..ea3896f 100644 --- a/lib/patch_ruby/models/estimate_list_response.rb +++ b/lib/patch_ruby/models/estimate_list_response.rb @@ -151,6 +151,7 @@ def eql?(o) def hash [success, error, data, meta].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/estimate_response.rb b/lib/patch_ruby/models/estimate_response.rb index 9206759..6888295 100644 --- a/lib/patch_ruby/models/estimate_response.rb +++ b/lib/patch_ruby/models/estimate_response.rb @@ -135,6 +135,7 @@ def eql?(o) def hash [success, error, data].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/meta_index_object.rb b/lib/patch_ruby/models/meta_index_object.rb index d10929e..3513a6c 100644 --- a/lib/patch_ruby/models/meta_index_object.rb +++ b/lib/patch_ruby/models/meta_index_object.rb @@ -117,6 +117,7 @@ def eql?(o) def hash [prev_page, next_page].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/order.rb b/lib/patch_ruby/models/order.rb index c7a63fd..d246034 100644 --- a/lib/patch_ruby/models/order.rb +++ b/lib/patch_ruby/models/order.rb @@ -310,6 +310,7 @@ def eql?(o) def hash [id, mass_g, production, state, allocation_state, price_cents_usd, patch_fee_cents_usd, allocations, registry_url, metadata].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/order_list_response.rb b/lib/patch_ruby/models/order_list_response.rb index 3ecf35f..b3face1 100644 --- a/lib/patch_ruby/models/order_list_response.rb +++ b/lib/patch_ruby/models/order_list_response.rb @@ -151,6 +151,7 @@ def eql?(o) def hash [success, error, data, meta].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/order_response.rb b/lib/patch_ruby/models/order_response.rb index b38ed61..68002b8 100644 --- a/lib/patch_ruby/models/order_response.rb +++ b/lib/patch_ruby/models/order_response.rb @@ -135,6 +135,7 @@ def eql?(o) def hash [success, error, data].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/photo.rb b/lib/patch_ruby/models/photo.rb index 566a187..bc471d6 100644 --- a/lib/patch_ruby/models/photo.rb +++ b/lib/patch_ruby/models/photo.rb @@ -125,6 +125,7 @@ def eql?(o) def hash [url, id].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/preference.rb b/lib/patch_ruby/models/preference.rb index a9a903a..3834c5b 100644 --- a/lib/patch_ruby/models/preference.rb +++ b/lib/patch_ruby/models/preference.rb @@ -142,6 +142,7 @@ def eql?(o) def hash [id, allocation_percentage, project].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/preference_list_response.rb b/lib/patch_ruby/models/preference_list_response.rb index 3170d77..f6d3064 100644 --- a/lib/patch_ruby/models/preference_list_response.rb +++ b/lib/patch_ruby/models/preference_list_response.rb @@ -151,6 +151,7 @@ def eql?(o) def hash [success, error, data, meta].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/preference_response.rb b/lib/patch_ruby/models/preference_response.rb index 5de8cd7..ad4beeb 100644 --- a/lib/patch_ruby/models/preference_response.rb +++ b/lib/patch_ruby/models/preference_response.rb @@ -135,6 +135,7 @@ def eql?(o) def hash [success, error, data].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/project.rb b/lib/patch_ruby/models/project.rb index 42309e9..3396796 100644 --- a/lib/patch_ruby/models/project.rb +++ b/lib/patch_ruby/models/project.rb @@ -298,6 +298,7 @@ def eql?(o) def hash [id, production, name, description, type, country, developer, photos, average_price_per_tonne_cents_usd, remaining_mass_g, standard, sdgs].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/project_list_response.rb b/lib/patch_ruby/models/project_list_response.rb index 5ad0e59..7ec73b7 100644 --- a/lib/patch_ruby/models/project_list_response.rb +++ b/lib/patch_ruby/models/project_list_response.rb @@ -151,6 +151,7 @@ def eql?(o) def hash [success, error, data, meta].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/project_response.rb b/lib/patch_ruby/models/project_response.rb index 986c4d1..cb55982 100644 --- a/lib/patch_ruby/models/project_response.rb +++ b/lib/patch_ruby/models/project_response.rb @@ -135,6 +135,7 @@ def eql?(o) def hash [success, error, data].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/sdg.rb b/lib/patch_ruby/models/sdg.rb index 464b60d..d301261 100644 --- a/lib/patch_ruby/models/sdg.rb +++ b/lib/patch_ruby/models/sdg.rb @@ -157,6 +157,7 @@ def eql?(o) def hash [title, number, description, url].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself diff --git a/lib/patch_ruby/models/standard.rb b/lib/patch_ruby/models/standard.rb index b1b16af..079e4a4 100644 --- a/lib/patch_ruby/models/standard.rb +++ b/lib/patch_ruby/models/standard.rb @@ -142,6 +142,7 @@ def eql?(o) def hash [type, acronym, description].hash end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself From 747b2b3365389d264cc81a558eeea78d50265e63 Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Fri, 27 Aug 2021 08:48:26 -0700 Subject: [PATCH 07/15] Generate version automatically --- lib/patch_ruby/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/patch_ruby/version.rb b/lib/patch_ruby/version.rb index f992fe1..65bae29 100644 --- a/lib/patch_ruby/version.rb +++ b/lib/patch_ruby/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.1.0 =end From 2dc6cf0dc92d6486bbde2894c8681fb30b003140 Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Fri, 27 Aug 2021 08:52:13 -0700 Subject: [PATCH 08/15] 5.2.1 --- lib/patch_ruby.rb | 2 +- lib/patch_ruby/api/estimates_api.rb | 2 +- lib/patch_ruby/api/orders_api.rb | 2 +- lib/patch_ruby/api/preferences_api.rb | 2 +- lib/patch_ruby/api/projects_api.rb | 2 +- lib/patch_ruby/api_client.rb | 2 +- lib/patch_ruby/api_error.rb | 2 +- lib/patch_ruby/configuration.rb | 2 +- lib/patch_ruby/models/allocation.rb | 2 +- lib/patch_ruby/models/create_bitcoin_estimate_request.rb | 2 +- lib/patch_ruby/models/create_ethereum_estimate_request.rb | 2 +- lib/patch_ruby/models/create_mass_estimate_request.rb | 2 +- lib/patch_ruby/models/create_order_request.rb | 2 +- lib/patch_ruby/models/create_preference_request.rb | 2 +- lib/patch_ruby/models/error_response.rb | 2 +- lib/patch_ruby/models/estimate.rb | 2 +- lib/patch_ruby/models/estimate_list_response.rb | 2 +- lib/patch_ruby/models/estimate_response.rb | 2 +- lib/patch_ruby/models/meta_index_object.rb | 2 +- lib/patch_ruby/models/order.rb | 2 +- lib/patch_ruby/models/order_list_response.rb | 2 +- lib/patch_ruby/models/order_response.rb | 2 +- lib/patch_ruby/models/photo.rb | 2 +- lib/patch_ruby/models/preference.rb | 2 +- lib/patch_ruby/models/preference_list_response.rb | 2 +- lib/patch_ruby/models/preference_response.rb | 2 +- lib/patch_ruby/models/project.rb | 2 +- lib/patch_ruby/models/project_list_response.rb | 2 +- lib/patch_ruby/models/project_response.rb | 2 +- lib/patch_ruby/models/sdg.rb | 2 +- lib/patch_ruby/models/standard.rb | 2 +- lib/patch_ruby/version.rb | 2 +- spec/api_client_spec.rb | 2 +- spec/configuration_spec.rb | 2 +- spec/spec_helper.rb | 2 +- 35 files changed, 35 insertions(+), 35 deletions(-) diff --git a/lib/patch_ruby.rb b/lib/patch_ruby.rb index 3116fc9..34c5133 100644 --- a/lib/patch_ruby.rb +++ b/lib/patch_ruby.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/api/estimates_api.rb b/lib/patch_ruby/api/estimates_api.rb index 20d1339..455c88f 100644 --- a/lib/patch_ruby/api/estimates_api.rb +++ b/lib/patch_ruby/api/estimates_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/api/orders_api.rb b/lib/patch_ruby/api/orders_api.rb index 95b9500..0d84e9e 100644 --- a/lib/patch_ruby/api/orders_api.rb +++ b/lib/patch_ruby/api/orders_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/api/preferences_api.rb b/lib/patch_ruby/api/preferences_api.rb index a37dbac..9df7b09 100644 --- a/lib/patch_ruby/api/preferences_api.rb +++ b/lib/patch_ruby/api/preferences_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/api/projects_api.rb b/lib/patch_ruby/api/projects_api.rb index d1a4156..3d883fa 100644 --- a/lib/patch_ruby/api/projects_api.rb +++ b/lib/patch_ruby/api/projects_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/api_client.rb b/lib/patch_ruby/api_client.rb index 0c19584..906de2c 100644 --- a/lib/patch_ruby/api_client.rb +++ b/lib/patch_ruby/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/api_error.rb b/lib/patch_ruby/api_error.rb index 2e334c2..0966543 100644 --- a/lib/patch_ruby/api_error.rb +++ b/lib/patch_ruby/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/configuration.rb b/lib/patch_ruby/configuration.rb index e8c545b..b5dc452 100644 --- a/lib/patch_ruby/configuration.rb +++ b/lib/patch_ruby/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/allocation.rb b/lib/patch_ruby/models/allocation.rb index 133572c..5981ce8 100644 --- a/lib/patch_ruby/models/allocation.rb +++ b/lib/patch_ruby/models/allocation.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/create_bitcoin_estimate_request.rb b/lib/patch_ruby/models/create_bitcoin_estimate_request.rb index 4f4aff5..6dbc564 100644 --- a/lib/patch_ruby/models/create_bitcoin_estimate_request.rb +++ b/lib/patch_ruby/models/create_bitcoin_estimate_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/create_ethereum_estimate_request.rb b/lib/patch_ruby/models/create_ethereum_estimate_request.rb index d728174..6593eac 100644 --- a/lib/patch_ruby/models/create_ethereum_estimate_request.rb +++ b/lib/patch_ruby/models/create_ethereum_estimate_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/create_mass_estimate_request.rb b/lib/patch_ruby/models/create_mass_estimate_request.rb index e8c8537..ba169a2 100644 --- a/lib/patch_ruby/models/create_mass_estimate_request.rb +++ b/lib/patch_ruby/models/create_mass_estimate_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/create_order_request.rb b/lib/patch_ruby/models/create_order_request.rb index cdd0b0c..db38a97 100644 --- a/lib/patch_ruby/models/create_order_request.rb +++ b/lib/patch_ruby/models/create_order_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/create_preference_request.rb b/lib/patch_ruby/models/create_preference_request.rb index ed9f0d8..51cbc73 100644 --- a/lib/patch_ruby/models/create_preference_request.rb +++ b/lib/patch_ruby/models/create_preference_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/error_response.rb b/lib/patch_ruby/models/error_response.rb index 6c9a273..8d73d5d 100644 --- a/lib/patch_ruby/models/error_response.rb +++ b/lib/patch_ruby/models/error_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/estimate.rb b/lib/patch_ruby/models/estimate.rb index d6f40fc..cec5f22 100644 --- a/lib/patch_ruby/models/estimate.rb +++ b/lib/patch_ruby/models/estimate.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/estimate_list_response.rb b/lib/patch_ruby/models/estimate_list_response.rb index ea3896f..217d901 100644 --- a/lib/patch_ruby/models/estimate_list_response.rb +++ b/lib/patch_ruby/models/estimate_list_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/estimate_response.rb b/lib/patch_ruby/models/estimate_response.rb index 6888295..ddb7103 100644 --- a/lib/patch_ruby/models/estimate_response.rb +++ b/lib/patch_ruby/models/estimate_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/meta_index_object.rb b/lib/patch_ruby/models/meta_index_object.rb index 3513a6c..9ae86a4 100644 --- a/lib/patch_ruby/models/meta_index_object.rb +++ b/lib/patch_ruby/models/meta_index_object.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/order.rb b/lib/patch_ruby/models/order.rb index d246034..5cc67a4 100644 --- a/lib/patch_ruby/models/order.rb +++ b/lib/patch_ruby/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/order_list_response.rb b/lib/patch_ruby/models/order_list_response.rb index b3face1..d39f4e3 100644 --- a/lib/patch_ruby/models/order_list_response.rb +++ b/lib/patch_ruby/models/order_list_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/order_response.rb b/lib/patch_ruby/models/order_response.rb index 68002b8..5618c8e 100644 --- a/lib/patch_ruby/models/order_response.rb +++ b/lib/patch_ruby/models/order_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/photo.rb b/lib/patch_ruby/models/photo.rb index bc471d6..d890173 100644 --- a/lib/patch_ruby/models/photo.rb +++ b/lib/patch_ruby/models/photo.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/preference.rb b/lib/patch_ruby/models/preference.rb index 3834c5b..3614209 100644 --- a/lib/patch_ruby/models/preference.rb +++ b/lib/patch_ruby/models/preference.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/preference_list_response.rb b/lib/patch_ruby/models/preference_list_response.rb index f6d3064..0e19bc8 100644 --- a/lib/patch_ruby/models/preference_list_response.rb +++ b/lib/patch_ruby/models/preference_list_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/preference_response.rb b/lib/patch_ruby/models/preference_response.rb index ad4beeb..e53a99b 100644 --- a/lib/patch_ruby/models/preference_response.rb +++ b/lib/patch_ruby/models/preference_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/project.rb b/lib/patch_ruby/models/project.rb index 3396796..bc94974 100644 --- a/lib/patch_ruby/models/project.rb +++ b/lib/patch_ruby/models/project.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/project_list_response.rb b/lib/patch_ruby/models/project_list_response.rb index 7ec73b7..344f257 100644 --- a/lib/patch_ruby/models/project_list_response.rb +++ b/lib/patch_ruby/models/project_list_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/project_response.rb b/lib/patch_ruby/models/project_response.rb index cb55982..462171a 100644 --- a/lib/patch_ruby/models/project_response.rb +++ b/lib/patch_ruby/models/project_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/sdg.rb b/lib/patch_ruby/models/sdg.rb index d301261..18c73bb 100644 --- a/lib/patch_ruby/models/sdg.rb +++ b/lib/patch_ruby/models/sdg.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/models/standard.rb b/lib/patch_ruby/models/standard.rb index 079e4a4..c7925eb 100644 --- a/lib/patch_ruby/models/standard.rb +++ b/lib/patch_ruby/models/standard.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/lib/patch_ruby/version.rb b/lib/patch_ruby/version.rb index 65bae29..c74cafa 100644 --- a/lib/patch_ruby/version.rb +++ b/lib/patch_ruby/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/spec/api_client_spec.rb b/spec/api_client_spec.rb index e906496..fc99edf 100644 --- a/spec/api_client_spec.rb +++ b/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb index 0a2271f..1eb0c49 100644 --- a/spec/configuration_spec.rb +++ b/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 2dc541d..2c8253a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.1.0 +OpenAPI Generator version: 5.2.1 =end From 6aacf069940ff8ee8f81fb532e05475cb97d7880 Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Fri, 27 Aug 2021 09:25:16 -0700 Subject: [PATCH 09/15] Things --- Gemfile | 3 +- Gemfile.lock | 41 +++++++-------- patch_ruby.gemspec | 11 ++-- spec/spec_helper.rb | 121 ++++++++++++++++++++++++++------------------ 4 files changed, 100 insertions(+), 76 deletions(-) diff --git a/Gemfile b/Gemfile index 76018c7..c2e3127 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,5 @@ gemspec group :development, :test do gem 'rake', '~> 13.0.1' gem 'pry-byebug' - gem 'rubocop' - gem 'factory_bot' + gem 'rubocop', '~> 0.66.0' end diff --git a/Gemfile.lock b/Gemfile.lock index 31a2694..f98473d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,29 +8,30 @@ PATH GEM remote: https://rubygems.org/ specs: - activesupport (6.1.1) + activesupport (6.1.4.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - ast (2.4.1) + ast (2.4.2) byebug (11.1.3) coderay (1.1.3) - concurrent-ruby (1.1.7) + concurrent-ruby (1.1.9) diff-lcs (1.4.3) ethon (0.14.0) ffi (>= 1.15.0) - factory_bot (6.1.0) + factory_bot (6.2.0) activesupport (>= 5.0.0) ffi (1.15.3) - i18n (1.8.7) + i18n (1.8.10) concurrent-ruby (~> 1.0) + jaro_winkler (1.5.4) json (2.5.1) method_source (1.0.0) - minitest (5.14.3) - parallel (1.19.2) - parser (2.7.1.4) + minitest (5.14.4) + parallel (1.20.1) + parser (3.0.2.0) ast (~> 2.4.1) pry (0.13.1) coderay (~> 1.1) @@ -38,10 +39,9 @@ GEM pry-byebug (3.9.0) byebug (~> 11.0) pry (~> 0.13.0) + psych (4.0.1) rainbow (3.0.0) rake (13.0.1) - regexp_parser (1.7.1) - rexml (3.2.4) rspec (3.9.0) rspec-core (~> 3.9.0) rspec-expectations (~> 3.9.0) @@ -55,35 +55,32 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) rspec-support (3.9.3) - rubocop (0.88.0) + rubocop (0.66.0) + jaro_winkler (~> 1.5.1) parallel (~> 1.10) - parser (>= 2.7.1.1) + parser (>= 2.5, != 2.5.1.1) + psych (>= 3.1.0) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.7) - rexml - rubocop-ast (>= 0.1.0, < 1.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 2.0) - rubocop-ast (0.3.0) - parser (>= 2.7.1.4) - ruby-progressbar (1.10.1) + unicode-display_width (>= 1.4.0, < 1.6) + ruby-progressbar (1.11.0) typhoeus (1.4.0) ethon (>= 0.9.0) tzinfo (2.0.4) concurrent-ruby (~> 1.0) - unicode-display_width (1.7.0) + unicode-display_width (1.5.0) zeitwerk (2.4.2) PLATFORMS ruby DEPENDENCIES - factory_bot + factory_bot (~> 6.2) patch_ruby! pry-byebug rake (~> 13.0.1) rspec (~> 3.6, >= 3.6.0) - rubocop + rubocop (~> 0.66.0) BUNDLED WITH 2.2.14 diff --git a/patch_ruby.gemspec b/patch_ruby.gemspec index a08f74f..e55cbba 100644 --- a/patch_ruby.gemspec +++ b/patch_ruby.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: v1 Contact: developers@usepatch.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 5.2.1 =end @@ -24,11 +24,10 @@ Gem::Specification.new do |s| s.homepage = "https://www.patch.io" s.summary = "Ruby wrapper for the Patch API" s.description = "Ruby wrapper for the Patch API" - s.license = 'MIT' + s.license = "MIT" s.required_ruby_version = ">= 1.9" s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' @@ -36,4 +35,10 @@ Gem::Specification.new do |s| s.test_files = `find spec/*`.split("\n") s.executables = [] s.require_paths = ["lib"] + + # Start custom + s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' + s.add_development_dependency 'factory_bot', '~> 6.2' + # End custom + end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 2c8253a..d421aba 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,4 @@ -=begin -#Patch API V1 +# #Patch API V1 #The core API used to integrate with Patch's service @@ -8,10 +7,14 @@ Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.2.1 -=end # load the gem require 'patch_ruby' +require 'constants' +require 'factory_bot' + +# Require shared spec examples +Dir['./spec/support/**/*.rb'].sort.each { |f| require f } # The following was generated by the `rspec --init` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. @@ -55,46 +58,45 @@ mocks.verify_partial_doubles = true end -# The settings below are suggested to provide a good initial experience -# with RSpec, but feel free to customize to your heart's content. -=begin - # These two settings work together to allow you to limit a spec run - # to individual examples or groups you care about by tagging them with - # `:focus` metadata. When nothing is tagged with `:focus`, all examples - # get run. - config.filter_run :focus - config.run_all_when_everything_filtered = true - - # Allows RSpec to persist some state between runs in order to support - # the `--only-failures` and `--next-failure` CLI options. We recommend - # you configure your source control system to ignore this file. - config.example_status_persistence_file_path = "spec/examples.txt" - - # Limits the available syntax to the non-monkey patched syntax that is - # recommended. For more details, see: - # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ - # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ - # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode - config.disable_monkey_patching! - - # This setting enables warnings. It's recommended, but in some cases may - # be too noisy due to issues in dependencies. - config.warnings = true - - # Many RSpec users commonly either run the entire suite or an individual - # file, and it's useful to allow more verbose output when running an - # individual spec file. - if config.files_to_run.one? - # Use the documentation formatter for detailed output, - # unless a formatter has already been configured - # (e.g. via a command-line flag). - config.default_formatter = 'doc' - end - - # Print the 10 slowest examples and example groups at the - # end of the spec run, to help surface which specs are running - # particularly slow. - config.profile_examples = 10 + # The settings below are suggested to provide a good initial experience + # with RSpec, but feel free to customize to your heart's content. + # # These two settings work together to allow you to limit a spec run + # # to individual examples or groups you care about by tagging them with + # # `:focus` metadata. When nothing is tagged with `:focus`, all examples + # # get run. + # config.filter_run :focus + # config.run_all_when_everything_filtered = true + # + # # Allows RSpec to persist some state between runs in order to support + # # the `--only-failures` and `--next-failure` CLI options. We recommend + # # you configure your source control system to ignore this file. + # config.example_status_persistence_file_path = "spec/examples.txt" + # + # # Limits the available syntax to the non-monkey patched syntax that is + # # recommended. For more details, see: + # # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ + # # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode + # config.disable_monkey_patching! + # + # # This setting enables warnings. It's recommended, but in some cases may + # # be too noisy due to issues in dependencies. + # config.warnings = true + # + # # Many RSpec users commonly either run the entire suite or an individual + # # file, and it's useful to allow more verbose output when running an + # # individual spec file. + # if config.files_to_run.one? + # # Use the documentation formatter for detailed output, + # # unless a formatter has already been configured + # # (e.g. via a command-line flag). + # config.default_formatter = 'doc' + # end + # + # # Print the 10 slowest examples and example groups at the + # # end of the spec run, to help surface which specs are running + # # particularly slow. + # config.profile_examples = 10 # Run specs in random order to surface order dependencies. If you find an # order dependency and want to debug it, you can fix the order by providing @@ -102,10 +104,31 @@ # --seed 1234 config.order = :random - # Seed global randomization in this process using the `--seed` CLI option. - # Setting this allows you to use `--seed` to deterministically reproduce - # test failures related to randomization by passing the same `--seed` value - # as the one that triggered the failure. - Kernel.srand config.seed -=end + # # Seed global randomization in this process using the `--seed` CLI option. + # # Setting this allows you to use `--seed` to deterministically reproduce + # # test failures related to randomization by passing the same `--seed` value + # # as the one that triggered the failure. + # Kernel.srand config.seed + + ###################### + # Start custom section + ###################### + + # Use FactoryBot for test factories + config.include FactoryBot::Syntax::Methods + config.before(:suite) do + FactoryBot.find_definitions + Patch.configure do |config| + if ENV.fetch('LOCAL_SDK_TEST', false) + config.access_token = ENV.fetch('LOCAL_PATCH_API_KEY') + config.scheme = 'http' + config.host = 'api.patch.test:3000' + else + config.access_token = ENV.fetch('SANDBOX_API_KEY') + end + end + end + ###################### + # End custom section + ###################### end From 4976516f90e87f5e67228004fa92f13a53f40d7a Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Fri, 27 Aug 2021 09:41:25 -0700 Subject: [PATCH 10/15] Fix missing_method --- lib/patch_ruby/api/estimates_api.rb | 11 +++++++++++ lib/patch_ruby/api/orders_api.rb | 8 ++++++++ lib/patch_ruby/api/preferences_api.rb | 7 +++++++ lib/patch_ruby/api/projects_api.rb | 5 +++++ spec/models/create_mass_estimate_request_spec.rb | 2 +- spec/models/error_response_spec.rb | 2 +- spec/models/estimate_list_response_spec.rb | 2 +- spec/models/estimate_response_spec.rb | 2 +- spec/models/estimate_spec.rb | 2 +- spec/models/meta_index_object_spec.rb | 2 +- spec/models/order_list_response_spec.rb | 2 +- spec/models/order_response_spec.rb | 2 +- spec/models/order_spec.rb | 2 +- spec/models/preference_list_response_spec.rb | 2 +- spec/models/preference_response_spec.rb | 2 +- spec/models/project_list_response_spec.rb | 2 +- spec/models/project_response_spec.rb | 2 +- spec/models/project_spec.rb | 2 +- spec/spec_helper.rb | 6 +++++- 19 files changed, 50 insertions(+), 15 deletions(-) diff --git a/lib/patch_ruby/api/estimates_api.rb b/lib/patch_ruby/api/estimates_api.rb index 455c88f..a6ab02a 100644 --- a/lib/patch_ruby/api/estimates_api.rb +++ b/lib/patch_ruby/api/estimates_api.rb @@ -14,6 +14,17 @@ module Patch class EstimatesApi + OPERATIONS = [ + :create_bitcoin_estimate, + :create_ethereum_estimate, + :create_flight_estimate, + :create_mass_estimate, + :create_shipping_estimate, + :create_vehicle_estimate, + :retrieve_estimate, + :retrieve_estimates, + ] + attr_accessor :api_client def initialize(api_client = ApiClient.default) diff --git a/lib/patch_ruby/api/orders_api.rb b/lib/patch_ruby/api/orders_api.rb index 0d84e9e..18cba61 100644 --- a/lib/patch_ruby/api/orders_api.rb +++ b/lib/patch_ruby/api/orders_api.rb @@ -14,6 +14,14 @@ module Patch class OrdersApi + OPERATIONS = [ + :cancel_order, + :create_order, + :place_order, + :retrieve_order, + :retrieve_orders, + ] + attr_accessor :api_client def initialize(api_client = ApiClient.default) diff --git a/lib/patch_ruby/api/preferences_api.rb b/lib/patch_ruby/api/preferences_api.rb index 9df7b09..facc61a 100644 --- a/lib/patch_ruby/api/preferences_api.rb +++ b/lib/patch_ruby/api/preferences_api.rb @@ -14,6 +14,13 @@ module Patch class PreferencesApi + OPERATIONS = [ + :create_preference, + :delete_preference, + :retrieve_preference, + :retrieve_preferences, + ] + attr_accessor :api_client def initialize(api_client = ApiClient.default) diff --git a/lib/patch_ruby/api/projects_api.rb b/lib/patch_ruby/api/projects_api.rb index 3d883fa..02bb7f6 100644 --- a/lib/patch_ruby/api/projects_api.rb +++ b/lib/patch_ruby/api/projects_api.rb @@ -14,6 +14,11 @@ module Patch class ProjectsApi + OPERATIONS = [ + :retrieve_project, + :retrieve_projects, + ] + attr_accessor :api_client def initialize(api_client = ApiClient.default) diff --git a/spec/models/create_mass_estimate_request_spec.rb b/spec/models/create_mass_estimate_request_spec.rb index 17f5224..4d13bc3 100644 --- a/spec/models/create_mass_estimate_request_spec.rb +++ b/spec/models/create_mass_estimate_request_spec.rb @@ -30,7 +30,7 @@ it_behaves_like "a generated class" do let(:instance) { @instance } let(:instance_hash) { { project_id: @instance.project_id, mass_g: @instance.mass_g } } - let(:nullable_properties) { Set.new(["create_order"]) } + let(:nullable_properties) { Set.new([:create_order]) } end describe 'test an instance of CreateMassEstimateRequest' do diff --git a/spec/models/error_response_spec.rb b/spec/models/error_response_spec.rb index ca04fbc..732206f 100644 --- a/spec/models/error_response_spec.rb +++ b/spec/models/error_response_spec.rb @@ -30,7 +30,7 @@ it_behaves_like "a generated class" do let(:instance) { @instance } let(:instance_hash) { { success: @instance.success, error: @instance.error, data: @instance.data } } - let(:nullable_properties) { Set.new(["data"]) } + let(:nullable_properties) { Set.new([:data]) } end describe 'test an instance of ErrorResponse' do diff --git a/spec/models/estimate_list_response_spec.rb b/spec/models/estimate_list_response_spec.rb index 68c2af6..60dd673 100644 --- a/spec/models/estimate_list_response_spec.rb +++ b/spec/models/estimate_list_response_spec.rb @@ -30,7 +30,7 @@ it_behaves_like "a generated class" do let(:instance) { @instance } let(:instance_hash) { { success: @instance.success, error: @instance.error, data: @instance.data, meta: @instance.meta } } - let(:nullable_properties) { Set.new(["error"]) } + let(:nullable_properties) { Set.new([:error]) } end describe 'test an instance of EstimateListResponse' do diff --git a/spec/models/estimate_response_spec.rb b/spec/models/estimate_response_spec.rb index 1d41216..651328d 100644 --- a/spec/models/estimate_response_spec.rb +++ b/spec/models/estimate_response_spec.rb @@ -30,7 +30,7 @@ it_behaves_like "a generated class" do let(:instance) { @instance } let(:instance_hash) { { success: @instance.success, error: @instance.error, data: @instance.data } } - let(:nullable_properties) { Set.new(["error"]) } + let(:nullable_properties) { Set.new([:error]) } end describe 'test an instance of EstimateResponse' do diff --git a/spec/models/estimate_spec.rb b/spec/models/estimate_spec.rb index 34ddae7..141b094 100644 --- a/spec/models/estimate_spec.rb +++ b/spec/models/estimate_spec.rb @@ -30,7 +30,7 @@ it_behaves_like "a generated class" do let(:instance) { @instance } let(:instance_hash) { { id: @instance.id, order: @instance.order.to_hash, production: @instance.production, type: @instance.type } } - let(:nullable_properties) { Set.new(["order"]) } + let(:nullable_properties) { Set.new([:order]) } end describe 'test an instance of Estimate' do diff --git a/spec/models/meta_index_object_spec.rb b/spec/models/meta_index_object_spec.rb index 0ea5c08..4151fe1 100644 --- a/spec/models/meta_index_object_spec.rb +++ b/spec/models/meta_index_object_spec.rb @@ -30,7 +30,7 @@ it_behaves_like "a generated class" do let(:instance) { @instance } let(:instance_hash) { { next_page: @instance.next_page, prev_page: @instance.prev_page } } - let(:nullable_properties) { Set.new(["next_page", "prev_page"]) } + let(:nullable_properties) { Set.new([:next_page, :prev_page]) } end describe 'test an instance of MetaIndexObject' do diff --git a/spec/models/order_list_response_spec.rb b/spec/models/order_list_response_spec.rb index 4e85078..592dcc0 100644 --- a/spec/models/order_list_response_spec.rb +++ b/spec/models/order_list_response_spec.rb @@ -30,7 +30,7 @@ it_behaves_like "a generated class" do let(:instance) { @instance } let(:instance_hash) { { success: @instance.success, error: @instance.error, data: @instance.data, meta: @instance.meta } } - let(:nullable_properties) { Set.new(["error"]) } + let(:nullable_properties) { Set.new([:error]) } end describe 'test an instance of OrderListResponse' do diff --git a/spec/models/order_response_spec.rb b/spec/models/order_response_spec.rb index 9880ff9..4d805e2 100644 --- a/spec/models/order_response_spec.rb +++ b/spec/models/order_response_spec.rb @@ -30,7 +30,7 @@ it_behaves_like "a generated class" do let(:instance) { @instance } let(:instance_hash) { { success: @instance.success, error: @instance.error, data: @instance.data } } - let(:nullable_properties) { Set.new(["error"]) } + let(:nullable_properties) { Set.new([:error]) } end describe 'test an instance of OrderResponse' do diff --git a/spec/models/order_spec.rb b/spec/models/order_spec.rb index a1e49d7..deb9673 100644 --- a/spec/models/order_spec.rb +++ b/spec/models/order_spec.rb @@ -41,7 +41,7 @@ metadata: @instance.metadata } } - let(:nullable_properties) { Set.new(["patch_fee_cents_usd", "price_cents_usd"]) } + let(:nullable_properties) { Set.new([:patch_fee_cents_usd, :price_cents_usd]) } end describe 'test an instance of Order' do diff --git a/spec/models/preference_list_response_spec.rb b/spec/models/preference_list_response_spec.rb index 7388d7f..6cbc01b 100644 --- a/spec/models/preference_list_response_spec.rb +++ b/spec/models/preference_list_response_spec.rb @@ -30,7 +30,7 @@ it_behaves_like "a generated class" do let(:instance) { @instance } let(:instance_hash) { { success: @instance.success, error: @instance.error, data: @instance.data, meta: @instance.meta } } - let(:nullable_properties) { Set.new(["error"]) } + let(:nullable_properties) { Set.new([:error]) } end describe 'test an instance of PreferenceListResponse' do diff --git a/spec/models/preference_response_spec.rb b/spec/models/preference_response_spec.rb index e19ad9d..8453e0a 100644 --- a/spec/models/preference_response_spec.rb +++ b/spec/models/preference_response_spec.rb @@ -30,7 +30,7 @@ it_behaves_like "a generated class" do let(:instance) { @instance } let(:instance_hash) { { success: @instance.success, error: @instance.error, data: @instance.data } } - let(:nullable_properties) { Set.new(["error"]) } + let(:nullable_properties) { Set.new([:error]) } end describe 'test an instance of PreferenceResponse' do diff --git a/spec/models/project_list_response_spec.rb b/spec/models/project_list_response_spec.rb index c83f631..5c792d9 100644 --- a/spec/models/project_list_response_spec.rb +++ b/spec/models/project_list_response_spec.rb @@ -30,7 +30,7 @@ it_behaves_like "a generated class" do let(:instance) { @instance } let(:instance_hash) { { success: @instance.success, error: @instance.error, data: @instance.data, meta: @instance.meta } } - let(:nullable_properties) { Set.new(["error"]) } + let(:nullable_properties) { Set.new([:error]) } end describe 'test an instance of ProjectListResponse' do diff --git a/spec/models/project_response_spec.rb b/spec/models/project_response_spec.rb index 49f0965..00f028a 100644 --- a/spec/models/project_response_spec.rb +++ b/spec/models/project_response_spec.rb @@ -30,7 +30,7 @@ it_behaves_like "a generated class" do let(:instance) { @instance } let(:instance_hash) { { success: @instance.success, error: @instance.error, data: @instance.data } } - let(:nullable_properties) { Set.new(["error"]) } + let(:nullable_properties) { Set.new([:error]) } end describe 'test an instance of ProjectResponse' do diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index c886407..01b5cea 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -44,7 +44,7 @@ standard: @instance.standard } } - let(:nullable_properties) { Set.new(["photos", "standard", "sdgs"]) } + let(:nullable_properties) { Set.new([:photos, :standard, :sdgs]) } end describe 'test an instance of Project' do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d421aba..cdf847f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,5 @@ -# #Patch API V1 +=begin +#Patch API V1 #The core API used to integrate with Patch's service @@ -7,11 +8,14 @@ Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.2.1 +=end # load the gem require 'patch_ruby' +# Start custom require 'constants' require 'factory_bot' +# End custom # Require shared spec examples Dir['./spec/support/**/*.rb'].sort.each { |f| require f } From 5bc18e18089fcd47ff09aa9ddcf2c994103359c0 Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Fri, 27 Aug 2021 10:03:44 -0700 Subject: [PATCH 11/15] Fix error message --- spec/integration/preferences_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/integration/preferences_spec.rb b/spec/integration/preferences_spec.rb index 55021f6..2802afc 100644 --- a/spec/integration/preferences_spec.rb +++ b/spec/integration/preferences_spec.rb @@ -7,7 +7,7 @@ begin create_preference_response = Patch::Preference.create_preference(project_id: project_id) preference_id = create_preference_response.data.id - rescue => Patch::ApiError + rescue Patch::ApiError => e preference_id = Patch::Preference.retrieve_preferences().data.first.id end From 9d4ffe0a0d0514cdf82ac7fa50cd05ed3ff91026 Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Fri, 27 Aug 2021 10:15:36 -0700 Subject: [PATCH 12/15] Update version --- Gemfile.lock | 2 +- lib/patch_ruby/api_client.rb | 2 +- lib/patch_ruby/version.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index f98473d..b6ec8d1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - patch_ruby (1.9.0) + patch_ruby (1.10.0) json (~> 2.1, >= 2.1.0) typhoeus (~> 1.0, >= 1.0.1) diff --git a/lib/patch_ruby/api_client.rb b/lib/patch_ruby/api_client.rb index 906de2c..74c1f4f 100644 --- a/lib/patch_ruby/api_client.rb +++ b/lib/patch_ruby/api_client.rb @@ -31,7 +31,7 @@ class ApiClient # @option config [Configuration] Configuration for initializing the object, default to Configuration.default def initialize(config = Configuration.default) @config = config - @user_agent = "OpenAPI-Generator/#{VERSION}/ruby" + @user_agent = "patch-ruby/1.10.0" @default_headers = { 'Content-Type' => 'application/json', 'User-Agent' => @user_agent diff --git a/lib/patch_ruby/version.rb b/lib/patch_ruby/version.rb index c74cafa..1fc616e 100644 --- a/lib/patch_ruby/version.rb +++ b/lib/patch_ruby/version.rb @@ -11,5 +11,5 @@ =end module Patch - VERSION = '1.9.0' + VERSION = '1.10.0' end From b3d4086c78dbb88b44d6f390ba36fcea53c548b2 Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Fri, 27 Aug 2021 10:31:15 -0700 Subject: [PATCH 13/15] Update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91a394f..8059d8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.10.0] - 2021-08-27 + +### Added + +- Adds custom User-Agent header ## [1.9.0] - 2021-08-17 ### Added From d26f8d99d4dad011d2a06362c69da756a793aeea Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Fri, 27 Aug 2021 10:50:00 -0700 Subject: [PATCH 14/15] Remove explicit json dependency --- Gemfile.lock | 2 -- patch_ruby.gemspec | 1 - 2 files changed, 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b6ec8d1..97b2324 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,6 @@ PATH remote: . specs: patch_ruby (1.10.0) - json (~> 2.1, >= 2.1.0) typhoeus (~> 1.0, >= 1.0.1) GEM @@ -27,7 +26,6 @@ GEM i18n (1.8.10) concurrent-ruby (~> 1.0) jaro_winkler (1.5.4) - json (2.5.1) method_source (1.0.0) minitest (5.14.4) parallel (1.20.1) diff --git a/patch_ruby.gemspec b/patch_ruby.gemspec index e55cbba..b9298b8 100644 --- a/patch_ruby.gemspec +++ b/patch_ruby.gemspec @@ -37,7 +37,6 @@ Gem::Specification.new do |s| s.require_paths = ["lib"] # Start custom - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' s.add_development_dependency 'factory_bot', '~> 6.2' # End custom From d074f6d2ee1361416c671b7cec4c38a6a0f30554 Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Mon, 30 Aug 2021 08:52:03 -0700 Subject: [PATCH 15/15] Update CHANGELOG.md Co-authored-by: James Klein --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8059d8f..8964974 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Adds custom User-Agent header + ## [1.9.0] - 2021-08-17 ### Added