Class: ShellDataReportingApIs::CardGroupRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_data_reporting_ap_is/models/card_group_request.rb

Overview

CardGroupRequest 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 = SKIP, card_group_name = SKIP, status = SKIP, current_page = SKIP, page_size = SKIP) ⇒ CardGroupRequest

Returns a new instance of CardGroupRequest.



121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 121

def initialize(col_co_id = SKIP, col_co_code = SKIP, payer_id = SKIP,
               payer_number = SKIP,  = SKIP, card_group_name = SKIP,
               status = SKIP, current_page = SKIP, page_size = 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 =  unless  == SKIP
  @card_group_name = card_group_name unless card_group_name == SKIP
  @status = status unless status == SKIP
  @current_page = current_page unless current_page == SKIP
  @page_size = page_size unless page_size == SKIP
end

Instance Attribute Details

#accountArray[Accounts]

PayerNumber of the customer. Optional if PayerId is passed, else Mandatory. This input is a search criterion. Example: GB00123456

Returns:



48
49
50
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 48

def 
  @account
end

#card_group_nameString

Card Group Name Optional. Minimum of 2 characters should be provided else not considered. CardGroups those have the entered value at any part

Returns:

  • (String)


55
56
57
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 55

def card_group_name
  @card_group_name
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_data_reporting_ap_is/models/card_group_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_data_reporting_ap_is/models/card_group_request.rb', line 18

def col_co_id
  @col_co_id
end

#current_pageInteger

Page Number (as shown to the users) Optional Default value 1

Returns:

  • (Integer)


70
71
72
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 70

def current_page
  @current_page
end

#page_sizeInteger

Page Size – Number of records to show on a page. Optional Default value 50. Return all rows if -1 is supplied as page size.

Returns:

  • (Integer)


77
78
79
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 77

def page_size
  @page_size
end

#payer_idInteger

Payer id of the customer. Optional if PayerNumber is passed, else Mandatory. This input is a search criterion. Example: 123456

Returns:

  • (Integer)


34
35
36
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 34

def payer_id
  @payer_id
end

#payer_numberString

PayerNumber of the customer. Optional if PayerId is passed, else Mandatory. This input is a search criterion. Example: GB00123456

Returns:

  • (String)


41
42
43
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 41

def payer_number
  @payer_number
end

#statusString

Card Group Status Mandatory Allowed values: • ALL • TERMINATED • ACTIVE

Returns:

  • (String)


64
65
66
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 64

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
161
162
163
164
165
166
167
168
169
170
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 136

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
  # Parameter is an array, so we need to iterate through it
   = nil
  unless hash['Account'].nil?
     = []
    hash['Account'].each do |structure|
       << (Accounts.from_hash(structure) if structure)
    end
  end

   = SKIP unless hash.key?('Account')
  card_group_name =
    hash.key?('CardGroupName') ? hash['CardGroupName'] : SKIP
  status = hash.key?('Status') ? hash['Status'] : SKIP
  current_page = hash.key?('CurrentPage') ? hash['CurrentPage'] : SKIP
  page_size = hash.key?('PageSize') ? hash['PageSize'] : SKIP

  # Create object from extracted values.
  CardGroupRequest.new(col_co_id,
                       col_co_code,
                       payer_id,
                       payer_number,
                       ,
                       card_group_name,
                       status,
                       current_page,
                       page_size)
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
# File 'lib/shell_data_reporting_ap_is/models/card_group_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'] = 'Account'
  @_hash['card_group_name'] = 'CardGroupName'
  @_hash['status'] = 'Status'
  @_hash['current_page'] = 'CurrentPage'
  @_hash['page_size'] = 'PageSize'
  @_hash
end

.nullablesObject

An array for nullable fields



110
111
112
113
114
115
116
117
118
119
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 110

def self.nullables
  %w[
    col_co_id
    col_co_code
    payer_id
    payer_number
    card_group_name
    status
  ]
end

.optionalsObject

An array for optional fields



95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 95

def self.optionals
  %w[
    col_co_id
    col_co_code
    payer_id
    payer_number
    account
    card_group_name
    status
    current_page
    page_size
  ]
end