Class: ShellCardManagementApIs::CardContact

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

Overview

CardContact 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_name = nil, delivery_company_name = nil, delivery_address_line1 = nil, delivery_zip_code = nil, delivery_city = nil, delivery_country = nil, delivery_contact_title = SKIP, delivery_address_line2 = SKIP, delivery_address_line3 = SKIP, delivery_region_id = SKIP, delivery_region = SKIP, phone_number = SKIP, email_address = SKIP, save_for_card_reissue = SKIP) ⇒ CardContact

Returns a new instance of CardContact.



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/shell_card_management_ap_is/models/card_contact.rb', line 151

def initialize(delivery_contact_name = nil, delivery_company_name = nil,
               delivery_address_line1 = nil, delivery_zip_code = nil,
               delivery_city = nil, delivery_country = nil,
               delivery_contact_title = SKIP, delivery_address_line2 = SKIP,
               delivery_address_line3 = SKIP, delivery_region_id = SKIP,
               delivery_region = SKIP, phone_number = SKIP,
               email_address = SKIP, save_for_card_reissue = SKIP)
  @delivery_contact_title = delivery_contact_title unless delivery_contact_title == SKIP
  @delivery_contact_name = delivery_contact_name
  @delivery_company_name = delivery_company_name
  @delivery_address_line1 = delivery_address_line1
  @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
  @delivery_city = delivery_city
  @delivery_region_id = delivery_region_id unless delivery_region_id == SKIP
  @delivery_region = delivery_region unless delivery_region == SKIP
  @delivery_country = delivery_country
  @phone_number = phone_number unless phone_number == SKIP
  @email_address = email_address unless email_address == SKIP
  @save_for_card_reissue = save_for_card_reissue unless save_for_card_reissue == SKIP
end

Instance Attribute Details

#delivery_address_line1String

Address line 1 <br /> Mandatory<br /> Max field length: 40

Returns:

  • (String)


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

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)


41
42
43
# File 'lib/shell_card_management_ap_is/models/card_contact.rb', line 41

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)


48
49
50
# File 'lib/shell_card_management_ap_is/models/card_contact.rb', line 48

def delivery_address_line3
  @delivery_address_line3
end

#delivery_cityString

City <br /> Mandatory <br /> Max field length: 40

Returns:

  • (String)


61
62
63
# File 'lib/shell_card_management_ap_is/models/card_contact.rb', line 61

def delivery_city
  @delivery_city
end

#delivery_company_nameString

Company name <br /> Mandatory <br /> Max field length: 50

Returns:

  • (String)


28
29
30
# File 'lib/shell_card_management_ap_is/models/card_contact.rb', line 28

def delivery_company_name
  @delivery_company_name
end

#delivery_contact_nameString

Name of the contact person <br /> Mandatory <br /> Max field length: 50

Returns:

  • (String)


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

def delivery_contact_name
  @delivery_contact_name
end

#delivery_contact_titleString

Title of the contact person <br /> Optional Max field length: 10

Returns:

  • (String)


16
17
18
# File 'lib/shell_card_management_ap_is/models/card_contact.rb', line 16

def delivery_contact_title
  @delivery_contact_title
end

#delivery_countryString

The ISO code of the country.<br />

Returns:

  • (String)


76
77
78
# File 'lib/shell_card_management_ap_is/models/card_contact.rb', line 76

def delivery_country
  @delivery_country
end

#delivery_regionString

Region <br /> Optional<br /> When region is passed

Returns:

  • (String)


72
73
74
# File 'lib/shell_card_management_ap_is/models/card_contact.rb', line 72

def delivery_region
  @delivery_region
end

#delivery_region_idInteger

Region Id <br /> Optional

Returns:

  • (Integer)


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

def delivery_region_id
  @delivery_region_id
end

#delivery_zip_codeString

ZIP code <br /> Mandatory <br /> Max field length: 10 <br /> Optional

Returns:

  • (String)


55
56
57
# File 'lib/shell_card_management_ap_is/models/card_contact.rb', line 55

def delivery_zip_code
  @delivery_zip_code
end

#email_addressString

Email address for courier delivery.<br /> 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)


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

def email_address
  @email_address
end

#phone_numberString

Phone number for courier delivery.<br /> Optional.<br /> Max field length: 20

Returns:

  • (String)


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

def phone_number
  @phone_number
end

#save_for_card_reissueTrueClass | FalseClass

If this is specified, the contact address will be saved in cards platform for card reissue processing.<br /> Optional

Returns:

  • (TrueClass | FalseClass)


96
97
98
# File 'lib/shell_card_management_ap_is/models/card_contact.rb', line 96

def save_for_card_reissue
  @save_for_card_reissue
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



175
176
177
178
179
180
181
182
183
184
185
186
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
# File 'lib/shell_card_management_ap_is/models/card_contact.rb', line 175

def self.from_hash(hash)
  return nil unless hash

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

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

.namesObject

A mapping from model property names to API property names.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/shell_card_management_ap_is/models/card_contact.rb', line 99

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_card_reissue'] = 'SaveForCardReissue'
  @_hash
end

.nullablesObject

An array for nullable fields



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/shell_card_management_ap_is/models/card_contact.rb', line 133

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



119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/shell_card_management_ap_is/models/card_contact.rb', line 119

def self.optionals
  %w[
    delivery_contact_title
    delivery_address_line2
    delivery_address_line3
    delivery_region_id
    delivery_region
    phone_number
    email_address
    save_for_card_reissue
  ]
end