Class: ShellCardManagementApIs::PINContact

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

Overview

PINContact Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(delivery_contact_title = SKIP, delivery_contact_name = SKIP, delivery_company_name = SKIP, delivery_address_line1 = SKIP, delivery_address_line2 = SKIP, delivery_address_line3 = SKIP, delivery_zip_code = SKIP, delivery_city = SKIP, delivery_region_id = SKIP, delivery_region = SKIP, delivery_country = SKIP, phone_number = SKIP, email_address = SKIP, save_for_pin_reminder = SKIP) ⇒ PINContact

Returns a new instance of PINContact.



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 163

def initialize(delivery_contact_title = SKIP, delivery_contact_name = SKIP,
               delivery_company_name = SKIP, delivery_address_line1 = SKIP,
               delivery_address_line2 = SKIP, delivery_address_line3 = SKIP,
               delivery_zip_code = SKIP, delivery_city = SKIP,
               delivery_region_id = SKIP, delivery_region = SKIP,
               delivery_country = SKIP, phone_number = SKIP,
               email_address = SKIP, save_for_pin_reminder = SKIP)
  @delivery_contact_title = delivery_contact_title unless delivery_contact_title == SKIP
  @delivery_contact_name = delivery_contact_name unless delivery_contact_name == SKIP
  @delivery_company_name = delivery_company_name unless delivery_company_name == SKIP
  @delivery_address_line1 = delivery_address_line1 unless delivery_address_line1 == SKIP
  @delivery_address_line2 = delivery_address_line2 unless delivery_address_line2 == SKIP
  @delivery_address_line3 = delivery_address_line3 unless delivery_address_line3 == SKIP
  @delivery_zip_code = delivery_zip_code unless delivery_zip_code == SKIP
  @delivery_city = delivery_city unless delivery_city == SKIP
  @delivery_region_id = delivery_region_id unless delivery_region_id == SKIP
  @delivery_region = delivery_region unless delivery_region == SKIP
  @delivery_country = delivery_country unless delivery_country == SKIP
  @phone_number = phone_number unless phone_number == SKIP
  @email_address = email_address unless email_address == SKIP
  @save_for_pin_reminder = save_for_pin_reminder unless save_for_pin_reminder == SKIP
end

Instance Attribute Details

#delivery_address_line1String

Address line 1 <br /> Mandatory - if PINAdviceType is paper else optional.<br /> Max field length: 40 <br /> Optional

Returns:

  • (String)


36
37
38
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 36

def delivery_address_line1
  @delivery_address_line1
end

#delivery_address_line2String

Address line 2 <br /> Optional <br /> Max field length: 40 <br /> Optional

Returns:

  • (String)


43
44
45
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 43

def delivery_address_line2
  @delivery_address_line2
end

#delivery_address_line3String

Address line 3 <br /> Optional <br /> Max field length: 40 <br /> Optional

Returns:

  • (String)


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

def delivery_address_line3
  @delivery_address_line3
end

#delivery_cityString

City <br /> Mandatory - If PINAdviceType is paper else optional. <br /> Max field length: 40 <br /> Optional

Returns:

  • (String)


64
65
66
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 64

def delivery_city
  @delivery_city
end

#delivery_company_nameString

Company name <br /> Mandatory - If PINAdviceType is paper else optional. <br /> Max field length: 50 <br /> Optional

Returns:

  • (String)


29
30
31
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 29

def delivery_company_name
  @delivery_company_name
end

#delivery_contact_nameString

Name of the contact person <br /> Mandatory - If PINAdviceType is paper else optional. <br /> Max field length: 50 <br /> Optional

Returns:

  • (String)


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

def delivery_contact_name
  @delivery_contact_name
end

#delivery_contact_titleString

Title of the contact person <br /> Optional

Returns:

  • (String)


15
16
17
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 15

def delivery_contact_title
  @delivery_contact_title
end

#delivery_countryString

The ISO code of the country.<br /> Mandatory if PINAdviceType is paper else optional.

Returns:

  • (String)


79
80
81
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 79

def delivery_country
  @delivery_country
end

#delivery_regionString

Region <br /> Optional<br />

Returns:

  • (String)


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

def delivery_region
  @delivery_region
end

#delivery_region_idInteger

Region Id <br /> Optional

Returns:

  • (Integer)


69
70
71
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 69

def delivery_region_id
  @delivery_region_id
end

#delivery_zip_codeString

ZIP code <br /> Mandatory - if PINAdviceType is paper else optional. <br /> Max field length: 10 <br /> Optional

Returns:

  • (String)


57
58
59
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 57

def delivery_zip_code
  @delivery_zip_code
end

#email_addressString

Email address for to send email of the PIN in case PINAdviceType is Email.<br /> Mandatory if PINAdviceType is email else optional.<br /> Max field length: 90. <br/>Note:Based on the international standard that there can be Max Length 64 before the @ (the ‘Local part’) =64(minimum of 1) Max Lenth after the (the domain) = 88 (Minimum of 2)

Returns:

  • (String)


95
96
97
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 95

def email_address
  @email_address
end

#phone_numberString

Phone number for to send SMS of the PIN in case PINAdviceType is SMS.<br /> Mandatory if PINAdviceType is SMS else optional.<br /> Max field length: 20

Returns:

  • (String)


86
87
88
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 86

def phone_number
  @phone_number
end

#save_for_pin_reminderTrueClass | FalseClass

The given address will be used for sending PIN reminders in future when requested.<br /> Only allowed for paper delivery<br /> Optional

Returns:

  • (TrueClass | FalseClass)


102
103
104
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 102

def save_for_pin_reminder
  @save_for_pin_reminder
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



187
188
189
190
191
192
193
194
195
196
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
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 187

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  delivery_contact_title =
    hash.key?('DeliveryContactTitle') ? hash['DeliveryContactTitle'] : SKIP
  delivery_contact_name =
    hash.key?('DeliveryContactName') ? hash['DeliveryContactName'] : SKIP
  delivery_company_name =
    hash.key?('DeliveryCompanyName') ? hash['DeliveryCompanyName'] : SKIP
  delivery_address_line1 =
    hash.key?('DeliveryAddressLine1') ? hash['DeliveryAddressLine1'] : SKIP
  delivery_address_line2 =
    hash.key?('DeliveryAddressLine2') ? hash['DeliveryAddressLine2'] : SKIP
  delivery_address_line3 =
    hash.key?('DeliveryAddressLine3') ? hash['DeliveryAddressLine3'] : SKIP
  delivery_zip_code =
    hash.key?('DeliveryZipCode') ? hash['DeliveryZipCode'] : SKIP
  delivery_city = hash.key?('DeliveryCity') ? hash['DeliveryCity'] : SKIP
  delivery_region_id =
    hash.key?('DeliveryRegionId') ? hash['DeliveryRegionId'] : SKIP
  delivery_region =
    hash.key?('DeliveryRegion') ? hash['DeliveryRegion'] : SKIP
  delivery_country =
    hash.key?('DeliveryCountry') ? hash['DeliveryCountry'] : SKIP
  phone_number = hash.key?('PhoneNumber') ? hash['PhoneNumber'] : SKIP
  email_address = hash.key?('EmailAddress') ? hash['EmailAddress'] : SKIP
  save_for_pin_reminder =
    hash.key?('SaveForPINReminder') ? hash['SaveForPINReminder'] : SKIP

  # Create object from extracted values.
  PINContact.new(delivery_contact_title,
                 delivery_contact_name,
                 delivery_company_name,
                 delivery_address_line1,
                 delivery_address_line2,
                 delivery_address_line3,
                 delivery_zip_code,
                 delivery_city,
                 delivery_region_id,
                 delivery_region,
                 delivery_country,
                 phone_number,
                 email_address,
                 save_for_pin_reminder)
end

.namesObject

A mapping from model property names to API property names.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 105

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['delivery_contact_title'] = 'DeliveryContactTitle'
  @_hash['delivery_contact_name'] = 'DeliveryContactName'
  @_hash['delivery_company_name'] = 'DeliveryCompanyName'
  @_hash['delivery_address_line1'] = 'DeliveryAddressLine1'
  @_hash['delivery_address_line2'] = 'DeliveryAddressLine2'
  @_hash['delivery_address_line3'] = 'DeliveryAddressLine3'
  @_hash['delivery_zip_code'] = 'DeliveryZipCode'
  @_hash['delivery_city'] = 'DeliveryCity'
  @_hash['delivery_region_id'] = 'DeliveryRegionId'
  @_hash['delivery_region'] = 'DeliveryRegion'
  @_hash['delivery_country'] = 'DeliveryCountry'
  @_hash['phone_number'] = 'PhoneNumber'
  @_hash['email_address'] = 'EmailAddress'
  @_hash['save_for_pin_reminder'] = 'SaveForPINReminder'
  @_hash
end

.nullablesObject

An array for nullable fields



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 145

def self.nullables
  %w[
    delivery_contact_title
    delivery_contact_name
    delivery_company_name
    delivery_address_line1
    delivery_address_line2
    delivery_address_line3
    delivery_zip_code
    delivery_city
    delivery_region_id
    delivery_region
    delivery_country
    phone_number
    email_address
  ]
end

.optionalsObject

An array for optional fields



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 125

def self.optionals
  %w[
    delivery_contact_title
    delivery_contact_name
    delivery_company_name
    delivery_address_line1
    delivery_address_line2
    delivery_address_line3
    delivery_zip_code
    delivery_city
    delivery_region_id
    delivery_region
    delivery_country
    phone_number
    email_address
    save_for_pin_reminder
  ]
end