Class: SyncteraRubySdk::OutgoingAch
- Inherits:
-
Object
- Object
- SyncteraRubySdk::OutgoingAch
- Defined in:
- lib/synctera_ruby_sdk/models/outgoing_ach.rb
Overview
Represents a sent ACH transaction.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#account_name ⇒ Object
Receiving account name.
-
#account_no ⇒ Object
Receiving account number.
-
#amount ⇒ Object
Transaction amount in cents.
-
#bank_id ⇒ Object
Returns the value of attribute bank_id.
-
#company_entry_description ⇒ Object
Company Entry Description field in ACH batch header.
-
#company_name ⇒ Object
Company Name field in ACH batch header.
-
#effective_date ⇒ Object
Effective date of the transaction.
-
#external_id ⇒ Object
Transaction ID in the ledger.
-
#hold ⇒ Object
Returns the value of attribute hold.
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_same_day ⇒ Object
Was initiated as same-day ACH transaction.
-
#memo ⇒ Object
Returns the value of attribute memo.
-
#partner_id ⇒ Object
Returns the value of attribute partner_id.
-
#reference_info ⇒ Object
Transaction reference info.
-
#source_account_name ⇒ Object
Originating account name.
-
#source_account_no ⇒ Object
Originating account number.
-
#status ⇒ Object
Returns the value of attribute status.
-
#trace_no ⇒ Object
Trace number of the transaction.
Class Method Summary collapse
-
.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.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ OutgoingAch
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ OutgoingAch
Initializes the object
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 202 203 204 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 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 150 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `SyncteraRubySdk::OutgoingAch` 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::OutgoingAch`. 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?(:'account_name') self.account_name = attributes[:'account_name'] end if attributes.key?(:'account_no') self.account_no = attributes[:'account_no'] end if attributes.key?(:'amount') self.amount = attributes[:'amount'] end if attributes.key?(:'bank_id') self.bank_id = attributes[:'bank_id'] end if attributes.key?(:'company_entry_description') self.company_entry_description = attributes[:'company_entry_description'] end if attributes.key?(:'company_name') self.company_name = attributes[:'company_name'] end if attributes.key?(:'effective_date') self.effective_date = attributes[:'effective_date'] end if attributes.key?(:'external_id') self.external_id = attributes[:'external_id'] end if attributes.key?(:'hold') self.hold = attributes[:'hold'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'is_same_day') self.is_same_day = attributes[:'is_same_day'] end if attributes.key?(:'memo') self.memo = attributes[:'memo'] end if attributes.key?(:'partner_id') self.partner_id = attributes[:'partner_id'] end if attributes.key?(:'reference_info') self.reference_info = attributes[:'reference_info'] end if attributes.key?(:'source_account_name') self.source_account_name = attributes[:'source_account_name'] end if attributes.key?(:'source_account_no') self.source_account_no = attributes[:'source_account_no'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'trace_no') self.trace_no = attributes[:'trace_no'] end end |
Instance Attribute Details
#account_name ⇒ Object
Receiving account name
20 21 22 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 20 def account_name @account_name end |
#account_no ⇒ Object
Receiving account number
23 24 25 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 23 def account_no @account_no end |
#amount ⇒ Object
Transaction amount in cents
26 27 28 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 26 def amount @amount end |
#bank_id ⇒ Object
Returns the value of attribute bank_id.
28 29 30 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 28 def bank_id @bank_id end |
#company_entry_description ⇒ Object
Company Entry Description field in ACH batch header. Originator inserts this field’s value to provide the Receiver with a description of the entry’s purpose.
31 32 33 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 31 def company_entry_description @company_entry_description end |
#company_name ⇒ Object
Company Name field in ACH batch header.
34 35 36 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 34 def company_name @company_name end |
#effective_date ⇒ Object
Effective date of the transaction
37 38 39 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 37 def effective_date @effective_date end |
#external_id ⇒ Object
Transaction ID in the ledger
40 41 42 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 40 def external_id @external_id end |
#hold ⇒ Object
Returns the value of attribute hold.
42 43 44 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 42 def hold @hold end |
#id ⇒ Object
Returns the value of attribute id.
44 45 46 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 44 def id @id end |
#is_same_day ⇒ Object
Was initiated as same-day ACH transaction
47 48 49 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 47 def is_same_day @is_same_day end |
#memo ⇒ Object
Returns the value of attribute memo.
49 50 51 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 49 def memo @memo end |
#partner_id ⇒ Object
Returns the value of attribute partner_id.
51 52 53 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 51 def partner_id @partner_id end |
#reference_info ⇒ Object
Transaction reference info
54 55 56 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 54 def reference_info @reference_info end |
#source_account_name ⇒ Object
Originating account name
57 58 59 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 57 def source_account_name @source_account_name end |
#source_account_no ⇒ Object
Originating account number
60 61 62 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 60 def source_account_no @source_account_no end |
#status ⇒ Object
Returns the value of attribute status.
62 63 64 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 62 def status @status end |
#trace_no ⇒ Object
Trace number of the transaction
65 66 67 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 65 def trace_no @trace_no end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
114 115 116 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 114 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 90 def self.attribute_map { :'account_name' => :'account_name', :'account_no' => :'account_no', :'amount' => :'amount', :'bank_id' => :'bank_id', :'company_entry_description' => :'company_entry_description', :'company_name' => :'company_name', :'effective_date' => :'effective_date', :'external_id' => :'external_id', :'hold' => :'hold', :'id' => :'id', :'is_same_day' => :'is_same_day', :'memo' => :'memo', :'partner_id' => :'partner_id', :'reference_info' => :'reference_info', :'source_account_name' => :'source_account_name', :'source_account_no' => :'source_account_no', :'status' => :'status', :'trace_no' => :'trace_no' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
361 362 363 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 361 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
143 144 145 146 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 143 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 119 def self.openapi_types { :'account_name' => :'String', :'account_no' => :'String', :'amount' => :'Integer', :'bank_id' => :'Integer', :'company_entry_description' => :'String', :'company_name' => :'String', :'effective_date' => :'Date', :'external_id' => :'String', :'hold' => :'HoldData', :'id' => :'String', :'is_same_day' => :'Boolean', :'memo' => :'String', :'partner_id' => :'Integer', :'reference_info' => :'String', :'source_account_name' => :'String', :'source_account_no' => :'String', :'status' => :'String', :'trace_no' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 323 def ==(o) return true if self.equal?(o) self.class == o.class && account_name == o.account_name && account_no == o.account_no && amount == o.amount && bank_id == o.bank_id && company_entry_description == o.company_entry_description && company_name == o.company_name && effective_date == o.effective_date && external_id == o.external_id && hold == o.hold && id == o.id && is_same_day == o.is_same_day && memo == o.memo && partner_id == o.partner_id && reference_info == o.reference_info && source_account_name == o.source_account_name && source_account_no == o.source_account_no && status == o.status && trace_no == o.trace_no end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 392 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<(?<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 # models (e.g. Pet) or oneOf klass = SyncteraRubySdk.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
463 464 465 466 467 468 469 470 471 472 473 474 475 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 463 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 |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 368 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 |
#eql?(o) ⇒ Boolean
348 349 350 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 348 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
354 355 356 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 354 def hash [account_name, account_no, amount, bank_id, company_entry_description, company_name, effective_date, external_id, hold, id, is_same_day, memo, partner_id, reference_info, source_account_name, source_account_no, status, trace_no].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 238 def list_invalid_properties invalid_properties = Array.new if @account_no.nil? invalid_properties.push('invalid value for "account_no", account_no cannot be nil.') end if @amount.nil? invalid_properties.push('invalid value for "amount", amount cannot be nil.') end if @bank_id.nil? invalid_properties.push('invalid value for "bank_id", bank_id cannot be nil.') end if @effective_date.nil? invalid_properties.push('invalid value for "effective_date", effective_date cannot be nil.') end if @external_id.nil? invalid_properties.push('invalid value for "external_id", external_id cannot be nil.') end if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @is_same_day.nil? invalid_properties.push('invalid value for "is_same_day", is_same_day cannot be nil.') end if @memo.nil? invalid_properties.push('invalid value for "memo", memo cannot be nil.') end if @partner_id.nil? invalid_properties.push('invalid value for "partner_id", partner_id cannot be nil.') end if @source_account_no.nil? invalid_properties.push('invalid value for "source_account_no", source_account_no cannot be nil.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end if @trace_no.nil? invalid_properties.push('invalid value for "trace_no", trace_no cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
439 440 441 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 439 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
445 446 447 448 449 450 451 452 453 454 455 456 457 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 445 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 |
#to_s ⇒ String
Returns the string representation of the object
433 434 435 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 433 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 |
# File 'lib/synctera_ruby_sdk/models/outgoing_ach.rb', line 293 def valid? return false if @account_no.nil? return false if @amount.nil? return false if @bank_id.nil? return false if @effective_date.nil? return false if @external_id.nil? return false if @id.nil? return false if @is_same_day.nil? return false if @memo.nil? return false if @partner_id.nil? return false if @source_account_no.nil? return false if @status.nil? status_validator = EnumAttributeValidator.new('String', ["INIT", "PENDING", "CANCELED", "COMPLETE", "DECLINED"]) return false unless status_validator.valid?(@status) return false if @trace_no.nil? true end |