Class: UnivapayClientSdk::TokenCreateOnlineData
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UnivapayClientSdk::TokenCreateOnlineData
- Defined in:
- lib/univapay_client_sdk/models/token_create_online_data.rb
Overview
Token Create Online Data schema.
Instance Attribute Summary collapse
-
#brand ⇒ BaseOnlineDataBrand
Base Online Data Brand schema.
-
#call_method ⇒ BaseOnlineDataCallMethod
Base Online Data Call Method schema.
-
#os_type ⇒ BaseOnlineDataOsType
Base Online Data Os Type schema.
-
#user_identifier ⇒ String
Consumer specific identifier required by some gateways for fraud prevention.
-
#user_identifier_source ⇒ BaseOnlineDataUserIdentifierSource
The source of the user identifier.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(brand:, call_method:, os_type: SKIP, user_identifier: SKIP, user_identifier_source: SKIP, additional_properties: nil) ⇒ TokenCreateOnlineData
constructor
A new instance of TokenCreateOnlineData.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(brand:, call_method:, os_type: SKIP, user_identifier: SKIP, user_identifier_source: SKIP, additional_properties: nil) ⇒ TokenCreateOnlineData
Returns a new instance of TokenCreateOnlineData.
62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/univapay_client_sdk/models/token_create_online_data.rb', line 62 def initialize(brand:, call_method:, os_type: SKIP, user_identifier: SKIP, user_identifier_source: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @brand = brand @call_method = call_method @os_type = os_type unless os_type == SKIP @user_identifier = user_identifier unless user_identifier == SKIP @user_identifier_source = user_identifier_source unless user_identifier_source == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#brand ⇒ BaseOnlineDataBrand
Base Online Data Brand schema.
14 15 16 |
# File 'lib/univapay_client_sdk/models/token_create_online_data.rb', line 14 def brand @brand end |
#call_method ⇒ BaseOnlineDataCallMethod
Base Online Data Call Method schema.
18 19 20 |
# File 'lib/univapay_client_sdk/models/token_create_online_data.rb', line 18 def call_method @call_method end |
#os_type ⇒ BaseOnlineDataOsType
Base Online Data Os Type schema.
22 23 24 |
# File 'lib/univapay_client_sdk/models/token_create_online_data.rb', line 22 def os_type @os_type end |
#user_identifier ⇒ String
Consumer specific identifier required by some gateways for fraud prevention.
27 28 29 |
# File 'lib/univapay_client_sdk/models/token_create_online_data.rb', line 27 def user_identifier @user_identifier end |
#user_identifier_source ⇒ BaseOnlineDataUserIdentifierSource
The source of the user identifier
31 32 33 |
# File 'lib/univapay_client_sdk/models/token_create_online_data.rb', line 31 def user_identifier_source @user_identifier_source end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/univapay_client_sdk/models/token_create_online_data.rb', line 76 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. brand = hash.key?('brand') ? hash['brand'] : nil call_method = hash.key?('call_method') ? hash['call_method'] : nil os_type = hash.key?('os_type') ? hash['os_type'] : SKIP user_identifier = hash.key?('user_identifier') ? hash['user_identifier'] : SKIP user_identifier_source = hash.key?('user_identifier_source') ? hash['user_identifier_source'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. TokenCreateOnlineData.new(brand: brand, call_method: call_method, os_type: os_type, user_identifier: user_identifier, user_identifier_source: user_identifier_source, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 |
# File 'lib/univapay_client_sdk/models/token_create_online_data.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['brand'] = 'brand' @_hash['call_method'] = 'call_method' @_hash['os_type'] = 'os_type' @_hash['user_identifier'] = 'user_identifier' @_hash['user_identifier_source'] = 'user_identifier_source' @_hash end |
.nullables ⇒ Object
An array for nullable fields
54 55 56 57 58 59 60 |
# File 'lib/univapay_client_sdk/models/token_create_online_data.rb', line 54 def self.nullables %w[ os_type user_identifier user_identifier_source ] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 48 49 50 51 |
# File 'lib/univapay_client_sdk/models/token_create_online_data.rb', line 45 def self.optionals %w[ os_type user_identifier user_identifier_source ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/univapay_client_sdk/models/token_create_online_data.rb', line 106 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.brand, ->(val) { BaseOnlineDataBrand.validate(val) }) and APIHelper.valid_type?(value.call_method, ->(val) { BaseOnlineDataCallMethod.validate(val) }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['brand'], ->(val) { BaseOnlineDataBrand.validate(val) }) and APIHelper.valid_type?(value['call_method'], ->(val) { BaseOnlineDataCallMethod.validate(val) }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
135 136 137 138 139 140 |
# File 'lib/univapay_client_sdk/models/token_create_online_data.rb', line 135 def inspect class_name = self.class.name.split('::').last "<#{class_name} brand: #{@brand.inspect}, call_method: #{@call_method.inspect}, os_type:"\ " #{@os_type.inspect}, user_identifier: #{@user_identifier.inspect}, user_identifier_source:"\ " #{@user_identifier_source.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
127 128 129 130 131 132 |
# File 'lib/univapay_client_sdk/models/token_create_online_data.rb', line 127 def to_s class_name = self.class.name.split('::').last "<#{class_name} brand: #{@brand}, call_method: #{@call_method}, os_type: #{@os_type},"\ " user_identifier: #{@user_identifier}, user_identifier_source: #{@user_identifier_source},"\ " additional_properties: #{@additional_properties}>" end |