Class: UnivapayClientSdk::BaseOnlineData

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/univapay_client_sdk/models/base_online_data.rb

Overview

Base Online Data schema.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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: SKIP, call_method: SKIP, os_type: SKIP, user_identifier: SKIP, user_identifier_source: SKIP, additional_properties: nil) ⇒ BaseOnlineData

Returns a new instance of BaseOnlineData.



64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/univapay_client_sdk/models/base_online_data.rb', line 64

def initialize(brand: SKIP, call_method: SKIP, 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 unless brand == SKIP
  @call_method = call_method unless call_method == SKIP
  @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

#brandBaseOnlineDataBrand

Base Online Data Brand schema.

Returns:



14
15
16
# File 'lib/univapay_client_sdk/models/base_online_data.rb', line 14

def brand
  @brand
end

#call_methodBaseOnlineDataCallMethod

Base Online Data Call Method schema.



18
19
20
# File 'lib/univapay_client_sdk/models/base_online_data.rb', line 18

def call_method
  @call_method
end

#os_typeBaseOnlineDataOsType

Base Online Data Os Type schema.



22
23
24
# File 'lib/univapay_client_sdk/models/base_online_data.rb', line 22

def os_type
  @os_type
end

#user_identifierString

Consumer specific identifier required by some gateways for fraud prevention.

Returns:

  • (String)


27
28
29
# File 'lib/univapay_client_sdk/models/base_online_data.rb', line 27

def user_identifier
  @user_identifier
end

#user_identifier_sourceBaseOnlineDataUserIdentifierSource

The source of the user identifier



31
32
33
# File 'lib/univapay_client_sdk/models/base_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.



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/univapay_client_sdk/models/base_online_data.rb', line 79

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  brand = hash.key?('brand') ? hash['brand'] : SKIP
  call_method = hash.key?('call_method') ? hash['call_method'] : SKIP
  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.
  BaseOnlineData.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

.namesObject

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/base_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

.nullablesObject

An array for nullable fields



56
57
58
59
60
61
62
# File 'lib/univapay_client_sdk/models/base_online_data.rb', line 56

def self.nullables
  %w[
    os_type
    user_identifier
    user_identifier_source
  ]
end

.optionalsObject

An array for optional fields



45
46
47
48
49
50
51
52
53
# File 'lib/univapay_client_sdk/models/base_online_data.rb', line 45

def self.optionals
  %w[
    brand
    call_method
    os_type
    user_identifier
    user_identifier_source
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



116
117
118
119
120
121
# File 'lib/univapay_client_sdk/models/base_online_data.rb', line 116

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_sObject

Provides a human-readable string representation of the object.



108
109
110
111
112
113
# File 'lib/univapay_client_sdk/models/base_online_data.rb', line 108

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