Class: SyncteraRubySdk::AddAccountsRequest
- Inherits:
-
Object
- Object
- SyncteraRubySdk::AddAccountsRequest
- Defined in:
- lib/synctera_ruby_sdk/models/add_accounts_request.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.
-
#currency ⇒ Object
ISO 4217 alphabetic currency code.
-
#customer_id ⇒ Object
The identifier for the personal customer associated with this external account.
-
#customer_type ⇒ Object
Returns the value of attribute customer_type.
-
#metadata ⇒ Object
User-supplied metadata.
-
#nickname ⇒ Object
A user-meaningful name for the account.
-
#routing_identifiers ⇒ Object
Returns the value of attribute routing_identifiers.
-
#type ⇒ Object
The type of the account.
-
#vendor_account_id ⇒ Object
The ID of the vendor account, will be empty for MANUAL vendor.
-
#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 = {}) ⇒ AddAccountsRequest
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 = {}) ⇒ AddAccountsRequest
Initializes the object
122 123 124 125 126 127 128 129 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 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 122 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `SyncteraRubySdk::AddAccountsRequest` 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::AddAccountsRequest`. 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?(:'currency') self.currency = attributes[:'currency'] end if attributes.key?(:'customer_id') self.customer_id = attributes[:'customer_id'] end if attributes.key?(:'customer_type') self.customer_type = attributes[:'customer_type'] end if attributes.key?(:'metadata') self. = attributes[:'metadata'] 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?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'vendor_account_id') self.vendor_account_id = attributes[:'vendor_account_id'] 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/add_accounts_request.rb', line 18 def account_identifiers @account_identifiers end |
#account_owner_names ⇒ Object
The names of the account owners.
21 22 23 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.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` must be specified.
24 25 26 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 24 def business_id @business_id end |
#currency ⇒ Object
ISO 4217 alphabetic currency code
27 28 29 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 27 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` must be specified.
30 31 32 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 30 def customer_id @customer_id end |
#customer_type ⇒ Object
Returns the value of attribute customer_type.
32 33 34 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 32 def customer_type @customer_type end |
#metadata ⇒ Object
User-supplied metadata
35 36 37 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 35 def @metadata end |
#nickname ⇒ Object
A user-meaningful name for the account
38 39 40 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 38 def nickname @nickname end |
#routing_identifiers ⇒ Object
Returns the value of attribute routing_identifiers.
40 41 42 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 40 def routing_identifiers @routing_identifiers end |
#type ⇒ Object
The type of the account
43 44 45 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 43 def type @type end |
#vendor_account_id ⇒ Object
The ID of the vendor account, will be empty for MANUAL vendor
46 47 48 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 46 def vendor_account_id @vendor_account_id end |
#verification ⇒ Object
Returns the value of attribute verification.
48 49 50 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 48 def verification @verification end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
91 92 93 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 91 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 73 def self.attribute_map { :'account_identifiers' => :'account_identifiers', :'account_owner_names' => :'account_owner_names', :'business_id' => :'business_id', :'currency' => :'currency', :'customer_id' => :'customer_id', :'customer_type' => :'customer_type', :'metadata' => :'metadata', :'nickname' => :'nickname', :'routing_identifiers' => :'routing_identifiers', :'type' => :'type', :'vendor_account_id' => :'vendor_account_id', :'verification' => :'verification' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
336 337 338 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 336 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
114 115 116 117 118 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 114 def self.openapi_nullable Set.new([ :'verification' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 96 def self.openapi_types { :'account_identifiers' => :'AddAccountsRequestAccountIdentifiers', :'account_owner_names' => :'Array<String>', :'business_id' => :'String', :'currency' => :'String', :'customer_id' => :'String', :'customer_type' => :'ExtAccountCustomerType', :'metadata' => :'Object', :'nickname' => :'String', :'routing_identifiers' => :'AddAccountsRequestRoutingIdentifiers', :'type' => :'String', :'vendor_account_id' => :'String', :'verification' => :'AccountVerification' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 304 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 && currency == o.currency && customer_id == o.customer_id && customer_type == o.customer_type && == o. && nickname == o.nickname && routing_identifiers == o.routing_identifiers && type == o.type && vendor_account_id == o.vendor_account_id && verification == o.verification end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 367 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
438 439 440 441 442 443 444 445 446 447 448 449 450 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 438 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
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 343 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
323 324 325 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 323 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
329 330 331 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 329 def hash [account_identifiers, account_owner_names, business_id, currency, customer_id, customer_type, , nickname, routing_identifiers, type, vendor_account_id, verification].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 188 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 @account_owner_names.length < 1 invalid_properties.push('invalid value for "account_owner_names", number of items must be greater than or equal to 1.') 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 @customer_type.nil? invalid_properties.push('invalid value for "customer_type", customer_type cannot be nil.') end if !@nickname.nil? && @nickname.to_s.length < 1 invalid_properties.push('invalid value for "nickname", the character length must be great than or equal to 1.') end if @routing_identifiers.nil? invalid_properties.push('invalid value for "routing_identifiers", routing_identifiers cannot be nil.') end if @type.nil? invalid_properties.push('invalid value for "type", type cannot be nil.') end if !@vendor_account_id.nil? && @vendor_account_id.to_s.length < 1 invalid_properties.push('invalid value for "vendor_account_id", the character length must be great than or equal to 1.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
414 415 416 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 414 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
420 421 422 423 424 425 426 427 428 429 430 431 432 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 420 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
408 409 410 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 408 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/synctera_ruby_sdk/models/add_accounts_request.rb', line 232 def valid? return false if @account_identifiers.nil? return false if @account_owner_names.nil? return false if @account_owner_names.length < 1 return false if !@currency.nil? && @currency !~ Regexp.new(/^[A-Z]{3}$/) return false if @customer_type.nil? return false if !@nickname.nil? && @nickname.to_s.length < 1 return false if @routing_identifiers.nil? return false if @type.nil? type_validator = EnumAttributeValidator.new('String', ["CHECKING", "SAVINGS"]) return false unless type_validator.valid?(@type) return false if !@vendor_account_id.nil? && @vendor_account_id.to_s.length < 1 true end |