lib/conekta/models/charges_data_response.rb in conekta-6.0.0 vs lib/conekta/models/charges_data_response.rb in conekta-6.0.1

- old
+ new

@@ -4,11 +4,11 @@ #Conekta sdk The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 +OpenAPI Generator version: 7.1.0 =end require 'date' require 'time' @@ -31,12 +31,10 @@ attr_accessor :failure_code attr_accessor :failure_message - attr_accessor :fee - attr_accessor :id attr_accessor :livemode attr_accessor :object @@ -64,11 +62,10 @@ :'customer_id' => :'customer_id', :'description' => :'description', :'device_fingerprint' => :'device_fingerprint', :'failure_code' => :'failure_code', :'failure_message' => :'failure_message', - :'fee' => :'fee', :'id' => :'id', :'livemode' => :'livemode', :'object' => :'object', :'order_id' => :'order_id', :'paid_at' => :'paid_at', @@ -94,11 +91,10 @@ :'customer_id' => :'String', :'description' => :'String', :'device_fingerprint' => :'String', :'failure_code' => :'String', :'failure_message' => :'String', - :'fee' => :'Integer', :'id' => :'String', :'livemode' => :'Boolean', :'object' => :'String', :'order_id' => :'String', :'paid_at' => :'Integer', @@ -174,14 +170,10 @@ if attributes.key?(:'failure_message') self.failure_message = attributes[:'failure_message'] end - if attributes.key?(:'fee') - self.fee = attributes[:'fee'] - end - if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'livemode') @@ -218,17 +210,19 @@ end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end # Checks equality by comparing each attribute. # @param [Object] Object to be compared @@ -242,11 +236,10 @@ customer_id == o.customer_id && description == o.description && device_fingerprint == o.device_fingerprint && failure_code == o.failure_code && failure_message == o.failure_message && - fee == o.fee && id == o.id && livemode == o.livemode && object == o.object && order_id == o.order_id && paid_at == o.paid_at && @@ -263,48 +256,41 @@ end # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [amount, channel, created_at, currency, customer_id, description, device_fingerprint, failure_code, failure_message, fee, id, livemode, object, order_id, paid_at, payment_method, reference_id, refunds, status].hash + [amount, channel, created_at, currency, customer_id, description, device_fingerprint, failure_code, failure_message, id, livemode, object, order_id, paid_at, payment_method, reference_id, refunds, status].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{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) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) @@ -335,10 +321,10 @@ end end else # model # models (e.g. Pet) or oneOf klass = Conekta.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end # Returns the string representation of the object # @return [String] String presentation of the object