Class: SyncteraRubySdk::PatchCustomer
- Inherits:
-
Object
- Object
- SyncteraRubySdk::PatchCustomer
- Defined in:
- lib/synctera_ruby_sdk/models/patch_customer.rb
Overview
Customer object for patch purpose. All fields are optional
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#ban_status ⇒ Object
Returns the value of attribute ban_status.
-
#dob ⇒ Object
Customer’s date of birth in RFC 3339 full-date format (YYYY-MM-DD).
-
#email ⇒ Object
Customer’s email.
-
#first_name ⇒ Object
Customer’s first name.
-
#last_name ⇒ Object
Customer’s last name.
-
#legal_address ⇒ Object
Returns the value of attribute legal_address.
-
#metadata ⇒ Object
User-supplied JSON format metadata.
-
#middle_name ⇒ Object
Customer’s middle name.
-
#note ⇒ Object
Add an optional note when creating or updating a customer.
-
#phone_number ⇒ Object
Customer’s mobile phone number with country code in E.164 format.
-
#shipping_address ⇒ Object
Returns the value of attribute shipping_address.
-
#ssn ⇒ Object
Customer’s full tax ID eg SSN formatted with hyphens.
-
#status ⇒ Object
Customer’s status.
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 = {}) ⇒ PatchCustomer
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 = {}) ⇒ PatchCustomer
Initializes the object
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 185 186 187 188 189 190 191 192 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 128 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `SyncteraRubySdk::PatchCustomer` 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::PatchCustomer`. 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?(:'ban_status') self.ban_status = attributes[:'ban_status'] end if attributes.key?(:'dob') self.dob = attributes[:'dob'] end if attributes.key?(:'email') self.email = attributes[:'email'] end if attributes.key?(:'first_name') self.first_name = attributes[:'first_name'] end if attributes.key?(:'last_name') self.last_name = attributes[:'last_name'] end if attributes.key?(:'legal_address') self.legal_address = attributes[:'legal_address'] end if attributes.key?(:'metadata') self. = attributes[:'metadata'] end if attributes.key?(:'middle_name') self.middle_name = attributes[:'middle_name'] end if attributes.key?(:'note') self.note = attributes[:'note'] end if attributes.key?(:'phone_number') self.phone_number = attributes[:'phone_number'] end if attributes.key?(:'shipping_address') self.shipping_address = attributes[:'shipping_address'] end if attributes.key?(:'ssn') self.ssn = attributes[:'ssn'] end if attributes.key?(:'status') self.status = attributes[:'status'] end end |
Instance Attribute Details
#ban_status ⇒ Object
Returns the value of attribute ban_status.
19 20 21 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 19 def ban_status @ban_status end |
#dob ⇒ Object
Customer’s date of birth in RFC 3339 full-date format (YYYY-MM-DD)
22 23 24 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 22 def dob @dob end |
#email ⇒ Object
Customer’s email
25 26 27 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 25 def email @email end |
#first_name ⇒ Object
Customer’s first name
28 29 30 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 28 def first_name @first_name end |
#last_name ⇒ Object
Customer’s last name
31 32 33 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 31 def last_name @last_name end |
#legal_address ⇒ Object
Returns the value of attribute legal_address.
33 34 35 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 33 def legal_address @legal_address end |
#metadata ⇒ Object
User-supplied JSON format metadata. Do not use to store PII.
36 37 38 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 36 def @metadata end |
#middle_name ⇒ Object
Customer’s middle name
39 40 41 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 39 def middle_name @middle_name end |
#note ⇒ Object
Add an optional note when creating or updating a customer. A note is required when updating a customers’s ban_status between SUSPENDED and ALLOWED.
42 43 44 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 42 def note @note end |
#phone_number ⇒ Object
Customer’s mobile phone number with country code in E.164 format. Must have a valid country code. Area code and local phone number are not validated.
45 46 47 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 45 def phone_number @phone_number end |
#shipping_address ⇒ Object
Returns the value of attribute shipping_address.
47 48 49 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 47 def shipping_address @shipping_address end |
#ssn ⇒ Object
Customer’s full tax ID eg SSN formatted with hyphens. This optional parameter is required when running KYC on a customer. Must be compiled with ^\d3-\d2-\d4$. Response contains the last 4 digits only (e.g. 6789).
50 51 52 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 50 def ssn @ssn end |
#status ⇒ Object
Customer’s status
53 54 55 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 53 def status @status end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
97 98 99 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 97 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 78 def self.attribute_map { :'ban_status' => :'ban_status', :'dob' => :'dob', :'email' => :'email', :'first_name' => :'first_name', :'last_name' => :'last_name', :'legal_address' => :'legal_address', :'metadata' => :'metadata', :'middle_name' => :'middle_name', :'note' => :'note', :'phone_number' => :'phone_number', :'shipping_address' => :'shipping_address', :'ssn' => :'ssn', :'status' => :'status' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
271 272 273 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 271 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
121 122 123 124 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 121 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 102 def self.openapi_types { :'ban_status' => :'BanStatus', :'dob' => :'Date', :'email' => :'String', :'first_name' => :'String', :'last_name' => :'String', :'legal_address' => :'LegalAddress', :'metadata' => :'Object', :'middle_name' => :'String', :'note' => :'String', :'phone_number' => :'String', :'shipping_address' => :'ShippingAddress', :'ssn' => :'String', :'status' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 238 def ==(o) return true if self.equal?(o) self.class == o.class && ban_status == o.ban_status && dob == o.dob && email == o.email && first_name == o.first_name && last_name == o.last_name && legal_address == o.legal_address && == o. && middle_name == o.middle_name && note == o.note && phone_number == o.phone_number && shipping_address == o.shipping_address && ssn == o.ssn && status == o.status end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 302 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
373 374 375 376 377 378 379 380 381 382 383 384 385 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 373 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
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 278 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
258 259 260 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 258 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
264 265 266 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 264 def hash [ban_status, dob, email, first_name, last_name, legal_address, , middle_name, note, phone_number, shipping_address, ssn, status].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
196 197 198 199 200 201 202 203 204 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 196 def list_invalid_properties invalid_properties = Array.new pattern = Regexp.new(/^\+[1-9]\d{1,14}$/) if !@phone_number.nil? && @phone_number !~ pattern invalid_properties.push("invalid value for \"phone_number\", must conform to the pattern #{pattern}.") end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
349 350 351 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 349 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 355 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
343 344 345 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 343 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
208 209 210 211 212 213 |
# File 'lib/synctera_ruby_sdk/models/patch_customer.rb', line 208 def valid? return false if !@phone_number.nil? && @phone_number !~ Regexp.new(/^\+[1-9]\d{1,14}$/) status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "ESCHEAT", "DECEASED", "DENIED", "DORMANT", "FROZEN", "INACTIVE", "PROSPECT", "SANCTION"]) return false unless status_validator.valid?(@status) true end |