Class: ShellDataReportingApIs::TransactionExceptionsRequest

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

Overview

TransactionExceptionsRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(transactions_from_date = nil, transactions_to_date = nil, condition = nil, output_type = nil, col_co_id = SKIP, col_co_code = SKIP, payer_id = SKIP, payer_number = SKIP, accounts = SKIP, value = SKIP, products = SKIP, exception_period = SKIP, fuel_only = SKIP, site_group_ids = SKIP, use_field_id = SKIP) ⇒ TransactionExceptionsRequest

Returns a new instance of TransactionExceptionsRequest.



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb', line 175

def initialize(transactions_from_date = nil, transactions_to_date = nil,
               condition = nil, output_type = nil, col_co_id = SKIP,
               col_co_code = SKIP, payer_id = SKIP, payer_number = SKIP,
               accounts = SKIP, value = SKIP, products = SKIP,
               exception_period = SKIP, fuel_only = SKIP,
               site_group_ids = SKIP, use_field_id = 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
  @accounts = accounts unless accounts == SKIP
  @transactions_from_date = transactions_from_date
  @transactions_to_date = transactions_to_date
  @value = value unless value == SKIP
  @condition = condition
  @products = products unless products == SKIP
  @exception_period = exception_period unless exception_period == SKIP
  @output_type = output_type
  @fuel_only = fuel_only unless fuel_only == SKIP
  @site_group_ids = site_group_ids unless site_group_ids == SKIP
  @use_field_id = use_field_id unless use_field_id == SKIP
end

Instance Attribute Details

#accountsArray[Accounts]

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

Returns:



42
43
44
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb', line 42

def accounts
  @accounts
end

#col_co_codeInteger

Collecting Company 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/transaction_exceptions_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/transaction_exceptions_request.rb', line 18

def col_co_id
  @col_co_id
end

#conditionInteger

Filter condition for the Exceptions. Mandatory

  1. VolumeGreaterThan

  2. VolumeLessThan

  3. UsageGreaterThan

  4. UsageLessThan

  5. ValueGreaterThan (in Customer Currency)

  6. ValueLessThan (in Customer Currency)

Note: - When “OutputType” = 1 is passed as input, above 3 and 4 Condition are not applicable.

Returns:

  • (Integer)


73
74
75
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb', line 73

def condition
  @condition
end

#exception_periodInteger

Period in which the Exceptions such as Monthly/Weekly or Daily volume, value or usage to be identified in the given transactions date range. It is only applied when the Output Type is specified as “Cards”. Mandatory when Output Type is Cards

  1. Month

  2. Week

  3. Day

  4. Date Range

Returns:

  • (Integer)


98
99
100
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb', line 98

def exception_period
  @exception_period
end

#fuel_onlyTrueClass | FalseClass

True/False Optional Default value: False. When passed as ‘True’ Only returned records with Fuel transactions. When passed as ‘False’ the above condition will not be checked.

Returns:

  • (TrueClass | FalseClass)


114
115
116
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb', line 114

def fuel_only
  @fuel_only
end

#output_typeInteger

Output Type for Exceptions. Mandatory. Possible values:

  1. Transactions

  2. Cards

Returns:

  • (Integer)


106
107
108
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb', line 106

def output_type
  @output_type
end

#payer_idInteger

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

Returns:

  • (Integer)


32
33
34
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb', line 32

def payer_id
  @payer_id
end

#payer_numberString

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

Returns:

  • (String)


37
38
39
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb', line 37

def payer_number
  @payer_number
end

#productsArray[ExceptionProduct]

Filter condition for the Exceptions. Mandatory

  1. VolumeGreaterThan

  2. VolumeLessThan

  3. UsageGreaterThan

  4. UsageLessThan

  5. ValueGreaterThan (in Customer Currency)

  6. ValueLessThan (in Customer Currency)

Note: - When “OutputType” = 1 is passed as input, above 3 and 4 Condition are not applicable.

Returns:



87
88
89
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb', line 87

def products
  @products
end

#site_group_idsArray[Integer]

SiteGroupIds to be applied to the Filter Condition. Optional When not passed, ignored. When passed, transactions that are matching with the provided list of site group id’s are only returned.

Returns:

  • (Array[Integer])


122
123
124
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb', line 122

def site_group_ids
  @site_group_ids
end

#transactions_from_dateString

Exceptions to be searched in transactions from date. Should be with in last 24 months from the ToDate parameter. Mandatory Format: yyyyMMdd

Returns:

  • (String)


49
50
51
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb', line 49

def transactions_from_date
  @transactions_from_date
end

#transactions_to_dateString

Exceptions to be searched in transactions until date. Mandatory. Format: yyyyMMdd

Returns:

  • (String)


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

def transactions_to_date
  @transactions_to_date
end

#use_field_idTrueClass | FalseClass

True/False Optional Default value – False. When set to True, the property names in the output will be replaced by Field IDs.

Returns:

  • (TrueClass | FalseClass)


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

def use_field_id
  @use_field_id
end

#valueFloat

Value to be used on the Filter Condition

Returns:

  • (Float)


59
60
61
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb', line 59

def value
  @value
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



199
200
201
202
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb', line 199

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  transactions_from_date =
    hash.key?('TransactionsFromDate') ? hash['TransactionsFromDate'] : nil
  transactions_to_date =
    hash.key?('TransactionsToDate') ? hash['TransactionsToDate'] : nil
  condition = hash.key?('Condition') ? hash['Condition'] : nil
  output_type = hash.key?('OutputType') ? hash['OutputType'] : nil
  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
  accounts = nil
  unless hash['Accounts'].nil?
    accounts = []
    hash['Accounts'].each do |structure|
      accounts << (Accounts.from_hash(structure) if structure)
    end
  end

  accounts = SKIP unless hash.key?('Accounts')
  value = hash.key?('Value') ? hash['Value'] : SKIP
  # Parameter is an array, so we need to iterate through it
  products = nil
  unless hash['Products'].nil?
    products = []
    hash['Products'].each do |structure|
      products << (ExceptionProduct.from_hash(structure) if structure)
    end
  end

  products = SKIP unless hash.key?('Products')
  exception_period =
    hash.key?('ExceptionPeriod') ? hash['ExceptionPeriod'] : SKIP
  fuel_only = hash.key?('FuelOnly') ? hash['FuelOnly'] : SKIP
  site_group_ids = hash.key?('SiteGroupIds') ? hash['SiteGroupIds'] : SKIP
  use_field_id = hash.key?('UseFieldId') ? hash['UseFieldId'] : SKIP

  # Create object from extracted values.
  TransactionExceptionsRequest.new(transactions_from_date,
                                   transactions_to_date,
                                   condition,
                                   output_type,
                                   col_co_id,
                                   col_co_code,
                                   payer_id,
                                   payer_number,
                                   accounts,
                                   value,
                                   products,
                                   exception_period,
                                   fuel_only,
                                   site_group_ids,
                                   use_field_id)
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
149
150
151
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb', line 133

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['accounts'] = 'Accounts'
  @_hash['transactions_from_date'] = 'TransactionsFromDate'
  @_hash['transactions_to_date'] = 'TransactionsToDate'
  @_hash['value'] = 'Value'
  @_hash['condition'] = 'Condition'
  @_hash['products'] = 'Products'
  @_hash['exception_period'] = 'ExceptionPeriod'
  @_hash['output_type'] = 'OutputType'
  @_hash['fuel_only'] = 'FuelOnly'
  @_hash['site_group_ids'] = 'SiteGroupIds'
  @_hash['use_field_id'] = 'UseFieldId'
  @_hash
end

.nullablesObject

An array for nullable fields



171
172
173
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb', line 171

def self.nullables
  []
end

.optionalsObject

An array for optional fields



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb', line 154

def self.optionals
  %w[
    col_co_id
    col_co_code
    payer_id
    payer_number
    accounts
    value
    products
    exception_period
    fuel_only
    site_group_ids
    use_field_id
  ]
end