Class: AlogramPayRisk::EntityIds
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- AlogramPayRisk::EntityIds
- Defined in:
- lib/alogram_payrisk/models/entity_ids.rb
Overview
Canonical entity identifiers (tenant/client/user/device/session). Do not send raw PII. Hash emails/phones/addresses as sha256 and prefix with ‘sha256_’. Tiered support: - tenantId is the top-level SaaS customer (required for all flows). - clientId is the tenant’s downstream business customer (e.g. merchant/partner) and MAY be omitted for processor / bank / PSP-style integrations. - endCustomerId is the tenant/client’s consumer or business account (cardholder, shopper, etc.) and MAY be omitted for purely device- or instrument-level checks.
Instance Attribute Summary collapse
-
#agent ⇒ Object
Returns the value of attribute agent.
-
#auth ⇒ Object
Returns the value of attribute auth.
-
#billing_address_hash ⇒ Object
Normalized+lowercased billing address hash (e.g., sha256).
-
#client_id ⇒ Object
Canonical ID for the Tenant’s business customer (e.g., merchant/partner).
-
#device_id ⇒ Object
Server-issued stable device token (device-level identifier).
-
#email_domain_hash ⇒ Object
Normalized+lowercased email domain hash (e.g., sha256).
-
#email_hash ⇒ Object
Normalized+lowercased email hash (e.g., sha256).
-
#end_customer_id ⇒ Object
Canonical ID for the client’s end user / consumer (account holder).
-
#operator_id ⇒ Object
Canonical ID for a Tenant Operator (staff/automation) holding membership in the platform.
-
#payment_instrument_id ⇒ Object
Tokenized instrument ID (non-PCI).
-
#phone_hash ⇒ Object
Normalized+lowercased phone hash (e.g., sha256).
-
#session_id ⇒ Object
Application/user session identifier (login or checkout session).
-
#shipping_address_hash ⇒ Object
Normalized+lowercased shipping address hash (e.g., sha256).
-
#sku_handle ⇒ Object
Human-readable identifier for a SKU, used for logic and feature checks.
-
#sku_id ⇒ Object
Canonical ID for a marketplace product edition or billing SKU.
-
#tenant_id ⇒ Object
Canonical ID for the paying organization (Tenant).
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 = {}) ⇒ EntityIds
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 = {}) ⇒ EntityIds
Initializes the object
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 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 127 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `AlogramPayRisk::EntityIds` 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 `AlogramPayRisk::EntityIds`. 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?(:'tenant_id') self.tenant_id = attributes[:'tenant_id'] end if attributes.key?(:'client_id') self.client_id = attributes[:'client_id'] end if attributes.key?(:'end_customer_id') self.end_customer_id = attributes[:'end_customer_id'] end if attributes.key?(:'operator_id') self.operator_id = attributes[:'operator_id'] end if attributes.key?(:'auth') self.auth = attributes[:'auth'] end if attributes.key?(:'sku_id') self.sku_id = attributes[:'sku_id'] end if attributes.key?(:'sku_handle') self.sku_handle = attributes[:'sku_handle'] end if attributes.key?(:'payment_instrument_id') self.payment_instrument_id = attributes[:'payment_instrument_id'] end if attributes.key?(:'device_id') self.device_id = attributes[:'device_id'] end if attributes.key?(:'session_id') self.session_id = attributes[:'session_id'] end if attributes.key?(:'agent') self.agent = attributes[:'agent'] end if attributes.key?(:'email_hash') self.email_hash = attributes[:'email_hash'] end if attributes.key?(:'email_domain_hash') self.email_domain_hash = attributes[:'email_domain_hash'] end if attributes.key?(:'phone_hash') self.phone_hash = attributes[:'phone_hash'] end if attributes.key?(:'shipping_address_hash') self.shipping_address_hash = attributes[:'shipping_address_hash'] end if attributes.key?(:'billing_address_hash') self.billing_address_hash = attributes[:'billing_address_hash'] end end |
Instance Attribute Details
#agent ⇒ Object
Returns the value of attribute agent.
48 49 50 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 48 def agent @agent end |
#auth ⇒ Object
Returns the value of attribute auth.
31 32 33 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 31 def auth @auth end |
#billing_address_hash ⇒ Object
Normalized+lowercased billing address hash (e.g., sha256).
63 64 65 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 63 def billing_address_hash @billing_address_hash end |
#client_id ⇒ Object
Canonical ID for the Tenant’s business customer (e.g., merchant/partner). Opaque, immutable, lowercase. Must start with "cid_" (Legacy) or "cli_" (Preferred).
23 24 25 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 23 def client_id @client_id end |
#device_id ⇒ Object
Server-issued stable device token (device-level identifier). Should persist across sessions and logins on the same browser/device.
43 44 45 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 43 def device_id @device_id end |
#email_domain_hash ⇒ Object
Normalized+lowercased email domain hash (e.g., sha256).
54 55 56 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 54 def email_domain_hash @email_domain_hash end |
#email_hash ⇒ Object
Normalized+lowercased email hash (e.g., sha256).
51 52 53 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 51 def email_hash @email_hash end |
#end_customer_id ⇒ Object
Canonical ID for the client’s end user / consumer (account holder). Opaque, immutable, lowercase. Supports "ecid_" slugs (Legacy) or "cus_" hex (Preferred).
26 27 28 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 26 def end_customer_id @end_customer_id end |
#operator_id ⇒ Object
Canonical ID for a Tenant Operator (staff/automation) holding membership in the platform. Opaque, immutable, lowercase. Supports "mid_" slugs (Legacy) or "op_" hex (Preferred).
29 30 31 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 29 def operator_id @operator_id end |
#payment_instrument_id ⇒ Object
Tokenized instrument ID (non-PCI).
40 41 42 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 40 def payment_instrument_id @payment_instrument_id end |
#phone_hash ⇒ Object
Normalized+lowercased phone hash (e.g., sha256).
57 58 59 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 57 def phone_hash @phone_hash end |
#session_id ⇒ Object
Application/user session identifier (login or checkout session). Typically rotates more frequently than deviceId and may be tied to authentication.
46 47 48 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 46 def session_id @session_id end |
#shipping_address_hash ⇒ Object
Normalized+lowercased shipping address hash (e.g., sha256).
60 61 62 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 60 def shipping_address_hash @shipping_address_hash end |
#sku_handle ⇒ Object
Human-readable identifier for a SKU, used for logic and feature checks.
37 38 39 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 37 def sku_handle @sku_handle end |
#sku_id ⇒ Object
Canonical ID for a marketplace product edition or billing SKU. Always follows the Fortress-36 (sku_ + 32 hex) format.
34 35 36 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 34 def sku_id @sku_id end |
#tenant_id ⇒ Object
Canonical ID for the paying organization (Tenant). Opaque, immutable, lowercase. Must start with "tid_" (Legacy) or "ten_" (Preferred).
20 21 22 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 20 def tenant_id @tenant_id end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
88 89 90 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 88 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
93 94 95 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 93 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 66 def self.attribute_map { :'tenant_id' => :'tenantId', :'client_id' => :'clientId', :'end_customer_id' => :'endCustomerId', :'operator_id' => :'operatorId', :'auth' => :'auth', :'sku_id' => :'skuId', :'sku_handle' => :'skuHandle', :'payment_instrument_id' => :'paymentInstrumentId', :'device_id' => :'deviceId', :'session_id' => :'sessionId', :'agent' => :'agent', :'email_hash' => :'emailHash', :'email_domain_hash' => :'emailDomainHash', :'phone_hash' => :'phoneHash', :'shipping_address_hash' => :'shippingAddressHash', :'billing_address_hash' => :'billingAddressHash' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 677 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
120 121 122 123 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 120 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 98 def self.openapi_types { :'tenant_id' => :'String', :'client_id' => :'String', :'end_customer_id' => :'String', :'operator_id' => :'String', :'auth' => :'AuthContext', :'sku_id' => :'String', :'sku_handle' => :'String', :'payment_instrument_id' => :'String', :'device_id' => :'String', :'session_id' => :'String', :'agent' => :'AgentManifest', :'email_hash' => :'String', :'email_domain_hash' => :'String', :'phone_hash' => :'String', :'shipping_address_hash' => :'String', :'billing_address_hash' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 641 def ==(o) return true if self.equal?(o) self.class == o.class && tenant_id == o.tenant_id && client_id == o.client_id && end_customer_id == o.end_customer_id && operator_id == o.operator_id && auth == o.auth && sku_id == o.sku_id && sku_handle == o.sku_handle && payment_instrument_id == o.payment_instrument_id && device_id == o.device_id && session_id == o.session_id && agent == o.agent && email_hash == o.email_hash && email_domain_hash == o.email_domain_hash && phone_hash == o.phone_hash && shipping_address_hash == o.shipping_address_hash && billing_address_hash == o.billing_address_hash end |
#eql?(o) ⇒ Boolean
664 665 666 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 664 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
670 671 672 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 670 def hash [tenant_id, client_id, end_customer_id, operator_id, auth, sku_id, sku_handle, payment_instrument_id, device_id, session_id, agent, email_hash, email_domain_hash, phone_hash, shipping_address_hash, billing_address_hash].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 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 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 208 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if !@tenant_id.nil? && @tenant_id.to_s.length > 68 invalid_properties.push('invalid value for "tenant_id", the character length must be smaller than or equal to 68.') end if !@tenant_id.nil? && @tenant_id.to_s.length < 6 invalid_properties.push('invalid value for "tenant_id", the character length must be greater than or equal to 6.') end pattern = Regexp.new(/^(tid|ten)_[a-z0-9_-]{2,64}$/) if !@tenant_id.nil? && @tenant_id !~ pattern invalid_properties.push("invalid value for \"tenant_id\", must conform to the pattern #{pattern}.") end if !@client_id.nil? && @client_id.to_s.length > 100 invalid_properties.push('invalid value for "client_id", the character length must be smaller than or equal to 100.') end if !@client_id.nil? && @client_id.to_s.length < 6 invalid_properties.push('invalid value for "client_id", the character length must be greater than or equal to 6.') end pattern = Regexp.new(/^(cid|cli)_[a-z0-9_-]{2,96}$/) if !@client_id.nil? && @client_id !~ pattern invalid_properties.push("invalid value for \"client_id\", must conform to the pattern #{pattern}.") end if !@end_customer_id.nil? && @end_customer_id.to_s.length > 100 invalid_properties.push('invalid value for "end_customer_id", the character length must be smaller than or equal to 100.') end if !@end_customer_id.nil? && @end_customer_id.to_s.length < 6 invalid_properties.push('invalid value for "end_customer_id", the character length must be greater than or equal to 6.') end pattern = Regexp.new(/^(ecid_[a-z0-9\-_]{2,96}|cus_[a-f0-9]{32})$/) if !@end_customer_id.nil? && @end_customer_id !~ pattern invalid_properties.push("invalid value for \"end_customer_id\", must conform to the pattern #{pattern}.") end if !@operator_id.nil? && @operator_id.to_s.length > 100 invalid_properties.push('invalid value for "operator_id", the character length must be smaller than or equal to 100.') end if !@operator_id.nil? && @operator_id.to_s.length < 5 invalid_properties.push('invalid value for "operator_id", the character length must be greater than or equal to 5.') end pattern = Regexp.new(/^(mid_[a-z0-9_-]{2,96}|op_[a-f0-9]{32})$/) if !@operator_id.nil? && @operator_id !~ pattern invalid_properties.push("invalid value for \"operator_id\", must conform to the pattern #{pattern}.") end if !@sku_id.nil? && @sku_id.to_s.length > 37 invalid_properties.push('invalid value for "sku_id", the character length must be smaller than or equal to 37.') end if !@sku_id.nil? && @sku_id.to_s.length < 36 invalid_properties.push('invalid value for "sku_id", the character length must be greater than or equal to 36.') end pattern = Regexp.new(/^sku_[a-f0-9]{32}$/) if !@sku_id.nil? && @sku_id !~ pattern invalid_properties.push("invalid value for \"sku_id\", must conform to the pattern #{pattern}.") end if !@sku_handle.nil? && @sku_handle.to_s.length > 64 invalid_properties.push('invalid value for "sku_handle", the character length must be smaller than or equal to 64.') end if !@sku_handle.nil? && @sku_handle.to_s.length < 2 invalid_properties.push('invalid value for "sku_handle", the character length must be greater than or equal to 2.') end pattern = Regexp.new(/^[a-z0-9\-_]{2,64}$/) if !@sku_handle.nil? && @sku_handle !~ pattern invalid_properties.push("invalid value for \"sku_handle\", must conform to the pattern #{pattern}.") end if !@payment_instrument_id.nil? && @payment_instrument_id.to_s.length > 100 invalid_properties.push('invalid value for "payment_instrument_id", the character length must be smaller than or equal to 100.') end pattern = Regexp.new(/^[a-zA-Z0-9\-_:]{2,96}$/) if !@payment_instrument_id.nil? && @payment_instrument_id !~ pattern invalid_properties.push("invalid value for \"payment_instrument_id\", must conform to the pattern #{pattern}.") end if !@device_id.nil? && @device_id.to_s.length > 100 invalid_properties.push('invalid value for "device_id", the character length must be smaller than or equal to 100.') end pattern = Regexp.new(/^did_[a-zA-Z0-9\-_:]{2,96}$/) if !@device_id.nil? && @device_id !~ pattern invalid_properties.push("invalid value for \"device_id\", must conform to the pattern #{pattern}.") end if !@session_id.nil? && @session_id.to_s.length > 100 invalid_properties.push('invalid value for "session_id", the character length must be smaller than or equal to 100.') end pattern = Regexp.new(/^sid_[a-zA-Z0-9\-_:]{2,96}$/) if !@session_id.nil? && @session_id !~ pattern invalid_properties.push("invalid value for \"session_id\", must conform to the pattern #{pattern}.") end if !@email_hash.nil? && @email_hash.to_s.length > 71 invalid_properties.push('invalid value for "email_hash", the character length must be smaller than or equal to 71.') end pattern = Regexp.new(/^sha256_[0-9a-f]{64}$/) if !@email_hash.nil? && @email_hash !~ pattern invalid_properties.push("invalid value for \"email_hash\", must conform to the pattern #{pattern}.") end if !@email_domain_hash.nil? && @email_domain_hash.to_s.length > 71 invalid_properties.push('invalid value for "email_domain_hash", the character length must be smaller than or equal to 71.') end pattern = Regexp.new(/^sha256_[0-9a-f]{64}$/) if !@email_domain_hash.nil? && @email_domain_hash !~ pattern invalid_properties.push("invalid value for \"email_domain_hash\", must conform to the pattern #{pattern}.") end if !@phone_hash.nil? && @phone_hash.to_s.length > 71 invalid_properties.push('invalid value for "phone_hash", the character length must be smaller than or equal to 71.') end pattern = Regexp.new(/^sha256_[0-9a-f]{64}$/) if !@phone_hash.nil? && @phone_hash !~ pattern invalid_properties.push("invalid value for \"phone_hash\", must conform to the pattern #{pattern}.") end if !@shipping_address_hash.nil? && @shipping_address_hash.to_s.length > 71 invalid_properties.push('invalid value for "shipping_address_hash", the character length must be smaller than or equal to 71.') end pattern = Regexp.new(/^sha256_[0-9a-f]{64}$/) if !@shipping_address_hash.nil? && @shipping_address_hash !~ pattern invalid_properties.push("invalid value for \"shipping_address_hash\", must conform to the pattern #{pattern}.") end if !@billing_address_hash.nil? && @billing_address_hash.to_s.length > 71 invalid_properties.push('invalid value for "billing_address_hash", the character length must be smaller than or equal to 71.') end pattern = Regexp.new(/^sha256_[0-9a-f]{64}$/) if !@billing_address_hash.nil? && @billing_address_hash !~ pattern invalid_properties.push("invalid value for \"billing_address_hash\", must conform to the pattern #{pattern}.") end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
699 700 701 702 703 704 705 706 707 708 709 710 711 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 699 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
366 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 |
# File 'lib/alogram_payrisk/models/entity_ids.rb', line 366 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@tenant_id.nil? && @tenant_id.to_s.length > 68 return false if !@tenant_id.nil? && @tenant_id.to_s.length < 6 return false if !@tenant_id.nil? && @tenant_id !~ Regexp.new(/^(tid|ten)_[a-z0-9_-]{2,64}$/) return false if !@client_id.nil? && @client_id.to_s.length > 100 return false if !@client_id.nil? && @client_id.to_s.length < 6 return false if !@client_id.nil? && @client_id !~ Regexp.new(/^(cid|cli)_[a-z0-9_-]{2,96}$/) return false if !@end_customer_id.nil? && @end_customer_id.to_s.length > 100 return false if !@end_customer_id.nil? && @end_customer_id.to_s.length < 6 return false if !@end_customer_id.nil? && @end_customer_id !~ Regexp.new(/^(ecid_[a-z0-9\-_]{2,96}|cus_[a-f0-9]{32})$/) return false if !@operator_id.nil? && @operator_id.to_s.length > 100 return false if !@operator_id.nil? && @operator_id.to_s.length < 5 return false if !@operator_id.nil? && @operator_id !~ Regexp.new(/^(mid_[a-z0-9_-]{2,96}|op_[a-f0-9]{32})$/) return false if !@sku_id.nil? && @sku_id.to_s.length > 37 return false if !@sku_id.nil? && @sku_id.to_s.length < 36 return false if !@sku_id.nil? && @sku_id !~ Regexp.new(/^sku_[a-f0-9]{32}$/) return false if !@sku_handle.nil? && @sku_handle.to_s.length > 64 return false if !@sku_handle.nil? && @sku_handle.to_s.length < 2 return false if !@sku_handle.nil? && @sku_handle !~ Regexp.new(/^[a-z0-9\-_]{2,64}$/) return false if !@payment_instrument_id.nil? && @payment_instrument_id.to_s.length > 100 return false if !@payment_instrument_id.nil? && @payment_instrument_id !~ Regexp.new(/^[a-zA-Z0-9\-_:]{2,96}$/) return false if !@device_id.nil? && @device_id.to_s.length > 100 return false if !@device_id.nil? && @device_id !~ Regexp.new(/^did_[a-zA-Z0-9\-_:]{2,96}$/) return false if !@session_id.nil? && @session_id.to_s.length > 100 return false if !@session_id.nil? && @session_id !~ Regexp.new(/^sid_[a-zA-Z0-9\-_:]{2,96}$/) return false if !@email_hash.nil? && @email_hash.to_s.length > 71 return false if !@email_hash.nil? && @email_hash !~ Regexp.new(/^sha256_[0-9a-f]{64}$/) return false if !@email_domain_hash.nil? && @email_domain_hash.to_s.length > 71 return false if !@email_domain_hash.nil? && @email_domain_hash !~ Regexp.new(/^sha256_[0-9a-f]{64}$/) return false if !@phone_hash.nil? && @phone_hash.to_s.length > 71 return false if !@phone_hash.nil? && @phone_hash !~ Regexp.new(/^sha256_[0-9a-f]{64}$/) return false if !@shipping_address_hash.nil? && @shipping_address_hash.to_s.length > 71 return false if !@shipping_address_hash.nil? && @shipping_address_hash !~ Regexp.new(/^sha256_[0-9a-f]{64}$/) return false if !@billing_address_hash.nil? && @billing_address_hash.to_s.length > 71 return false if !@billing_address_hash.nil? && @billing_address_hash !~ Regexp.new(/^sha256_[0-9a-f]{64}$/) true end |