Class: ShellCardManagementApIs::DeliveryAddresses

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_card_management_ap_is/models/delivery_addresses.rb

Overview

DeliveryAddresses Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(address_id = SKIP, address_line1 = SKIP, address_line2 = SKIP, address_line3 = SKIP, city = SKIP, company_name = SKIP, contact_fore_name = SKIP, contact_last_name = SKIP, contact_middle_name = SKIP, contact_title = SKIP, country = SKIP, country_id = SKIP, country_iso_code = SKIP, fax = SKIP, region = SKIP, region_id = SKIP, telephone = SKIP, zip_code = SKIP, address_type = SKIP) ⇒ DeliveryAddresses

Returns a new instance of DeliveryAddresses.



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 167

def initialize(address_id = SKIP, address_line1 = SKIP,
               address_line2 = SKIP, address_line3 = SKIP, city = SKIP,
               company_name = SKIP, contact_fore_name = SKIP,
               contact_last_name = SKIP, contact_middle_name = SKIP,
               contact_title = SKIP, country = SKIP, country_id = SKIP,
               country_iso_code = SKIP, fax = SKIP, region = SKIP,
               region_id = SKIP, telephone = SKIP, zip_code = SKIP,
               address_type = SKIP)
  @address_id = address_id unless address_id == SKIP
  @address_line1 = address_line1 unless address_line1 == SKIP
  @address_line2 = address_line2 unless address_line2 == SKIP
  @address_line3 = address_line3 unless address_line3 == SKIP
  @city = city unless city == SKIP
  @company_name = company_name unless company_name == SKIP
  @contact_fore_name = contact_fore_name unless contact_fore_name == SKIP
  @contact_last_name = contact_last_name unless contact_last_name == SKIP
  @contact_middle_name = contact_middle_name unless contact_middle_name == SKIP
  @contact_title = contact_title unless contact_title == SKIP
  @country = country unless country == SKIP
  @country_id = country_id unless country_id == SKIP
  @country_iso_code = country_iso_code unless country_iso_code == SKIP
  @fax = fax unless fax == SKIP
  @region = region unless region == SKIP
  @region_id = region_id unless region_id == SKIP
  @telephone = telephone unless telephone == SKIP
  @zip_code = zip_code unless zip_code == SKIP
  @address_type = address_type unless address_type == SKIP
end

Instance Attribute Details

#address_idInteger

Address Id

Returns:

  • (Integer)


14
15
16
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 14

def address_id
  @address_id
end

#address_line1String

AddressLine1

Returns:

  • (String)


18
19
20
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 18

def address_line1
  @address_line1
end

#address_line2String

AddressLine2

Returns:

  • (String)


22
23
24
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 22

def address_line2
  @address_line2
end

#address_line3String

AddressLine3

Returns:

  • (String)


26
27
28
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 26

def address_line3
  @address_line3
end

#address_typeInteger

Delivery address type. Possible Values: 1 – Card and PIN delivery address 2 – Card delivery address 3 – PIN delivery address

Returns:

  • (Integer)


90
91
92
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 90

def address_type
  @address_type
end

#cityString

City

Returns:

  • (String)


30
31
32
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 30

def city
  @city
end

#company_nameString

Account Name

Returns:

  • (String)


34
35
36
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 34

def company_name
  @company_name
end

#contact_fore_nameString

Contact fore name of the delivery address.

Returns:

  • (String)


38
39
40
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 38

def contact_fore_name
  @contact_fore_name
end

#contact_last_nameString

Contact last name of the delivery address.

Returns:

  • (String)


42
43
44
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 42

def contact_last_name
  @contact_last_name
end

#contact_middle_nameString

Contact middle name of the delivery address.

Returns:

  • (String)


46
47
48
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 46

def contact_middle_name
  @contact_middle_name
end

#contact_titleString

ContactTitle

Returns:

  • (String)


50
51
52
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 50

def contact_title
  @contact_title
end

#countryString

Country

Returns:

  • (String)


54
55
56
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 54

def country
  @country
end

#country_idInteger

Country Id

Returns:

  • (Integer)


58
59
60
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 58

def country_id
  @country_id
end

#country_iso_codeString

Country ISO code

Returns:

  • (String)


62
63
64
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 62

def country_iso_code
  @country_iso_code
end

#faxString

Fax number of the address contact.

Returns:

  • (String)


66
67
68
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 66

def fax
  @fax
end

#regionString

Region of the Card Delivery address

Returns:

  • (String)


70
71
72
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 70

def region
  @region
end

#region_idInteger

Region Id of the address.

Returns:

  • (Integer)


74
75
76
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 74

def region_id
  @region_id
end

#telephoneString

Telephone number of the address contact

Returns:

  • (String)


78
79
80
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 78

def telephone
  @telephone
end

#zip_codeString

Delivery Zip code

Returns:

  • (String)


82
83
84
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 82

def zip_code
  @zip_code
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 197

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  address_id = hash.key?('AddressId') ? hash['AddressId'] : SKIP
  address_line1 = hash.key?('AddressLine1') ? hash['AddressLine1'] : SKIP
  address_line2 = hash.key?('AddressLine2') ? hash['AddressLine2'] : SKIP
  address_line3 = hash.key?('AddressLine3') ? hash['AddressLine3'] : SKIP
  city = hash.key?('City') ? hash['City'] : SKIP
  company_name = hash.key?('CompanyName') ? hash['CompanyName'] : SKIP
  contact_fore_name =
    hash.key?('ContactForeName') ? hash['ContactForeName'] : SKIP
  contact_last_name =
    hash.key?('ContactLastName') ? hash['ContactLastName'] : SKIP
  contact_middle_name =
    hash.key?('ContactMiddleName') ? hash['ContactMiddleName'] : SKIP
  contact_title = hash.key?('ContactTitle') ? hash['ContactTitle'] : SKIP
  country = hash.key?('Country') ? hash['Country'] : SKIP
  country_id = hash.key?('CountryId') ? hash['CountryId'] : SKIP
  country_iso_code =
    hash.key?('CountryISOCode') ? hash['CountryISOCode'] : SKIP
  fax = hash.key?('Fax') ? hash['Fax'] : SKIP
  region = hash.key?('Region') ? hash['Region'] : SKIP
  region_id = hash.key?('RegionId') ? hash['RegionId'] : SKIP
  telephone = hash.key?('Telephone') ? hash['Telephone'] : SKIP
  zip_code = hash.key?('ZipCode') ? hash['ZipCode'] : SKIP
  address_type = hash.key?('AddressType') ? hash['AddressType'] : SKIP

  # Create object from extracted values.
  DeliveryAddresses.new(address_id,
                        address_line1,
                        address_line2,
                        address_line3,
                        city,
                        company_name,
                        contact_fore_name,
                        contact_last_name,
                        contact_middle_name,
                        contact_title,
                        country,
                        country_id,
                        country_iso_code,
                        fax,
                        region,
                        region_id,
                        telephone,
                        zip_code,
                        address_type)
end

.namesObject

A mapping from model property names to API property names.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 93

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['address_id'] = 'AddressId'
  @_hash['address_line1'] = 'AddressLine1'
  @_hash['address_line2'] = 'AddressLine2'
  @_hash['address_line3'] = 'AddressLine3'
  @_hash['city'] = 'City'
  @_hash['company_name'] = 'CompanyName'
  @_hash['contact_fore_name'] = 'ContactForeName'
  @_hash['contact_last_name'] = 'ContactLastName'
  @_hash['contact_middle_name'] = 'ContactMiddleName'
  @_hash['contact_title'] = 'ContactTitle'
  @_hash['country'] = 'Country'
  @_hash['country_id'] = 'CountryId'
  @_hash['country_iso_code'] = 'CountryISOCode'
  @_hash['fax'] = 'Fax'
  @_hash['region'] = 'Region'
  @_hash['region_id'] = 'RegionId'
  @_hash['telephone'] = 'Telephone'
  @_hash['zip_code'] = 'ZipCode'
  @_hash['address_type'] = 'AddressType'
  @_hash
end

.nullablesObject

An array for nullable fields



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 143

def self.nullables
  %w[
    address_id
    address_line1
    address_line2
    address_line3
    city
    company_name
    contact_fore_name
    contact_last_name
    contact_middle_name
    contact_title
    country
    country_id
    country_iso_code
    fax
    region
    region_id
    telephone
    zip_code
    address_type
  ]
end

.optionalsObject

An array for optional fields



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/shell_card_management_ap_is/models/delivery_addresses.rb', line 118

def self.optionals
  %w[
    address_id
    address_line1
    address_line2
    address_line3
    city
    company_name
    contact_fore_name
    contact_last_name
    contact_middle_name
    contact_title
    country
    country_id
    country_iso_code
    fax
    region
    region_id
    telephone
    zip_code
    address_type
  ]
end