Class: ShellCardManagementApIs::CreateCardGroupRequest

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

Overview

CreateCardGroupRequest 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_code = SKIP, col_co_id = SKIP, payer_number = SKIP, payer_id = SKIP, account_id = SKIP, account_number = SKIP, print_on_card = SKIP, card_group_name = SKIP, cards = SKIP) ⇒ CreateCardGroupRequest

Returns a new instance of CreateCardGroupRequest.



104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/shell_card_management_ap_is/models/create_card_group_request.rb', line 104

def initialize(col_co_code = SKIP, col_co_id = SKIP, payer_number = SKIP,
               payer_id = SKIP,  = SKIP,  = SKIP,
               print_on_card = SKIP, card_group_name = SKIP, cards = SKIP)
  @col_co_code = col_co_code unless col_co_code == SKIP
  @col_co_id = col_co_id unless col_co_id == SKIP
  @payer_number = payer_number unless payer_number == SKIP
  @payer_id = payer_id unless payer_id == SKIP
  @account_id =  unless  == SKIP
  @account_number =  unless  == SKIP
  @print_on_card = print_on_card unless print_on_card == SKIP
  @card_group_name = card_group_name unless card_group_name == SKIP
  @cards = cards unless cards == SKIP
end

Instance Attribute Details

#account_idInteger

Account ID of the customer. Optional if AccountNumber is passed else Mandatory.

Returns:

  • (Integer)


43
44
45
# File 'lib/shell_card_management_ap_is/models/create_card_group_request.rb', line 43

def 
  @account_id
end

#account_numberString

Account Number of the customer. Optional if AccountId is passed else Mandatory.

Returns:

  • (String)


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

def 
  @account_number
end

#card_group_nameString

Whether card group name to be embossed on the cards or not.

Returns:

  • (String)


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

def card_group_name
  @card_group_name
end

#cardsArray[CreateCardGroupRequestCardsItems]

List of cards to be moved to the new card group. This list is optional – no card will be moved to the new card group when the list is empty. The fields of Card entity are described in the below rows. The maximum number of cards allowed to be moved in a request is 500 (configurable). The whole request including the card group creation will be rejected when the limit is exceeded.



65
66
67
# File 'lib/shell_card_management_ap_is/models/create_card_group_request.rb', line 65

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-Philippines 5-UK

Returns:

  • (Integer)


19
20
21
# File 'lib/shell_card_management_ap_is/models/create_card_group_request.rb', line 19

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-Philippines 5-UK

Returns:

  • (Integer)


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

def col_co_id
  @col_co_id
end

#payer_idInteger

Payer Id (i.e., Customer Id of the Payment Customer in H3 Cards Platform) of the selected payer. Optional if PayerNumber is passed else Mandatory

Returns:

  • (Integer)


38
39
40
# File 'lib/shell_card_management_ap_is/models/create_card_group_request.rb', line 38

def payer_id
  @payer_id
end

#payer_numberString

Payer Number of the selected payer. Optional if PayerId is passed else Mandatory

Returns:

  • (String)


32
33
34
# File 'lib/shell_card_management_ap_is/models/create_card_group_request.rb', line 32

def payer_number
  @payer_number
end

Whether card group name to be embossed on the cards or not.

Returns:

  • (TrueClass | FalseClass)


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

def print_on_card
  @print_on_card
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/shell_card_management_ap_is/models/create_card_group_request.rb', line 119

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  col_co_code = hash.key?('ColCoCode') ? hash['ColCoCode'] : SKIP
  col_co_id = hash.key?('ColCoId') ? hash['ColCoId'] : SKIP
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP
  payer_id = hash.key?('PayerId') ? hash['PayerId'] : SKIP
   = hash.key?('AccountId') ? hash['AccountId'] : SKIP
   = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
  print_on_card = hash.key?('PrintOnCard') ? hash['PrintOnCard'] : SKIP
  card_group_name =
    hash.key?('CardGroupName') ? hash['CardGroupName'] : SKIP
  # Parameter is an array, so we need to iterate through it
  cards = nil
  unless hash['Cards'].nil?
    cards = []
    hash['Cards'].each do |structure|
      cards << (CreateCardGroupRequestCardsItems.from_hash(structure) if structure)
    end
  end

  cards = SKIP unless hash.key?('Cards')

  # Create object from extracted values.
  CreateCardGroupRequest.new(col_co_code,
                             col_co_id,
                             payer_number,
                             payer_id,
                             ,
                             ,
                             print_on_card,
                             card_group_name,
                             cards)
end

.namesObject

A mapping from model property names to API property names.



68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/shell_card_management_ap_is/models/create_card_group_request.rb', line 68

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash['col_co_id'] = 'ColCoId'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['payer_id'] = 'PayerId'
  @_hash['account_id'] = 'AccountId'
  @_hash['account_number'] = 'AccountNumber'
  @_hash['print_on_card'] = 'PrintOnCard'
  @_hash['card_group_name'] = 'CardGroupName'
  @_hash['cards'] = 'Cards'
  @_hash
end

.nullablesObject

An array for nullable fields



98
99
100
101
102
# File 'lib/shell_card_management_ap_is/models/create_card_group_request.rb', line 98

def self.nullables
  %w[
    card_group_name
  ]
end

.optionalsObject

An array for optional fields



83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/shell_card_management_ap_is/models/create_card_group_request.rb', line 83

def self.optionals
  %w[
    col_co_code
    col_co_id
    payer_number
    payer_id
    account_id
    account_number
    print_on_card
    card_group_name
    cards
  ]
end