Class: SyncteraRubySdk::ExternalAccount
- Inherits:
-
Object
- Object
- SyncteraRubySdk::ExternalAccount
- Defined in:
- lib/synctera_ruby_sdk/models/external_account.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#account_identifiers ⇒ Object
Returns the value of attribute account_identifiers.
-
#account_owner_names ⇒ Object
The names of the account owners.
-
#business_id ⇒ Object
The identifier for the business customer associated with this external account.
-
#creation_time ⇒ Object
Returns the value of attribute creation_time.
-
#currency ⇒ Object
ISO 4217 alphabetic currency code.
-
#customer_id ⇒ Object
The identifier for the personal customer associated with this external account.
-
#deletion_time ⇒ Object
Returns the value of attribute deletion_time.
-
#id ⇒ Object
External account unique identifier.
-
#last_updated_time ⇒ Object
Returns the value of attribute last_updated_time.
-
#metadata ⇒ Object
User-supplied JSON format metadata.
-
#name ⇒ Object
The official name of the account.
-
#nickname ⇒ Object
A user-meaningful name for the account.
-
#routing_identifiers ⇒ Object
Returns the value of attribute routing_identifiers.
-
#status ⇒ Object
The current state of the account.
-
#type ⇒ Object
The type of the account.
-
#vendor_data ⇒ Object
Returns the value of attribute vendor_data.
-
#vendor_info ⇒ Object
Returns the value of attribute vendor_info.
-
#verification ⇒ Object
Returns the value of attribute verification.
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 = {}) ⇒ ExternalAccount
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 = {}) ⇒ ExternalAccount
Initializes the object
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 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 235 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 149 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `SyncteraRubySdk::ExternalAccount` 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::ExternalAccount`. 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_identifiers') self.account_identifiers = attributes[:'account_identifiers'] end if attributes.key?(:'account_owner_names') if (value = attributes[:'account_owner_names']).is_a?(Array) self.account_owner_names = value end end if attributes.key?(:'business_id') self.business_id = attributes[:'business_id'] end if attributes.key?(:'creation_time') self.creation_time = attributes[:'creation_time'] end if attributes.key?(:'currency') self.currency = attributes[:'currency'] end if attributes.key?(:'customer_id') self.customer_id = attributes[:'customer_id'] end if attributes.key?(:'deletion_time') self.deletion_time = attributes[:'deletion_time'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'last_updated_time') self.last_updated_time = attributes[:'last_updated_time'] end if attributes.key?(:'metadata') self. = attributes[:'metadata'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'nickname') self.nickname = attributes[:'nickname'] end if attributes.key?(:'routing_identifiers') self.routing_identifiers = attributes[:'routing_identifiers'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'vendor_data') self.vendor_data = attributes[:'vendor_data'] end if attributes.key?(:'vendor_info') self.vendor_info = attributes[:'vendor_info'] end if attributes.key?(:'verification') self.verification = attributes[:'verification'] end end |
Instance Attribute Details
#account_identifiers ⇒ Object
Returns the value of attribute account_identifiers.
18 19 20 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 18 def account_identifiers @account_identifiers end |
#account_owner_names ⇒ Object
The names of the account owners. Values may be masked, in which case the array will be empty.
21 22 23 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 21 def account_owner_names @account_owner_names end |
#business_id ⇒ Object
The identifier for the business customer associated with this external account. Exactly one of ‘business_id` or `customer_id` will be returned.
24 25 26 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 24 def business_id @business_id end |
#creation_time ⇒ Object
Returns the value of attribute creation_time.
26 27 28 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 26 def creation_time @creation_time end |
#currency ⇒ Object
ISO 4217 alphabetic currency code
29 30 31 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 29 def currency @currency end |
#customer_id ⇒ Object
The identifier for the personal customer associated with this external account. Exactly one of ‘customer_id` or `business_id` will be returned.
32 33 34 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 32 def customer_id @customer_id end |
#deletion_time ⇒ Object
Returns the value of attribute deletion_time.
34 35 36 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 34 def deletion_time @deletion_time end |
#id ⇒ Object
External account unique identifier
37 38 39 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 37 def id @id end |
#last_updated_time ⇒ Object
Returns the value of attribute last_updated_time.
39 40 41 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 39 def last_updated_time @last_updated_time end |
#metadata ⇒ Object
User-supplied JSON format metadata.
42 43 44 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 42 def end |
#name ⇒ Object
The official name of the account
45 46 47 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 45 def name @name end |
#nickname ⇒ Object
A user-meaningful name for the account
48 49 50 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 48 def nickname @nickname end |
#routing_identifiers ⇒ Object
Returns the value of attribute routing_identifiers.
50 51 52 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 50 def routing_identifiers @routing_identifiers end |
#status ⇒ Object
The current state of the account
53 54 55 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 53 def status @status end |
#type ⇒ Object
The type of the account
56 57 58 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 56 def type @type end |
#vendor_data ⇒ Object
Returns the value of attribute vendor_data.
58 59 60 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 58 def vendor_data @vendor_data end |
#vendor_info ⇒ Object
Returns the value of attribute vendor_info.
60 61 62 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 60 def vendor_info @vendor_info end |
#verification ⇒ Object
Returns the value of attribute verification.
62 63 64 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 62 def verification @verification end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
111 112 113 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 111 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 87 def self.attribute_map { :'account_identifiers' => :'account_identifiers', :'account_owner_names' => :'account_owner_names', :'business_id' => :'business_id', :'creation_time' => :'creation_time', :'currency' => :'currency', :'customer_id' => :'customer_id', :'deletion_time' => :'deletion_time', :'id' => :'id', :'last_updated_time' => :'last_updated_time', :'metadata' => :'metadata', :'name' => :'name', :'nickname' => :'nickname', :'routing_identifiers' => :'routing_identifiers', :'status' => :'status', :'type' => :'type', :'vendor_data' => :'vendor_data', :'vendor_info' => :'vendor_info', :'verification' => :'verification' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
371 372 373 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 371 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
140 141 142 143 144 145 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 140 def self.openapi_nullable Set.new([ :'nickname', :'verification' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 116 def self.openapi_types { :'account_identifiers' => :'AccountIdentifiers', :'account_owner_names' => :'Array<String>', :'business_id' => :'String', :'creation_time' => :'Time', :'currency' => :'String', :'customer_id' => :'String', :'deletion_time' => :'Time', :'id' => :'String', :'last_updated_time' => :'Time', :'metadata' => :'Object', :'name' => :'String', :'nickname' => :'String', :'routing_identifiers' => :'AccountRouting', :'status' => :'String', :'type' => :'String', :'vendor_data' => :'ExternalAccountVendorData', :'vendor_info' => :'VendorInfo', :'verification' => :'AccountVerification' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 333 def ==(o) return true if self.equal?(o) self.class == o.class && account_identifiers == o.account_identifiers && account_owner_names == o.account_owner_names && business_id == o.business_id && creation_time == o.creation_time && currency == o.currency && customer_id == o.customer_id && deletion_time == o.deletion_time && id == o.id && last_updated_time == o.last_updated_time && == o. && name == o.name && nickname == o.nickname && routing_identifiers == o.routing_identifiers && status == o.status && type == o.type && vendor_data == o.vendor_data && vendor_info == o.vendor_info && verification == o.verification end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 430 431 432 433 434 435 436 437 438 439 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 402 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
473 474 475 476 477 478 479 480 481 482 483 484 485 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 473 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
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 378 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
358 359 360 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 358 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
364 365 366 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 364 def hash [account_identifiers, account_owner_names, business_id, creation_time, currency, customer_id, deletion_time, id, last_updated_time, , name, nickname, routing_identifiers, status, type, vendor_data, vendor_info, verification].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 239 def list_invalid_properties invalid_properties = Array.new if @account_identifiers.nil? invalid_properties.push('invalid value for "account_identifiers", account_identifiers cannot be nil.') end if @account_owner_names.nil? invalid_properties.push('invalid value for "account_owner_names", account_owner_names cannot be nil.') end if @creation_time.nil? invalid_properties.push('invalid value for "creation_time", creation_time cannot be nil.') end pattern = Regexp.new(/^[A-Z]{3}$/) if !@currency.nil? && @currency !~ pattern invalid_properties.push("invalid value for \"currency\", must conform to the pattern #{pattern}.") end if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @last_updated_time.nil? invalid_properties.push('invalid value for "last_updated_time", last_updated_time cannot be nil.') end if @routing_identifiers.nil? invalid_properties.push('invalid value for "routing_identifiers", routing_identifiers cannot be nil.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end if @type.nil? invalid_properties.push('invalid value for "type", type cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
449 450 451 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 449 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
455 456 457 458 459 460 461 462 463 464 465 466 467 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 455 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
443 444 445 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 443 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 |
# File 'lib/synctera_ruby_sdk/models/external_account.rb', line 283 def valid? return false if @account_identifiers.nil? return false if @account_owner_names.nil? return false if @creation_time.nil? return false if !@currency.nil? && @currency !~ Regexp.new(/^[A-Z]{3}$/) return false if @id.nil? return false if @last_updated_time.nil? return false if @routing_identifiers.nil? return false if @status.nil? status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "CLOSED"]) return false unless status_validator.valid?(@status) return false if @type.nil? type_validator = EnumAttributeValidator.new('String', ["CHECKING", "SAVINGS", "CREDIT_CARD", "MONEY_MARKET", "INVESTMENT_529", "OTHER"]) return false unless type_validator.valid?(@type) true end |