Class: ShellCardManagementApIs::PINDeliverTo

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

Overview

PINDeliverTo Model.

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) ⇒ PINDeliverTo

Returns a new instance of PINDeliverTo.



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

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)


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

def address_line
  @address_line
end

#cityString

City Max Length: 40

Returns:

  • (String)


40
41
42
# File 'lib/shell_card_management_ap_is/models/pin_deliver_to.rb', line 40

def city
  @city
end

#company_nameString

Company Name for PIN delivery. Max Length: 50

Returns:

  • (String)


25
26
27
# File 'lib/shell_card_management_ap_is/models/pin_deliver_to.rb', line 25

def company_name
  @company_name
end

#contact_nameString

Contact Name Max Length: 50

Returns:

  • (String)


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

def contact_name
  @contact_name
end

#contact_titleString

Contact Title Max Length: 50

Returns:

  • (String)


20
21
22
# File 'lib/shell_card_management_ap_is/models/pin_deliver_to.rb', line 20

def contact_title
  @contact_title
end

#country_idInteger

Country

Returns:

  • (Integer)


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

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)


60
61
62
# File 'lib/shell_card_management_ap_is/models/pin_deliver_to.rb', line 60

def email_address
  @email_address
end

#phone_numberString

Cardholder phone number for PIN delivery.

Returns:

  • (String)


52
53
54
# File 'lib/shell_card_management_ap_is/models/pin_deliver_to.rb', line 52

def phone_number
  @phone_number
end

#region_idInteger

Region

Returns:

  • (Integer)


44
45
46
# File 'lib/shell_card_management_ap_is/models/pin_deliver_to.rb', line 44

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)


67
68
69
# File 'lib/shell_card_management_ap_is/models/pin_deliver_to.rb', line 67

def save_pin_reminder
  @save_pin_reminder
end

#zip_codeString

Zip Code Max Length: 10

Returns:

  • (String)


35
36
37
# File 'lib/shell_card_management_ap_is/models/pin_deliver_to.rb', line 35

def zip_code
  @zip_code
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



130
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
# File 'lib/shell_card_management_ap_is/models/pin_deliver_to.rb', line 130

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.
  PINDeliverTo.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.



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

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



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

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



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

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