Class: UnivapayClientSdk::TokenResponseCardDataCard
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UnivapayClientSdk::TokenResponseCardDataCard
- Defined in:
- lib/univapay_client_sdk/models/token_response_card_data_card.rb
Overview
Token Response Card Data Card schema.
Instance Attribute Summary collapse
-
#brand ⇒ String
Brand or network name.
-
#card_bin ⇒ String
Card bin value.
-
#card_type ⇒ String
Card type value.
-
#cardholder ⇒ String
Cardholder name.
-
#category ⇒ String
Category value.
-
#country ⇒ String
Country code.
-
#exp_month ⇒ Integer
Card expiration month.
-
#exp_year ⇒ Integer
Card expiration year.
-
#issuer ⇒ String
Issuer value.
-
#last_four ⇒ String
Last four value.
-
#sub_brand ⇒ String
Sub brand value.
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(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
constructor
A new instance of TokenResponseCardDataCard.
-
#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(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
#brand ⇒ String
Brand or network name.
34 35 36 |
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 34 def brand @brand end |
#card_bin ⇒ String
Card bin value.
26 27 28 |
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 26 def card_bin @card_bin end |
#card_type ⇒ String
Card type value.
38 39 40 |
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 38 def card_type @card_type end |
#cardholder ⇒ String
Cardholder name.
14 15 16 |
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 14 def cardholder @cardholder end |
#category ⇒ String
Category value.
46 47 48 |
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 46 def category @category end |
#country ⇒ String
Country code.
42 43 44 |
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 42 def country @country end |
#exp_month ⇒ Integer
Card expiration month.
18 19 20 |
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 18 def exp_month @exp_month end |
#exp_year ⇒ Integer
Card expiration year.
22 23 24 |
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 22 def exp_year @exp_year end |
#issuer ⇒ String
Issuer value.
50 51 52 |
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 50 def issuer @issuer end |
#last_four ⇒ String
Last four value.
30 31 32 |
# File 'lib/univapay_client_sdk/models/token_response_card_data_card.rb', line 30 def last_four @last_four end |
#sub_brand ⇒ String
Sub brand value.
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 |
.names ⇒ Object
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 |
.nullables ⇒ Object
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 |
.optionals ⇒ Object
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.
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
#inspect ⇒ Object
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_s ⇒ Object
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 |