Class: ShellDataReportingApIs::AuditRequest

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

Overview

AuditRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(status = SKIP, payer_number = SKIP, payer_id = SKIP, account_number = SKIP, col_co_code = SKIP, col_co_id = SKIP, accounts = SKIP, requested_operation = SKIP, sort_order = SKIP, search_text = SKIP, from_date = SKIP, to_date = SKIP) ⇒ AuditRequest

Returns a new instance of AuditRequest.



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/shell_data_reporting_ap_is/models/audit_request.rb', line 183

def initialize(status = SKIP, payer_number = SKIP, payer_id = SKIP,
                = SKIP, col_co_code = SKIP, col_co_id = SKIP,
               accounts = SKIP, requested_operation = SKIP,
               sort_order = SKIP, search_text = SKIP, from_date = SKIP,
               to_date = SKIP)
  @status = status unless status == SKIP
  @payer_number = payer_number unless payer_number == SKIP
  @payer_id = payer_id unless payer_id == SKIP
  @account_number =  unless  == SKIP
  @col_co_code = col_co_code unless col_co_code == SKIP
  @col_co_id = col_co_id unless col_co_id == SKIP
  @accounts = accounts unless accounts == SKIP
  @requested_operation = requested_operation unless requested_operation == SKIP
  @sort_order = sort_order unless sort_order == SKIP
  @search_text = search_text unless search_text == SKIP
  @from_date = from_date unless from_date == SKIP
  @to_date = to_date unless to_date == SKIP
end

Instance Attribute Details

#account_numberString

Payer Id of the selected payer. Optional if PayerNumber is passed else Mandatory Example: 123456

Returns:

  • (String)


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

def 
  @account_number
end

#accountsAccounts

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

Returns:



66
67
68
# File 'lib/shell_data_reporting_ap_is/models/audit_request.rb', line 66

def accounts
  @accounts
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)


50
51
52
# File 'lib/shell_data_reporting_ap_is/models/audit_request.rb', line 50

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)


58
59
60
# File 'lib/shell_data_reporting_ap_is/models/audit_request.rb', line 58

def col_co_id
  @col_co_id
end

#from_dateString

To search for requests submitted from this date. Optional Maximum of X days duration allowed per search. The X value is configurable and initially set to 180 days. Format: yyyyMMdd Example: 20200101 If FromDate is not provided and ToDate is provided, then FromDate will be considered as 30 days less than ToDate. However, when both FromDate and ToDate is not provided then last 30 days will be considered for filtering.

Returns:

  • (String)


119
120
121
# File 'lib/shell_data_reporting_ap_is/models/audit_request.rb', line 119

def from_date
  @from_date
end

#payer_idInteger

Payer Id of the selected payer. Optional if PayerNumber is passed else Mandatory Example: 123456

Returns:

  • (Integer)


35
36
37
# File 'lib/shell_data_reporting_ap_is/models/audit_request.rb', line 35

def payer_id
  @payer_id
end

#payer_numberString

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

Returns:

  • (String)


29
30
31
# File 'lib/shell_data_reporting_ap_is/models/audit_request.rb', line 29

def payer_number
  @payer_number
end

#requested_operationArray[String]

Type of requests to be fetched. Optional Allowed values: • OrderCard • CreateCardGroup • PINReminder • MoveCard • UpdateCardStatus • UpdateCardGroup • AutoRenew • BulkCardOrder • BulkCardBlock • BulkCardOrderMultiAccount • MobilePaymentRegistration • UpdateCompanyInfo • BCOSummary • BCOMultiAccountSummary • BCBSummary • FundTransfer • DeliveryAddressUpdate

Returns:

  • (Array[String])


89
90
91
# File 'lib/shell_data_reporting_ap_is/models/audit_request.rb', line 89

def requested_operation
  @requested_operation
end

#search_textString

Search text used as criteria to filter the requests. Optional Minimum length is 4 characters (configurable). Else, an error (0007) will be returned. When valid text is provided, MS will return all the records that contains the Search Text within any of the look up fields

Returns:

  • (String)


107
108
109
# File 'lib/shell_data_reporting_ap_is/models/audit_request.rb', line 107

def search_text
  @search_text
end

#sort_orderString

Allowed Sorting Options:

  1. SubmittedDateDescending

  2. SubmittedDateAscending

  3. AccountNumberAscending

  4. AccountNumberDescending

Optional: Default value is 1 Example value to be passed: 1,3

Returns:

  • (String)


99
100
101
# File 'lib/shell_data_reporting_ap_is/models/audit_request.rb', line 99

def sort_order
  @sort_order
end

#statusString

Status of requests to be fetched. • Success • Failed • InProgress • Submitted • Rejected • PendingApproval • All • MailedToCSC Optional If not passed “All” will be considered as the default value.

Returns:

  • (String)


24
25
26
# File 'lib/shell_data_reporting_ap_is/models/audit_request.rb', line 24

def status
  @status
end

#to_dateString

To search for requests submitted until this date. Optional Format: yyyyMMdd Example: 20200130 If ToDate is not provided and FromDate is provided, then ToDate will be considered as current date or 30 days from FromDate, whichever is earlier. However, when both FromDate and ToDate is not provided then last 30 days will be considered for filtering.

Returns:

  • (String)


130
131
132
# File 'lib/shell_data_reporting_ap_is/models/audit_request.rb', line 130

def to_date
  @to_date
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/shell_data_reporting_ap_is/models/audit_request.rb', line 203

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  status = hash.key?('Status') ? hash['Status'] : SKIP
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP
  payer_id = hash.key?('PayerId') ? hash['PayerId'] : SKIP
   = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
  col_co_code = hash.key?('ColCoCode') ? hash['ColCoCode'] : SKIP
  col_co_id = hash.key?('ColCoId') ? hash['ColCoId'] : SKIP
  accounts = Accounts.from_hash(hash['Accounts']) if hash['Accounts']
  requested_operation =
    hash.key?('RequestedOperation') ? hash['RequestedOperation'] : SKIP
  sort_order = hash.key?('SortOrder') ? hash['SortOrder'] : SKIP
  search_text = hash.key?('SearchText') ? hash['SearchText'] : SKIP
  from_date = hash.key?('FromDate') ? hash['FromDate'] : SKIP
  to_date = hash.key?('ToDate') ? hash['ToDate'] : SKIP

  # Create object from extracted values.
  AuditRequest.new(status,
                   payer_number,
                   payer_id,
                   ,
                   col_co_code,
                   col_co_id,
                   accounts,
                   requested_operation,
                   sort_order,
                   search_text,
                   from_date,
                   to_date)
end

.namesObject

A mapping from model property names to API property names.



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/shell_data_reporting_ap_is/models/audit_request.rb', line 133

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['status'] = 'Status'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['payer_id'] = 'PayerId'
  @_hash['account_number'] = 'AccountNumber'
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash['col_co_id'] = 'ColCoId'
  @_hash['accounts'] = 'Accounts'
  @_hash['requested_operation'] = 'RequestedOperation'
  @_hash['sort_order'] = 'SortOrder'
  @_hash['search_text'] = 'SearchText'
  @_hash['from_date'] = 'FromDate'
  @_hash['to_date'] = 'ToDate'
  @_hash
end

.nullablesObject

An array for nullable fields



169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/shell_data_reporting_ap_is/models/audit_request.rb', line 169

def self.nullables
  %w[
    payer_number
    payer_id
    account_number
    col_co_code
    col_co_id
    sort_order
    search_text
    from_date
    to_date
  ]
end

.optionalsObject

An array for optional fields



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/shell_data_reporting_ap_is/models/audit_request.rb', line 151

def self.optionals
  %w[
    status
    payer_number
    payer_id
    account_number
    col_co_code
    col_co_id
    accounts
    requested_operation
    sort_order
    search_text
    from_date
    to_date
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



247
248
249
250
251
252
253
254
255
# File 'lib/shell_data_reporting_ap_is/models/audit_request.rb', line 247

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} status: #{@status.inspect}, payer_number: #{@payer_number.inspect},"\
  " payer_id: #{@payer_id.inspect}, account_number: #{@account_number.inspect}, col_co_code:"\
  " #{@col_co_code.inspect}, col_co_id: #{@col_co_id.inspect}, accounts: #{@accounts.inspect},"\
  " requested_operation: #{@requested_operation.inspect}, sort_order: #{@sort_order.inspect},"\
  " search_text: #{@search_text.inspect}, from_date: #{@from_date.inspect}, to_date:"\
  " #{@to_date.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



237
238
239
240
241
242
243
244
# File 'lib/shell_data_reporting_ap_is/models/audit_request.rb', line 237

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} status: #{@status}, payer_number: #{@payer_number}, payer_id: #{@payer_id},"\
  " account_number: #{@account_number}, col_co_code: #{@col_co_code}, col_co_id:"\
  " #{@col_co_id}, accounts: #{@accounts}, requested_operation: #{@requested_operation},"\
  " sort_order: #{@sort_order}, search_text: #{@search_text}, from_date: #{@from_date},"\
  " to_date: #{@to_date}>"
end