Class: ShellCardManagementApIs::PINDeliveryDetails

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

Overview

PINDeliverDetails entity. The fields of this entity are described below. This is mandatory if PINContactType is 4 else optional and ignored.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(company_name = nil, address_line = nil, zip_code = nil, city = nil, contact_name = SKIP, contact_title = SKIP, region_id = SKIP, country_id = SKIP, phone_number = SKIP, email_address = SKIP, save_pin_reminder = SKIP) ⇒ PINDeliveryDetails

Returns a new instance of PINDeliveryDetails.



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/shell_card_management_ap_is/models/pin_delivery_details.rb', line 113

def initialize(company_name = nil, address_line = nil, zip_code = nil,
               city = nil, contact_name = SKIP, contact_title = SKIP,
               region_id = SKIP, country_id = SKIP, phone_number = SKIP,
               email_address = SKIP, save_pin_reminder = SKIP)
  @contact_name = contact_name unless contact_name == SKIP
  @contact_title = contact_title unless contact_title == SKIP
  @company_name = company_name
  @address_line = address_line
  @zip_code = zip_code
  @city = city
  @region_id = region_id unless region_id == SKIP
  @country_id = country_id unless country_id == SKIP
  @phone_number = phone_number unless phone_number == SKIP
  @email_address = email_address unless email_address == SKIP
  @save_pin_reminder = save_pin_reminder unless save_pin_reminder == SKIP
end

Instance Attribute Details

#address_lineString

Address Lines Max Length: 1024

Returns:

  • (String)


31
32
33
# File 'lib/shell_card_management_ap_is/models/pin_delivery_details.rb', line 31

def address_line
  @address_line
end

#cityString

City Max Length: 40

Returns:

  • (String)


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

def city
  @city
end

#company_nameString

Company Name for PIN delivery. Max Length: 50

Returns:

  • (String)


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

def company_name
  @company_name
end

#contact_nameString

Contact Name Max Length: 50

Returns:

  • (String)


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

def contact_name
  @contact_name
end

#contact_titleString

Contact Title Max Length: 50

Returns:

  • (String)


21
22
23
# File 'lib/shell_card_management_ap_is/models/pin_delivery_details.rb', line 21

def contact_title
  @contact_title
end

#country_idInteger

Country

Returns:

  • (Integer)


49
50
51
# File 'lib/shell_card_management_ap_is/models/pin_delivery_details.rb', line 49

def country_id
  @country_id
end

#email_addressString

Cardholder email address for PIN delivery Max Length : 90 Example: [email protected] <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)


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

def email_address
  @email_address
end

#phone_numberString

Cardholder phone number for PIN delivery.

Returns:

  • (String)


53
54
55
# File 'lib/shell_card_management_ap_is/models/pin_delivery_details.rb', line 53

def phone_number
  @phone_number
end

#region_idInteger

Region

Returns:

  • (Integer)


45
46
47
# File 'lib/shell_card_management_ap_is/models/pin_delivery_details.rb', line 45

def region_id
  @region_id
end

#save_pin_reminderTrueClass | FalseClass

Save PIN Reminder If SavePINReminder is true, the contact address will be saved database for PIN reminder.

<br/>Only allowed for PIN Advice paper delivery.

Returns:

  • (TrueClass | FalseClass)


68
69
70
# File 'lib/shell_card_management_ap_is/models/pin_delivery_details.rb', line 68

def save_pin_reminder
  @save_pin_reminder
end

#zip_codeString

Zip Code Max Length: 10

Returns:

  • (String)


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

def zip_code
  @zip_code
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/shell_card_management_ap_is/models/pin_delivery_details.rb', line 131

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  company_name = hash.key?('CompanyName') ? hash['CompanyName'] : nil
  address_line = hash.key?('AddressLine') ? hash['AddressLine'] : nil
  zip_code = hash.key?('ZipCode') ? hash['ZipCode'] : nil
  city = hash.key?('City') ? hash['City'] : nil
  contact_name = hash.key?('ContactName') ? hash['ContactName'] : SKIP
  contact_title = hash.key?('ContactTitle') ? hash['ContactTitle'] : SKIP
  region_id = hash.key?('RegionID') ? hash['RegionID'] : SKIP
  country_id = hash.key?('CountryID') ? hash['CountryID'] : SKIP
  phone_number = hash.key?('PhoneNumber') ? hash['PhoneNumber'] : SKIP
  email_address = hash.key?('EmailAddress') ? hash['EmailAddress'] : SKIP
  save_pin_reminder =
    hash.key?('SavePINReminder') ? hash['SavePINReminder'] : SKIP

  # Create object from extracted values.
  PINDeliveryDetails.new(company_name,
                         address_line,
                         zip_code,
                         city,
                         contact_name,
                         contact_title,
                         region_id,
                         country_id,
                         phone_number,
                         email_address,
                         save_pin_reminder)
end

.namesObject

A mapping from model property names to API property names.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/shell_card_management_ap_is/models/pin_delivery_details.rb', line 71

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['contact_name'] = 'ContactName'
  @_hash['contact_title'] = 'ContactTitle'
  @_hash['company_name'] = 'CompanyName'
  @_hash['address_line'] = 'AddressLine'
  @_hash['zip_code'] = 'ZipCode'
  @_hash['city'] = 'City'
  @_hash['region_id'] = 'RegionID'
  @_hash['country_id'] = 'CountryID'
  @_hash['phone_number'] = 'PhoneNumber'
  @_hash['email_address'] = 'EmailAddress'
  @_hash['save_pin_reminder'] = 'SavePINReminder'
  @_hash
end

.nullablesObject

An array for nullable fields



101
102
103
104
105
106
107
108
109
110
111
# File 'lib/shell_card_management_ap_is/models/pin_delivery_details.rb', line 101

def self.nullables
  %w[
    contact_name
    contact_title
    zip_code
    region_id
    country_id
    phone_number
    email_address
  ]
end

.optionalsObject

An array for optional fields



88
89
90
91
92
93
94
95
96
97
98
# File 'lib/shell_card_management_ap_is/models/pin_delivery_details.rb', line 88

def self.optionals
  %w[
    contact_name
    contact_title
    region_id
    country_id
    phone_number
    email_address
    save_pin_reminder
  ]
end