Class: ShellCardManagementApIs::CreateBundleRequest

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

Overview

CreateBundleRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(col_co_id = SKIP, col_co_code = SKIP, payer_id = SKIP, payer_number = SKIP, account_id = SKIP, account_number = SKIP, external_bundle_id = SKIP, description = SKIP, cards = SKIP, restrictions = SKIP) ⇒ CreateBundleRequest

Returns a new instance of CreateBundleRequest.



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/shell_card_management_ap_is/models/create_bundle_request.rb', line 123

def initialize(col_co_id = SKIP, col_co_code = SKIP, payer_id = SKIP,
               payer_number = SKIP,  = SKIP,
                = SKIP, external_bundle_id = SKIP,
               description = SKIP, cards = SKIP, restrictions = SKIP)
  @col_co_id = col_co_id unless col_co_id == SKIP
  @col_co_code = col_co_code unless col_co_code == SKIP
  @payer_id = payer_id unless payer_id == SKIP
  @payer_number = payer_number unless payer_number == SKIP
  @account_id =  unless  == SKIP
  @account_number =  unless  == SKIP
  @external_bundle_id = external_bundle_id unless external_bundle_id == SKIP
  @description = description unless description == SKIP
  @cards = cards unless cards == SKIP
  @restrictions = restrictions unless restrictions == SKIP
end

Instance Attribute Details

#account_idInteger

Account ID of the customer. Either AccountId or AccountNumber or both must be passed. Example: 123456

Returns:

  • (Integer)


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

def 
  @account_id
end

#account_numberString

Account Number of the customer. Either AccountId or AccountNumber or both must be passed. Example: GB000000123

Returns:

  • (String)


51
52
53
# File 'lib/shell_card_management_ap_is/models/create_bundle_request.rb', line 51

def 
  @account_number
end

#cardsArray[String]

List of Card PANs to be added in the bundle. Mandatory. Example: 7002051006629890645 When PAN matches with multiple cards, the restriction will be applied on the latest issued card.

Returns:

  • (Array[String])


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

def cards
  @cards
end

#col_co_codeInteger

Collecting Company Code (Shell Code) of the selected payer. Mandatory for serviced OUs such as Romania, Latvia, Lithuania, Estonia, Ukraine etc. It is optional for other countries if ColCoID is provided. Example: 86 for Philippines 5 for UK

Returns:

  • (Integer)


27
28
29
# File 'lib/shell_card_management_ap_is/models/create_bundle_request.rb', line 27

def col_co_code
  @col_co_code
end

#col_co_idInteger

Collecting Company Id of the selected payer. Optional if ColCoCode is passed else Mandatory. Example: 1 for Philippines 5 for UK

Returns:

  • (Integer)


18
19
20
# File 'lib/shell_card_management_ap_is/models/create_bundle_request.rb', line 18

def col_co_id
  @col_co_id
end

#descriptionString

A bundle description. Optional.

Returns:

  • (String)


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

def description
  @description
end

#external_bundle_idString

Identifier of the bundle in external system. Optional.

Returns:

  • (String)


56
57
58
# File 'lib/shell_card_management_ap_is/models/create_bundle_request.rb', line 56

def external_bundle_id
  @external_bundle_id
end

#payer_idInteger

Payer Id of the selected payer. Either PayerId or PayerNumber or both must be passed. Example: 123456

Returns:

  • (Integer)


33
34
35
# File 'lib/shell_card_management_ap_is/models/create_bundle_request.rb', line 33

def payer_id
  @payer_id
end

#payer_numberString

Payer Number of the selected payer. Either PayerId or PayerNumber or both must be passed. Example: GB000000123

Returns:

  • (String)


39
40
41
# File 'lib/shell_card_management_ap_is/models/create_bundle_request.rb', line 39

def payer_number
  @payer_number
end

#restrictionsObject

List of Card PANs to be added in the bundle. Mandatory. Example: 7002051006629890645 When PAN matches with multiple cards, the restriction will be applied on the latest issued card.

Returns:

  • (Object)


77
78
79
# File 'lib/shell_card_management_ap_is/models/create_bundle_request.rb', line 77

def restrictions
  @restrictions
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/shell_card_management_ap_is/models/create_bundle_request.rb', line 140

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  col_co_id = hash.key?('ColCoId') ? hash['ColCoId'] : SKIP
  col_co_code = hash.key?('ColCoCode') ? hash['ColCoCode'] : SKIP
  payer_id = hash.key?('PayerId') ? hash['PayerId'] : SKIP
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP
   = hash.key?('AccountId') ? hash['AccountId'] : SKIP
   = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
  external_bundle_id =
    hash.key?('ExternalBundleId') ? hash['ExternalBundleId'] : SKIP
  description = hash.key?('Description') ? hash['Description'] : SKIP
  cards = hash.key?('Cards') ? hash['Cards'] : SKIP
  restrictions = hash.key?('Restrictions') ? hash['Restrictions'] : SKIP

  # Create object from extracted values.
  CreateBundleRequest.new(col_co_id,
                          col_co_code,
                          payer_id,
                          payer_number,
                          ,
                          ,
                          external_bundle_id,
                          description,
                          cards,
                          restrictions)
end

.namesObject

A mapping from model property names to API property names.



80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/shell_card_management_ap_is/models/create_bundle_request.rb', line 80

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['col_co_id'] = 'ColCoId'
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash['payer_id'] = 'PayerId'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['account_id'] = 'AccountId'
  @_hash['account_number'] = 'AccountNumber'
  @_hash['external_bundle_id'] = 'ExternalBundleId'
  @_hash['description'] = 'Description'
  @_hash['cards'] = 'Cards'
  @_hash['restrictions'] = 'Restrictions'
  @_hash
end

.nullablesObject

An array for nullable fields



112
113
114
115
116
117
118
119
120
121
# File 'lib/shell_card_management_ap_is/models/create_bundle_request.rb', line 112

def self.nullables
  %w[
    col_co_id
    col_co_code
    payer_id
    account_id
    account_number
    external_bundle_id
  ]
end

.optionalsObject

An array for optional fields



96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/shell_card_management_ap_is/models/create_bundle_request.rb', line 96

def self.optionals
  %w[
    col_co_id
    col_co_code
    payer_id
    payer_number
    account_id
    account_number
    external_bundle_id
    description
    cards
    restrictions
  ]
end