Class: Devdraft::CreateExternalBankTransferDto
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Devdraft::CreateExternalBankTransferDto
- Defined in:
- lib/devdraft/models/create_external_bank_transfer_dto.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#ach_reference ⇒ Object
ACH reference message (1-10 characters, only for ACH transfers).
-
#amount ⇒ Object
The amount to transfer.
-
#destination_currency ⇒ Object
The destination currency.
-
#destination_payment_rail ⇒ Object
The destination payment rail (fiat payment method).
-
#external_account_id ⇒ Object
The external account ID for the bank transfer.
-
#sepa_reference ⇒ Object
SEPA reference message (6-140 characters, only for SEPA transfers).
-
#source_currency ⇒ Object
The source currency.
-
#source_wallet_id ⇒ Object
The ID of the source bridge wallet.
-
#spei_reference ⇒ Object
SPEI reference message (1-40 characters, only for SPEI transfers).
-
#swift_charges ⇒ Object
SWIFT charges bearer (only for SWIFT transfers).
-
#swift_reference ⇒ Object
SWIFT reference message (1-190 characters, only for SWIFT transfers).
-
#wire_message ⇒ Object
Wire transfer message (1-256 characters, only for wire transfers).
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ CreateExternalBankTransferDto
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ CreateExternalBankTransferDto
Initializes the object
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 130 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Devdraft::CreateExternalBankTransferDto` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Devdraft::CreateExternalBankTransferDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'source_wallet_id') self.source_wallet_id = attributes[:'source_wallet_id'] else self.source_wallet_id = nil end if attributes.key?(:'source_currency') self.source_currency = attributes[:'source_currency'] else self.source_currency = nil end if attributes.key?(:'destination_currency') self.destination_currency = attributes[:'destination_currency'] else self.destination_currency = nil end if attributes.key?(:'destination_payment_rail') self.destination_payment_rail = attributes[:'destination_payment_rail'] else self.destination_payment_rail = nil end if attributes.key?(:'external_account_id') self.external_account_id = attributes[:'external_account_id'] else self.external_account_id = nil end if attributes.key?(:'amount') self.amount = attributes[:'amount'] end if attributes.key?(:'wire_message') self. = attributes[:'wire_message'] end if attributes.key?(:'sepa_reference') self.sepa_reference = attributes[:'sepa_reference'] end if attributes.key?(:'swift_reference') self.swift_reference = attributes[:'swift_reference'] end if attributes.key?(:'spei_reference') self.spei_reference = attributes[:'spei_reference'] end if attributes.key?(:'swift_charges') self.swift_charges = attributes[:'swift_charges'] end if attributes.key?(:'ach_reference') self.ach_reference = attributes[:'ach_reference'] end end |
Instance Attribute Details
#ach_reference ⇒ Object
ACH reference message (1-10 characters, only for ACH transfers)
52 53 54 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 52 def ach_reference @ach_reference end |
#amount ⇒ Object
The amount to transfer
34 35 36 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 34 def amount @amount end |
#destination_currency ⇒ Object
The destination currency
25 26 27 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 25 def destination_currency @destination_currency end |
#destination_payment_rail ⇒ Object
The destination payment rail (fiat payment method)
28 29 30 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 28 def destination_payment_rail @destination_payment_rail end |
#external_account_id ⇒ Object
The external account ID for the bank transfer
31 32 33 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 31 def external_account_id @external_account_id end |
#sepa_reference ⇒ Object
SEPA reference message (6-140 characters, only for SEPA transfers)
40 41 42 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 40 def sepa_reference @sepa_reference end |
#source_currency ⇒ Object
The source currency
22 23 24 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 22 def source_currency @source_currency end |
#source_wallet_id ⇒ Object
The ID of the source bridge wallet
19 20 21 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 19 def source_wallet_id @source_wallet_id end |
#spei_reference ⇒ Object
SPEI reference message (1-40 characters, only for SPEI transfers)
46 47 48 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 46 def spei_reference @spei_reference end |
#swift_charges ⇒ Object
SWIFT charges bearer (only for SWIFT transfers)
49 50 51 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 49 def swift_charges @swift_charges end |
#swift_reference ⇒ Object
SWIFT reference message (1-190 characters, only for SWIFT transfers)
43 44 45 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 43 def swift_reference @swift_reference end |
#wire_message ⇒ Object
Wire transfer message (1-256 characters, only for wire transfers)
37 38 39 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 37 def end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
95 96 97 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 95 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
100 101 102 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 100 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 77 def self.attribute_map { :'source_wallet_id' => :'sourceWalletId', :'source_currency' => :'sourceCurrency', :'destination_currency' => :'destinationCurrency', :'destination_payment_rail' => :'destinationPaymentRail', :'external_account_id' => :'external_account_id', :'amount' => :'amount', :'wire_message' => :'wire_message', :'sepa_reference' => :'sepa_reference', :'swift_reference' => :'swift_reference', :'spei_reference' => :'spei_reference', :'swift_charges' => :'swift_charges', :'ach_reference' => :'ach_reference' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 467 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) 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[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
123 124 125 126 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 123 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 105 def self.openapi_types { :'source_wallet_id' => :'String', :'source_currency' => :'String', :'destination_currency' => :'String', :'destination_payment_rail' => :'BridgeFiatPaymentRail', :'external_account_id' => :'String', :'amount' => :'Float', :'wire_message' => :'String', :'sepa_reference' => :'String', :'swift_reference' => :'String', :'spei_reference' => :'String', :'swift_charges' => :'String', :'ach_reference' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 435 def ==(o) return true if self.equal?(o) self.class == o.class && source_wallet_id == o.source_wallet_id && source_currency == o.source_currency && destination_currency == o.destination_currency && destination_payment_rail == o.destination_payment_rail && external_account_id == o.external_account_id && amount == o.amount && == o. && sepa_reference == o.sepa_reference && swift_reference == o.swift_reference && spei_reference == o.spei_reference && swift_charges == o.swift_charges && ach_reference == o.ach_reference end |
#eql?(o) ⇒ Boolean
454 455 456 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 454 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
460 461 462 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 460 def hash [source_wallet_id, source_currency, destination_currency, destination_payment_rail, external_account_id, amount, , sepa_reference, swift_reference, spei_reference, swift_charges, ach_reference].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 205 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @source_wallet_id.nil? invalid_properties.push('invalid value for "source_wallet_id", source_wallet_id cannot be nil.') end if @source_currency.nil? invalid_properties.push('invalid value for "source_currency", source_currency cannot be nil.') end if @destination_currency.nil? invalid_properties.push('invalid value for "destination_currency", destination_currency cannot be nil.') end if @destination_payment_rail.nil? invalid_properties.push('invalid value for "destination_payment_rail", destination_payment_rail cannot be nil.') end if @external_account_id.nil? invalid_properties.push('invalid value for "external_account_id", external_account_id cannot be nil.') end if !.nil? && .to_s.length > 256 invalid_properties.push('invalid value for "wire_message", the character length must be smaller than or equal to 256.') end if !.nil? && .to_s.length < 1 invalid_properties.push('invalid value for "wire_message", the character length must be greater than or equal to 1.') end if !@sepa_reference.nil? && @sepa_reference.to_s.length > 140 invalid_properties.push('invalid value for "sepa_reference", the character length must be smaller than or equal to 140.') end if !@sepa_reference.nil? && @sepa_reference.to_s.length < 6 invalid_properties.push('invalid value for "sepa_reference", the character length must be greater than or equal to 6.') end if !@swift_reference.nil? && @swift_reference.to_s.length > 190 invalid_properties.push('invalid value for "swift_reference", the character length must be smaller than or equal to 190.') end if !@swift_reference.nil? && @swift_reference.to_s.length < 1 invalid_properties.push('invalid value for "swift_reference", the character length must be greater than or equal to 1.') end if !@spei_reference.nil? && @spei_reference.to_s.length > 40 invalid_properties.push('invalid value for "spei_reference", the character length must be smaller than or equal to 40.') end if !@spei_reference.nil? && @spei_reference.to_s.length < 1 invalid_properties.push('invalid value for "spei_reference", the character length must be greater than or equal to 1.') end if !@ach_reference.nil? && @ach_reference.to_s.length > 10 invalid_properties.push('invalid value for "ach_reference", the character length must be smaller than or equal to 10.') end if !@ach_reference.nil? && @ach_reference.to_s.length < 1 invalid_properties.push('invalid value for "ach_reference", the character length must be greater than or equal to 1.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
489 490 491 492 493 494 495 496 497 498 499 500 501 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 489 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 |
# File 'lib/devdraft/models/create_external_bank_transfer_dto.rb', line 273 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @source_wallet_id.nil? return false if @source_currency.nil? return false if @destination_currency.nil? return false if @destination_payment_rail.nil? return false if @external_account_id.nil? return false if !.nil? && .to_s.length > 256 return false if !.nil? && .to_s.length < 1 return false if !@sepa_reference.nil? && @sepa_reference.to_s.length > 140 return false if !@sepa_reference.nil? && @sepa_reference.to_s.length < 6 return false if !@swift_reference.nil? && @swift_reference.to_s.length > 190 return false if !@swift_reference.nil? && @swift_reference.to_s.length < 1 return false if !@spei_reference.nil? && @spei_reference.to_s.length > 40 return false if !@spei_reference.nil? && @spei_reference.to_s.length < 1 return false if !@ach_reference.nil? && @ach_reference.to_s.length > 10 return false if !@ach_reference.nil? && @ach_reference.to_s.length < 1 true end |