Class: UnivapayClientSdk::TokenResponseCardDataCard

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

Overview

Token Response Card Data Card 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(cardholder: SKIP, exp_month: SKIP, exp_year: SKIP, card_bin: SKIP, last_four: SKIP, brand: SKIP, card_type: SKIP, country: SKIP, category: SKIP, issuer: SKIP, sub_brand: SKIP, additional_properties: nil) ⇒ TokenResponseCardDataCard

Returns a new instance of TokenResponseCardDataCard.



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 98

def initialize(cardholder: SKIP, exp_month: SKIP, exp_year: SKIP,
               card_bin: SKIP, last_four: SKIP, brand: SKIP,
               card_type: SKIP, country: SKIP, category: SKIP, issuer: SKIP,
               sub_brand: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @cardholder = cardholder unless cardholder == SKIP
  @exp_month = exp_month unless exp_month == SKIP
  @exp_year = exp_year unless exp_year == SKIP
  @card_bin = card_bin unless card_bin == SKIP
  @last_four = last_four unless last_four == SKIP
  @brand = brand unless brand == SKIP
  @card_type = card_type unless card_type == SKIP
  @country = country unless country == SKIP
  @category = category unless category == SKIP
  @issuer = issuer unless issuer == SKIP
  @sub_brand = sub_brand unless sub_brand == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#brandString

Brand or network name.

Returns:

  • (String)


34
35
36
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 34

def brand
  @brand
end

#card_binString

Card bin value.

Returns:

  • (String)


26
27
28
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 26

def card_bin
  @card_bin
end

#card_typeString

Card type value.

Returns:

  • (String)


38
39
40
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 38

def card_type
  @card_type
end

#cardholderString

Cardholder name.

Returns:

  • (String)


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

def cardholder
  @cardholder
end

#categoryString

Category value.

Returns:

  • (String)


46
47
48
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 46

def category
  @category
end

#countryString

Country code.

Returns:

  • (String)


42
43
44
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 42

def country
  @country
end

#exp_monthInteger

Card expiration month.

Returns:

  • (Integer)


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

def exp_month
  @exp_month
end

#exp_yearInteger

Card expiration year.

Returns:

  • (Integer)


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

def exp_year
  @exp_year
end

#issuerString

Issuer value.

Returns:

  • (String)


50
51
52
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 50

def issuer
  @issuer
end

#last_fourString

Last four value.

Returns:

  • (String)


30
31
32
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 30

def last_four
  @last_four
end

#sub_brandString

Sub brand value.

Returns:

  • (String)


54
55
56
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 54

def sub_brand
  @sub_brand
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



120
121
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
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 120

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  cardholder = hash.key?('cardholder') ? hash['cardholder'] : SKIP
  exp_month = hash.key?('exp_month') ? hash['exp_month'] : SKIP
  exp_year = hash.key?('exp_year') ? hash['exp_year'] : SKIP
  card_bin = hash.key?('card_bin') ? hash['card_bin'] : SKIP
  last_four = hash.key?('last_four') ? hash['last_four'] : SKIP
  brand = hash.key?('brand') ? hash['brand'] : SKIP
  card_type = hash.key?('card_type') ? hash['card_type'] : SKIP
  country = hash.key?('country') ? hash['country'] : SKIP
  category = hash.key?('category') ? hash['category'] : SKIP
  issuer = hash.key?('issuer') ? hash['issuer'] : SKIP
  sub_brand = hash.key?('sub_brand') ? hash['sub_brand'] : 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.
  TokenResponseCardDataCard.new(cardholder: cardholder,
                                exp_month: exp_month,
                                exp_year: exp_year,
                                card_bin: card_bin,
                                last_four: last_four,
                                brand: brand,
                                card_type: card_type,
                                country: country,
                                category: category,
                                issuer: issuer,
                                sub_brand: sub_brand,
                                additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 57

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['cardholder'] = 'cardholder'
  @_hash['exp_month'] = 'exp_month'
  @_hash['exp_year'] = 'exp_year'
  @_hash['card_bin'] = 'card_bin'
  @_hash['last_four'] = 'last_four'
  @_hash['brand'] = 'brand'
  @_hash['card_type'] = 'card_type'
  @_hash['country'] = 'country'
  @_hash['category'] = 'category'
  @_hash['issuer'] = 'issuer'
  @_hash['sub_brand'] = 'sub_brand'
  @_hash
end

.nullablesObject

An array for nullable fields



91
92
93
94
95
96
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 91

def self.nullables
  %w[
    category
    issuer
  ]
end

.optionalsObject

An array for optional fields



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 74

def self.optionals
  %w[
    cardholder
    exp_month
    exp_year
    card_bin
    last_four
    brand
    card_type
    country
    category
    issuer
    sub_brand
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



160
161
162
163
164
165
166
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 160

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



178
179
180
181
182
183
184
185
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 178

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} cardholder: #{@cardholder.inspect}, exp_month: #{@exp_month.inspect},"\
  " exp_year: #{@exp_year.inspect}, card_bin: #{@card_bin.inspect}, last_four:"\
  " #{@last_four.inspect}, brand: #{@brand.inspect}, card_type: #{@card_type.inspect},"\
  " country: #{@country.inspect}, category: #{@category.inspect}, issuer: #{@issuer.inspect},"\
  " sub_brand: #{@sub_brand.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



169
170
171
172
173
174
175
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 169

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} cardholder: #{@cardholder}, exp_month: #{@exp_month}, exp_year:"\
  " #{@exp_year}, card_bin: #{@card_bin}, last_four: #{@last_four}, brand: #{@brand},"\
  " card_type: #{@card_type}, country: #{@country}, category: #{@category}, issuer:"\
  " #{@issuer}, sub_brand: #{@sub_brand}, additional_properties: #{@additional_properties}>"
end