class UltracartClient::ChargebackDispute
Attributes
Account number
Adjustment request text
Amount
Auth code
Case number
Chargeback Dispute Oid
Chargeback dts
Customer
care notes
Encryption key
Expiration Dts
Fax failure reason
Fax number
Fax transaction id
icsid
Merchant account profile oid
Order
Id
Partial card number
PDF file oid
Reason code
Status
Website URL
Public Class Methods
Attribute mapping from ruby-style variable name to JSON key.
# File lib/ultracart_api/models/chargeback_dispute.rb, line 86 def self.attribute_map { :'account_number' => :'account_number', :'adjustment_request_text' => :'adjustment_request_text', :'amount' => :'amount', :'auth_code' => :'auth_code', :'case_number' => :'case_number', :'chargeback_dispute_oid' => :'chargeback_dispute_oid', :'chargeback_dts' => :'chargeback_dts', :'currency' => :'currency', :'customer_care_notes' => :'customer_care_notes', :'encryption_key' => :'encryption_key', :'expiration_dts' => :'expiration_dts', :'fax_failure_reason' => :'fax_failure_reason', :'fax_number' => :'fax_number', :'fax_transaction_id' => :'fax_transaction_id', :'icsid' => :'icsid', :'merchant_account_profile_oid' => :'merchant_account_profile_oid', :'order' => :'order', :'order_id' => :'order_id', :'partial_card_number' => :'partial_card_number', :'pdf_file_oid' => :'pdf_file_oid', :'reason_code' => :'reason_code', :'status' => :'status', :'website_url' => :'website_url' } end
Initializes the object @param [Hash] attributes Model attributes in the form of hash
# File lib/ultracart_api/models/chargeback_dispute.rb, line 145 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'account_number') self.account_number = attributes[:'account_number'] end if attributes.has_key?(:'adjustment_request_text') self.adjustment_request_text = attributes[:'adjustment_request_text'] end if attributes.has_key?(:'amount') self.amount = attributes[:'amount'] end if attributes.has_key?(:'auth_code') self.auth_code = attributes[:'auth_code'] end if attributes.has_key?(:'case_number') self.case_number = attributes[:'case_number'] end if attributes.has_key?(:'chargeback_dispute_oid') self.chargeback_dispute_oid = attributes[:'chargeback_dispute_oid'] end if attributes.has_key?(:'chargeback_dts') self.chargeback_dts = attributes[:'chargeback_dts'] end if attributes.has_key?(:'currency') self.currency = attributes[:'currency'] end if attributes.has_key?(:'customer_care_notes') self.customer_care_notes = attributes[:'customer_care_notes'] end if attributes.has_key?(:'encryption_key') self.encryption_key = attributes[:'encryption_key'] end if attributes.has_key?(:'expiration_dts') self.expiration_dts = attributes[:'expiration_dts'] end if attributes.has_key?(:'fax_failure_reason') self.fax_failure_reason = attributes[:'fax_failure_reason'] end if attributes.has_key?(:'fax_number') self.fax_number = attributes[:'fax_number'] end if attributes.has_key?(:'fax_transaction_id') self.fax_transaction_id = attributes[:'fax_transaction_id'] end if attributes.has_key?(:'icsid') self.icsid = attributes[:'icsid'] end if attributes.has_key?(:'merchant_account_profile_oid') self.merchant_account_profile_oid = attributes[:'merchant_account_profile_oid'] end if attributes.has_key?(:'order') self.order = attributes[:'order'] end if attributes.has_key?(:'order_id') self.order_id = attributes[:'order_id'] end if attributes.has_key?(:'partial_card_number') self.partial_card_number = attributes[:'partial_card_number'] end if attributes.has_key?(:'pdf_file_oid') self.pdf_file_oid = attributes[:'pdf_file_oid'] end if attributes.has_key?(:'reason_code') self.reason_code = attributes[:'reason_code'] end if attributes.has_key?(:'status') self.status = attributes[:'status'] end if attributes.has_key?(:'website_url') self.website_url = attributes[:'website_url'] end end
Attribute type mapping.
# File lib/ultracart_api/models/chargeback_dispute.rb, line 115 def self.swagger_types { :'account_number' => :'String', :'adjustment_request_text' => :'String', :'amount' => :'Float', :'auth_code' => :'String', :'case_number' => :'String', :'chargeback_dispute_oid' => :'Integer', :'chargeback_dts' => :'String', :'currency' => :'String', :'customer_care_notes' => :'String', :'encryption_key' => :'String', :'expiration_dts' => :'String', :'fax_failure_reason' => :'String', :'fax_number' => :'String', :'fax_transaction_id' => :'Integer', :'icsid' => :'String', :'merchant_account_profile_oid' => :'Integer', :'order' => :'Order', :'order_id' => :'String', :'partial_card_number' => :'String', :'pdf_file_oid' => :'String', :'reason_code' => :'String', :'status' => :'String', :'website_url' => :'String' } end
Public Instance Methods
Checks equality by comparing each attribute. @param [Object] Object to be compared
# File lib/ultracart_api/models/chargeback_dispute.rb, line 469 def ==(o) return true if self.equal?(o) self.class == o.class && account_number == o.account_number && adjustment_request_text == o.adjustment_request_text && amount == o.amount && auth_code == o.auth_code && case_number == o.case_number && chargeback_dispute_oid == o.chargeback_dispute_oid && chargeback_dts == o.chargeback_dts && currency == o.currency && customer_care_notes == o.customer_care_notes && encryption_key == o.encryption_key && expiration_dts == o.expiration_dts && fax_failure_reason == o.fax_failure_reason && fax_number == o.fax_number && fax_transaction_id == o.fax_transaction_id && icsid == o.icsid && merchant_account_profile_oid == o.merchant_account_profile_oid && order == o.order && order_id == o.order_id && partial_card_number == o.partial_card_number && pdf_file_oid == o.pdf_file_oid && reason_code == o.reason_code && status == o.status && website_url == o.website_url end
Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data
# File lib/ultracart_api/models/chargeback_dispute.rb, line 533 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = UltracartClient.const_get(type).new temp_model.build_from_hash(value) end end
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash
# File lib/ultracart_api/models/chargeback_dispute.rb, line 599 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end
Custom attribute writer method with validation @param [Object] account_number
Value to be assigned
# File lib/ultracart_api/models/chargeback_dispute.rb, line 329 def account_number=(account_number) if !account_number.nil? && account_number.to_s.length > 50 fail ArgumentError, 'invalid value for "account_number", the character length must be smaller than or equal to 50.' end @account_number = account_number end
Custom attribute writer method with validation @param [Object] auth_code
Value to be assigned
# File lib/ultracart_api/models/chargeback_dispute.rb, line 339 def auth_code=(auth_code) if !auth_code.nil? && auth_code.to_s.length > 20 fail ArgumentError, 'invalid value for "auth_code", the character length must be smaller than or equal to 20.' end @auth_code = auth_code end
Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself
# File lib/ultracart_api/models/chargeback_dispute.rb, line 512 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end
Custom attribute writer method with validation @param [Object] case_number
Value to be assigned
# File lib/ultracart_api/models/chargeback_dispute.rb, line 349 def case_number=(case_number) if !case_number.nil? && case_number.to_s.length > 50 fail ArgumentError, 'invalid value for "case_number", the character length must be smaller than or equal to 50.' end @case_number = case_number end
Custom attribute writer method with validation @param [Object] currency Value to be assigned
# File lib/ultracart_api/models/chargeback_dispute.rb, line 359 def currency=(currency) if !currency.nil? && currency.to_s.length > 10 fail ArgumentError, 'invalid value for "currency", the character length must be smaller than or equal to 10.' end @currency = currency end
Custom attribute writer method with validation @param [Object] encryption_key
Value to be assigned
# File lib/ultracart_api/models/chargeback_dispute.rb, line 369 def encryption_key=(encryption_key) if !encryption_key.nil? && encryption_key.to_s.length > 100 fail ArgumentError, 'invalid value for "encryption_key", the character length must be smaller than or equal to 100.' end @encryption_key = encryption_key end
@see the `==` method @param [Object] Object to be compared
# File lib/ultracart_api/models/chargeback_dispute.rb, line 499 def eql?(o) self == o end
Custom attribute writer method with validation @param [Object] fax_failure_reason
Value to be assigned
# File lib/ultracart_api/models/chargeback_dispute.rb, line 379 def fax_failure_reason=(fax_failure_reason) if !fax_failure_reason.nil? && fax_failure_reason.to_s.length > 250 fail ArgumentError, 'invalid value for "fax_failure_reason", the character length must be smaller than or equal to 250.' end @fax_failure_reason = fax_failure_reason end
Custom attribute writer method with validation @param [Object] fax_number
Value to be assigned
# File lib/ultracart_api/models/chargeback_dispute.rb, line 389 def fax_number=(fax_number) if !fax_number.nil? && fax_number.to_s.length > 20 fail ArgumentError, 'invalid value for "fax_number", the character length must be smaller than or equal to 20.' end @fax_number = fax_number end
Calculates hash code according to all attributes. @return [Fixnum] Hash code
# File lib/ultracart_api/models/chargeback_dispute.rb, line 505 def hash [account_number, adjustment_request_text, amount, auth_code, case_number, chargeback_dispute_oid, chargeback_dts, currency, customer_care_notes, encryption_key, expiration_dts, fax_failure_reason, fax_number, fax_transaction_id, icsid, merchant_account_profile_oid, order, order_id, partial_card_number, pdf_file_oid, reason_code, status, website_url].hash end
Custom attribute writer method with validation @param [Object] icsid Value to be assigned
# File lib/ultracart_api/models/chargeback_dispute.rb, line 399 def icsid=(icsid) if !icsid.nil? && icsid.to_s.length > 50 fail ArgumentError, 'invalid value for "icsid", the character length must be smaller than or equal to 50.' end @icsid = icsid end
Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons
# File lib/ultracart_api/models/chargeback_dispute.rb, line 246 def list_invalid_properties invalid_properties = Array.new if !@account_number.nil? && @account_number.to_s.length > 50 invalid_properties.push('invalid value for "account_number", the character length must be smaller than or equal to 50.') end if !@auth_code.nil? && @auth_code.to_s.length > 20 invalid_properties.push('invalid value for "auth_code", the character length must be smaller than or equal to 20.') end if !@case_number.nil? && @case_number.to_s.length > 50 invalid_properties.push('invalid value for "case_number", the character length must be smaller than or equal to 50.') end if !@currency.nil? && @currency.to_s.length > 10 invalid_properties.push('invalid value for "currency", the character length must be smaller than or equal to 10.') end if !@encryption_key.nil? && @encryption_key.to_s.length > 100 invalid_properties.push('invalid value for "encryption_key", the character length must be smaller than or equal to 100.') end if !@fax_failure_reason.nil? && @fax_failure_reason.to_s.length > 250 invalid_properties.push('invalid value for "fax_failure_reason", the character length must be smaller than or equal to 250.') end if !@fax_number.nil? && @fax_number.to_s.length > 20 invalid_properties.push('invalid value for "fax_number", the character length must be smaller than or equal to 20.') end if !@icsid.nil? && @icsid.to_s.length > 50 invalid_properties.push('invalid value for "icsid", the character length must be smaller than or equal to 50.') end if !@order_id.nil? && @order_id.to_s.length > 30 invalid_properties.push('invalid value for "order_id", the character length must be smaller than or equal to 30.') end if !@partial_card_number.nil? && @partial_card_number.to_s.length > 20 invalid_properties.push('invalid value for "partial_card_number", the character length must be smaller than or equal to 20.') end if !@pdf_file_oid.nil? && @pdf_file_oid.to_s.length > 32 invalid_properties.push('invalid value for "pdf_file_oid", the character length must be smaller than or equal to 32.') end if !@reason_code.nil? && @reason_code.to_s.length > 70 invalid_properties.push('invalid value for "reason_code", the character length must be smaller than or equal to 70.') end if !@status.nil? && @status.to_s.length > 20 invalid_properties.push('invalid value for "status", the character length must be smaller than or equal to 20.') end if !@website_url.nil? && @website_url.to_s.length > 250 invalid_properties.push('invalid value for "website_url", the character length must be smaller than or equal to 250.') end invalid_properties end
Custom attribute writer method with validation @param [Object] order_id
Value to be assigned
# File lib/ultracart_api/models/chargeback_dispute.rb, line 409 def order_id=(order_id) if !order_id.nil? && order_id.to_s.length > 30 fail ArgumentError, 'invalid value for "order_id", the character length must be smaller than or equal to 30.' end @order_id = order_id end
Custom attribute writer method with validation @param [Object] partial_card_number
Value to be assigned
# File lib/ultracart_api/models/chargeback_dispute.rb, line 419 def partial_card_number=(partial_card_number) if !partial_card_number.nil? && partial_card_number.to_s.length > 20 fail ArgumentError, 'invalid value for "partial_card_number", the character length must be smaller than or equal to 20.' end @partial_card_number = partial_card_number end
Custom attribute writer method with validation @param [Object] pdf_file_oid
Value to be assigned
# File lib/ultracart_api/models/chargeback_dispute.rb, line 429 def pdf_file_oid=(pdf_file_oid) if !pdf_file_oid.nil? && pdf_file_oid.to_s.length > 32 fail ArgumentError, 'invalid value for "pdf_file_oid", the character length must be smaller than or equal to 32.' end @pdf_file_oid = pdf_file_oid end
Custom attribute writer method with validation @param [Object] reason_code
Value to be assigned
# File lib/ultracart_api/models/chargeback_dispute.rb, line 439 def reason_code=(reason_code) if !reason_code.nil? && reason_code.to_s.length > 70 fail ArgumentError, 'invalid value for "reason_code", the character length must be smaller than or equal to 70.' end @reason_code = reason_code end
Custom attribute writer method with validation @param [Object] status Value to be assigned
# File lib/ultracart_api/models/chargeback_dispute.rb, line 449 def status=(status) if !status.nil? && status.to_s.length > 20 fail ArgumentError, 'invalid value for "status", the character length must be smaller than or equal to 20.' end @status = status end
Returns the object in the form of hash @return [Hash] Returns the object in the form of hash
# File lib/ultracart_api/models/chargeback_dispute.rb, line 585 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end
Returns the string representation of the object @return [String] String presentation of the object
# File lib/ultracart_api/models/chargeback_dispute.rb, line 573 def to_s to_hash.to_s end
Check to see if the all the properties in the model are valid @return true if the model is valid
# File lib/ultracart_api/models/chargeback_dispute.rb, line 309 def valid? return false if !@account_number.nil? && @account_number.to_s.length > 50 return false if !@auth_code.nil? && @auth_code.to_s.length > 20 return false if !@case_number.nil? && @case_number.to_s.length > 50 return false if !@currency.nil? && @currency.to_s.length > 10 return false if !@encryption_key.nil? && @encryption_key.to_s.length > 100 return false if !@fax_failure_reason.nil? && @fax_failure_reason.to_s.length > 250 return false if !@fax_number.nil? && @fax_number.to_s.length > 20 return false if !@icsid.nil? && @icsid.to_s.length > 50 return false if !@order_id.nil? && @order_id.to_s.length > 30 return false if !@partial_card_number.nil? && @partial_card_number.to_s.length > 20 return false if !@pdf_file_oid.nil? && @pdf_file_oid.to_s.length > 32 return false if !@reason_code.nil? && @reason_code.to_s.length > 70 return false if !@status.nil? && @status.to_s.length > 20 return false if !@website_url.nil? && @website_url.to_s.length > 250 true end
Custom attribute writer method with validation @param [Object] website_url
Value to be assigned
# File lib/ultracart_api/models/chargeback_dispute.rb, line 459 def website_url=(website_url) if !website_url.nil? && website_url.to_s.length > 250 fail ArgumentError, 'invalid value for "website_url", the character length must be smaller than or equal to 250.' end @website_url = website_url end