Class: PaysecureApiDocumentationLive::IssuerDetails1

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/paysecure_api_documentation_live/models/issuer_details1.rb

Overview

IssuerDetails1 Model.

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(website:, legal_street_address:, legal_country:, legal_city:, legal_zip_code:, bank_accounts:, legal_name:, brand_name:, registration_number:, tax_number:, additional_properties: nil) ⇒ IssuerDetails1

Returns a new instance of IssuerDetails1.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/paysecure_api_documentation_live/models/issuer_details1.rb', line 78

def initialize(website:, legal_street_address:, legal_country:, legal_city:,
               legal_zip_code:, bank_accounts:, legal_name:, brand_name:,
               registration_number:, tax_number:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @website = website
  @legal_street_address = legal_street_address
  @legal_country = legal_country
  @legal_city = legal_city
  @legal_zip_code = legal_zip_code
  @bank_accounts = bank_accounts
  @legal_name = legal_name
  @brand_name = brand_name
  @registration_number = registration_number
  @tax_number = tax_number
  @additional_properties = additional_properties
end

Instance Attribute Details

#bank_accountsArray[BankAccount]

TODO: Write general description for this method

Returns:



34
35
36
# File 'lib/paysecure_api_documentation_live/models/issuer_details1.rb', line 34

def bank_accounts
  @bank_accounts
end

#brand_nameString

TODO: Write general description for this method

Returns:

  • (String)


42
43
44
# File 'lib/paysecure_api_documentation_live/models/issuer_details1.rb', line 42

def brand_name
  @brand_name
end

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/paysecure_api_documentation_live/models/issuer_details1.rb', line 26

def legal_city
  @legal_city
end

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/paysecure_api_documentation_live/models/issuer_details1.rb', line 22

def legal_country
  @legal_country
end

TODO: Write general description for this method

Returns:

  • (String)


38
39
40
# File 'lib/paysecure_api_documentation_live/models/issuer_details1.rb', line 38

def legal_name
  @legal_name
end

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/paysecure_api_documentation_live/models/issuer_details1.rb', line 18

def legal_street_address
  @legal_street_address
end

TODO: Write general description for this method

Returns:

  • (String)


30
31
32
# File 'lib/paysecure_api_documentation_live/models/issuer_details1.rb', line 30

def legal_zip_code
  @legal_zip_code
end

#registration_numberString

TODO: Write general description for this method

Returns:

  • (String)


46
47
48
# File 'lib/paysecure_api_documentation_live/models/issuer_details1.rb', line 46

def registration_number
  @registration_number
end

#tax_numberString

TODO: Write general description for this method

Returns:

  • (String)


50
51
52
# File 'lib/paysecure_api_documentation_live/models/issuer_details1.rb', line 50

def tax_number
  @tax_number
end

#websiteString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/paysecure_api_documentation_live/models/issuer_details1.rb', line 14

def website
  @website
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/paysecure_api_documentation_live/models/issuer_details1.rb', line 99

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  website = hash.key?('website') ? hash['website'] : nil
  legal_street_address =
    hash.key?('legal_street_address') ? hash['legal_street_address'] : nil
  legal_country = hash.key?('legal_country') ? hash['legal_country'] : nil
  legal_city = hash.key?('legal_city') ? hash['legal_city'] : nil
  legal_zip_code =
    hash.key?('legal_zip_code') ? hash['legal_zip_code'] : nil
  # Parameter is an array, so we need to iterate through it
  bank_accounts = nil
  unless hash['bank_accounts'].nil?
    bank_accounts = []
    hash['bank_accounts'].each do |structure|
      bank_accounts << (BankAccount.from_hash(structure) if structure)
    end
  end

  bank_accounts = nil unless hash.key?('bank_accounts')
  legal_name = hash.key?('legal_name') ? hash['legal_name'] : nil
  brand_name = hash.key?('brand_name') ? hash['brand_name'] : nil
  registration_number =
    hash.key?('registration_number') ? hash['registration_number'] : nil
  tax_number = hash.key?('tax_number') ? hash['tax_number'] : nil

  # 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.
  IssuerDetails1.new(website: website,
                     legal_street_address: legal_street_address,
                     legal_country: legal_country,
                     legal_city: legal_city,
                     legal_zip_code: legal_zip_code,
                     bank_accounts: bank_accounts,
                     legal_name: legal_name,
                     brand_name: brand_name,
                     registration_number: registration_number,
                     tax_number: tax_number,
                     additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/paysecure_api_documentation_live/models/issuer_details1.rb', line 53

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['website'] = 'website'
  @_hash['legal_street_address'] = 'legal_street_address'
  @_hash['legal_country'] = 'legal_country'
  @_hash['legal_city'] = 'legal_city'
  @_hash['legal_zip_code'] = 'legal_zip_code'
  @_hash['bank_accounts'] = 'bank_accounts'
  @_hash['legal_name'] = 'legal_name'
  @_hash['brand_name'] = 'brand_name'
  @_hash['registration_number'] = 'registration_number'
  @_hash['tax_number'] = 'tax_number'
  @_hash
end

.nullablesObject

An array for nullable fields



74
75
76
# File 'lib/paysecure_api_documentation_live/models/issuer_details1.rb', line 74

def self.nullables
  []
end

.optionalsObject

An array for optional fields



69
70
71
# File 'lib/paysecure_api_documentation_live/models/issuer_details1.rb', line 69

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



158
159
160
161
162
163
164
165
166
# File 'lib/paysecure_api_documentation_live/models/issuer_details1.rb', line 158

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} website: #{@website.inspect}, legal_street_address:"\
  " #{@legal_street_address.inspect}, legal_country: #{@legal_country.inspect}, legal_city:"\
  " #{@legal_city.inspect}, legal_zip_code: #{@legal_zip_code.inspect}, bank_accounts:"\
  " #{@bank_accounts.inspect}, legal_name: #{@legal_name.inspect}, brand_name:"\
  " #{@brand_name.inspect}, registration_number: #{@registration_number.inspect}, tax_number:"\
  " #{@tax_number.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



148
149
150
151
152
153
154
155
# File 'lib/paysecure_api_documentation_live/models/issuer_details1.rb', line 148

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} website: #{@website}, legal_street_address: #{@legal_street_address},"\
  " legal_country: #{@legal_country}, legal_city: #{@legal_city}, legal_zip_code:"\
  " #{@legal_zip_code}, bank_accounts: #{@bank_accounts}, legal_name: #{@legal_name},"\
  " brand_name: #{@brand_name}, registration_number: #{@registration_number}, tax_number:"\
  " #{@tax_number}, additional_properties: #{@additional_properties}>"
end