Class: ShellCardManagementApIs::PINContact
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::PINContact
- Defined in:
- lib/shell_card_management_ap_is/models/pin_contact.rb
Overview
PINContact Model.
Instance Attribute Summary collapse
-
#delivery_address_line1 ⇒ String
Address line 1 <br /> Mandatory - if PINAdviceType is paper else optional.<br /> Max field length: 40 <br /> Optional.
-
#delivery_address_line2 ⇒ String
Address line 2 <br /> Optional <br /> Max field length: 40 <br /> Optional.
-
#delivery_address_line3 ⇒ String
Address line 3 <br /> Optional <br /> Max field length: 40 <br /> Optional.
-
#delivery_city ⇒ String
City <br /> Mandatory - If PINAdviceType is paper else optional.
-
#delivery_company_name ⇒ String
Company name <br /> Mandatory - If PINAdviceType is paper else optional.
-
#delivery_contact_name ⇒ String
Name of the contact person <br /> Mandatory - If PINAdviceType is paper else optional.
-
#delivery_contact_title ⇒ String
Title of the contact person <br /> Optional.
-
#delivery_country ⇒ String
The ISO code of the country.<br /> Mandatory if PINAdviceType is paper else optional.
-
#delivery_region ⇒ String
Region <br /> Optional<br />.
-
#delivery_region_id ⇒ Integer
Region Id <br /> Optional.
-
#delivery_zip_code ⇒ String
ZIP code <br /> Mandatory - if PINAdviceType is paper else optional.
-
#email_address ⇒ String
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.
-
#phone_number ⇒ String
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.
-
#save_for_pin_reminder ⇒ TrueClass | FalseClass
The given address will be used for sending PIN reminders in future when requested.<br /> Only allowed for paper delivery<br /> Optional.
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.
Instance Method Summary collapse
Methods inherited from BaseModel
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_line1 ⇒ String
Address line 1 <br /> Mandatory - if PINAdviceType is paper else optional.<br /> Max field length: 40 <br /> Optional
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_line2 ⇒ String
Address line 2 <br /> Optional <br /> Max field length: 40 <br /> Optional
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_line3 ⇒ String
Address line 3 <br /> Optional <br /> Max field length: 40 <br /> Optional
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_city ⇒ String
City <br /> Mandatory - If PINAdviceType is paper else optional. <br /> Max field length: 40 <br /> Optional
64 65 66 |
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 64 def delivery_city @delivery_city end |
#delivery_company_name ⇒ String
Company name <br /> Mandatory - If PINAdviceType is paper else optional. <br /> Max field length: 50 <br /> Optional
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_name ⇒ String
Name of the contact person <br /> Mandatory - If PINAdviceType is paper else optional. <br /> Max field length: 50 <br /> Optional
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_title ⇒ String
Title of the contact person <br /> Optional
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_country ⇒ String
The ISO code of the country.<br /> Mandatory if PINAdviceType is paper else optional.
79 80 81 |
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 79 def delivery_country @delivery_country end |
#delivery_region ⇒ String
Region <br /> Optional<br />
74 75 76 |
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 74 def delivery_region @delivery_region end |
#delivery_region_id ⇒ Integer
Region Id <br /> Optional
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_code ⇒ String
ZIP code <br /> Mandatory - if PINAdviceType is paper else optional. <br /> Max field length: 10 <br /> Optional
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_address ⇒ String
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)
95 96 97 |
# File 'lib/shell_card_management_ap_is/models/pin_contact.rb', line 95 def email_address @email_address end |
#phone_number ⇒ String
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
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_reminder ⇒ TrueClass | FalseClass
The given address will be used for sending PIN reminders in future when requested.<br /> Only allowed for paper delivery<br /> Optional
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 |
.names ⇒ Object
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 |
.nullables ⇒ Object
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 |
.optionals ⇒ Object
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 |