=begin #Synctera API #
Welcome to the official reference documentation for Synctera APIs. Our APIs are the best way to automate your company's banking needs and are designed to be easy to understand and implement.
We're continuously growing this library and what you see here is just the start, but if you need something specific or have a question, contact us.
The version of the OpenAPI document: 0.60.0 Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.5.0 =end require 'date' require 'time' module SyncteraRubySdk class InternationalWirePost # Transfer amount in cents ($100 would be 10000) in the currency of the beneficiary. attr_accessor :amount_in_beneficiary_currency # The currency of the beneficiary's account in ISO4217 format. Optional, the currency will be inferred form the receiving account, validation will be performed if this field is provided, if the receiving account currency and this field do not match the API will return an error. attr_accessor :beneficiary_currency # The customer UUID representing the person initiating the Wire transfer. attr_accessor :customer_id # Additional transfer metadata structured as key-value pairs. attr_accessor :metadata # The account uuid representing the sender of the wire. attr_accessor :originating_account_id # The quote id returned from the /international_wire/quote endpoint, contains FX rate information. Required if the international wire is cross currency. attr_accessor :quote_id # The external account uuid representing the recipient of the wire. Needs to be configured with international bank routing details (e.g. SWIFT code, refer to external accounts documentation). attr_accessor :receiving_account_id # The currency of the sender's account in ISO4217 format. Optional, the currency will be inferred form the originating account, validation will be performed if this field is provided, if the originating account currency and this field do not match the API will return an error. attr_accessor :sender_currency # Optional transaction instructions for the recipient bank if required by the recipient bank. attr_accessor :wire_instruction # Reason for the wire transfer. attr_accessor :wire_purpose # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'amount_in_beneficiary_currency' => :'amount_in_beneficiary_currency', :'beneficiary_currency' => :'beneficiary_currency', :'customer_id' => :'customer_id', :'metadata' => :'metadata', :'originating_account_id' => :'originating_account_id', :'quote_id' => :'quote_id', :'receiving_account_id' => :'receiving_account_id', :'sender_currency' => :'sender_currency', :'wire_instruction' => :'wire_instruction', :'wire_purpose' => :'wire_purpose' } 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 { :'amount_in_beneficiary_currency' => :'Integer', :'beneficiary_currency' => :'String', :'customer_id' => :'String', :'metadata' => :'Object', :'originating_account_id' => :'String', :'quote_id' => :'String', :'receiving_account_id' => :'String', :'sender_currency' => :'String', :'wire_instruction' => :'String', :'wire_purpose' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ ]) end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `SyncteraRubySdk::InternationalWirePost` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `SyncteraRubySdk::InternationalWirePost`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'amount_in_beneficiary_currency') self.amount_in_beneficiary_currency = attributes[:'amount_in_beneficiary_currency'] end if attributes.key?(:'beneficiary_currency') self.beneficiary_currency = attributes[:'beneficiary_currency'] end if attributes.key?(:'customer_id') self.customer_id = attributes[:'customer_id'] end if attributes.key?(:'metadata') self.metadata = attributes[:'metadata'] end if attributes.key?(:'originating_account_id') self.originating_account_id = attributes[:'originating_account_id'] end if attributes.key?(:'quote_id') self.quote_id = attributes[:'quote_id'] end if attributes.key?(:'receiving_account_id') self.receiving_account_id = attributes[:'receiving_account_id'] end if attributes.key?(:'sender_currency') self.sender_currency = attributes[:'sender_currency'] end if attributes.key?(:'wire_instruction') self.wire_instruction = attributes[:'wire_instruction'] end if attributes.key?(:'wire_purpose') self.wire_purpose = attributes[:'wire_purpose'] end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new if @amount_in_beneficiary_currency.nil? invalid_properties.push('invalid value for "amount_in_beneficiary_currency", amount_in_beneficiary_currency cannot be nil.') end if @customer_id.nil? invalid_properties.push('invalid value for "customer_id", customer_id cannot be nil.') end if @originating_account_id.nil? invalid_properties.push('invalid value for "originating_account_id", originating_account_id cannot be nil.') end if @receiving_account_id.nil? invalid_properties.push('invalid value for "receiving_account_id", receiving_account_id cannot be nil.') end if !@wire_instruction.nil? && @wire_instruction.to_s.length > 210 invalid_properties.push('invalid value for "wire_instruction", the character length must be smaller than or equal to 210.') end if @wire_purpose.nil? invalid_properties.push('invalid value for "wire_purpose", wire_purpose cannot be nil.') end invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? return false if @amount_in_beneficiary_currency.nil? return false if @customer_id.nil? return false if @originating_account_id.nil? return false if @receiving_account_id.nil? return false if !@wire_instruction.nil? && @wire_instruction.to_s.length > 210 return false if @wire_purpose.nil? true end # Custom attribute writer method with validation # @param [Object] wire_instruction Value to be assigned def wire_instruction=(wire_instruction) if !wire_instruction.nil? && wire_instruction.to_s.length > 210 fail ArgumentError, 'invalid value for "wire_instruction", the character length must be smaller than or equal to 210.' end @wire_instruction = wire_instruction end # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && amount_in_beneficiary_currency == o.amount_in_beneficiary_currency && beneficiary_currency == o.beneficiary_currency && customer_id == o.customer_id && metadata == o.metadata && originating_account_id == o.originating_account_id && quote_id == o.quote_id && receiving_account_id == o.receiving_account_id && sender_currency == o.sender_currency && wire_instruction == o.wire_instruction && wire_purpose == o.wire_purpose end # @see the `==` method # @param [Object] Object to be compared def eql?(o) self == o end # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash [amount_in_beneficiary_currency, beneficiary_currency, customer_id, metadata, originating_account_id, quote_id, receiving_account_id, sender_currency, wire_instruction, wire_purpose].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) 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) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym when :Time Time.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<(?