Class: UnivapayClientSdk::TokenResponseCardDataBilling

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

Overview

Token Response Card Data Billing 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(line1: SKIP, line2: SKIP, state: SKIP, city: SKIP, country: SKIP, zip: SKIP, phone_number: SKIP, additional_properties: nil) ⇒ TokenResponseCardDataBilling

Returns a new instance of TokenResponseCardDataBilling.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/univapay_client_sdk/models/token_response_card_data_billing.rb', line 78

def initialize(line1: SKIP, line2: SKIP, state: SKIP, city: SKIP,
               country: SKIP, zip: SKIP, phone_number: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @line1 = line1 unless line1 == SKIP
  @line2 = line2 unless line2 == SKIP
  @state = state unless state == SKIP
  @city = city unless city == SKIP
  @country = country unless country == SKIP
  @zip = zip unless zip == SKIP
  @phone_number = phone_number unless phone_number == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#cityString

City or locality.

Returns:

  • (String)


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

def city
  @city
end

#countryString

Country code.

Returns:

  • (String)


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

def country
  @country
end

#line1String

Primary street address line.

Returns:

  • (String)


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

def line1
  @line1
end

#line2String

Secondary street address line.

Returns:

  • (String)


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

def line2
  @line2
end

#phone_numberTokenResponsePhoneNumber

Token Response Phone Number schema.



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

def phone_number
  @phone_number
end

#stateString

State or prefecture.

Returns:

  • (String)


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

def state
  @state
end

#zipString

Postal code.

Returns:

  • (String)


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

def zip
  @zip
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



95
96
97
98
99
100
101
102
103
104
105
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_response_card_data_billing.rb', line 95

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  line1 = hash.key?('line1') ? hash['line1'] : SKIP
  line2 = hash.key?('line2') ? hash['line2'] : SKIP
  state = hash.key?('state') ? hash['state'] : SKIP
  city = hash.key?('city') ? hash['city'] : SKIP
  country = hash.key?('country') ? hash['country'] : SKIP
  zip = hash.key?('zip') ? hash['zip'] : SKIP
  phone_number = TokenResponsePhoneNumber.from_hash(hash['phone_number']) if
    hash['phone_number']

  # 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.
  TokenResponseCardDataBilling.new(line1: line1,
                                   line2: line2,
                                   state: state,
                                   city: city,
                                   country: country,
                                   zip: zip,
                                   phone_number: phone_number,
                                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/univapay_client_sdk/models/token_response_card_data_billing.rb', line 41

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['line1'] = 'line1'
  @_hash['line2'] = 'line2'
  @_hash['state'] = 'state'
  @_hash['city'] = 'city'
  @_hash['country'] = 'country'
  @_hash['zip'] = 'zip'
  @_hash['phone_number'] = 'phone_number'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  %w[
    line1
    line2
    state
    city
    country
    zip
  ]
end

.optionalsObject

An array for optional fields



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/univapay_client_sdk/models/token_response_card_data_billing.rb', line 54

def self.optionals
  %w[
    line1
    line2
    state
    city
    country
    zip
    phone_number
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



128
129
130
131
132
133
134
# File 'lib/univapay_client_sdk/models/token_response_card_data_billing.rb', line 128

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.



145
146
147
148
149
150
151
# File 'lib/univapay_client_sdk/models/token_response_card_data_billing.rb', line 145

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} line1: #{@line1.inspect}, line2: #{@line2.inspect}, state:"\
  " #{@state.inspect}, city: #{@city.inspect}, country: #{@country.inspect}, zip:"\
  " #{@zip.inspect}, phone_number: #{@phone_number.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



137
138
139
140
141
142
# File 'lib/univapay_client_sdk/models/token_response_card_data_billing.rb', line 137

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} line1: #{@line1}, line2: #{@line2}, state: #{@state}, city: #{@city},"\
  " country: #{@country}, zip: #{@zip}, phone_number: #{@phone_number}, additional_properties:"\
  " #{@additional_properties}>"
end