Class: ShellDataReportingApIs::AccountRequest

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

Overview

AccountRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(status = SKIP, include_card_summary = true, payer_id = SKIP, payer_number = SKIP, page_size = SKIP, request_id = SKIP, col_co_code = SKIP, col_co_country_code = SKIP, current_page = SKIP, invoice_points_only = false, col_co_id = SKIP, return_tolls_customer_id = SKIP, accounts = SKIP, account_name = SKIP, status_list = SKIP) ⇒ AccountRequest

Returns a new instance of AccountRequest.



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/shell_data_reporting_ap_is/models/account_request.rb', line 170

def initialize(status = SKIP, include_card_summary = true, payer_id = SKIP,
               payer_number = SKIP, page_size = SKIP, request_id = SKIP,
               col_co_code = SKIP, col_co_country_code = SKIP,
               current_page = SKIP, invoice_points_only = false,
               col_co_id = SKIP, return_tolls_customer_id = SKIP,
               accounts = SKIP,  = SKIP, status_list = SKIP)
  @status = status unless status == SKIP
  @include_card_summary = include_card_summary unless include_card_summary == SKIP
  @payer_id = payer_id unless payer_id == SKIP
  @payer_number = payer_number unless payer_number == SKIP
  @page_size = page_size unless page_size == SKIP
  @request_id = request_id unless request_id == SKIP
  @col_co_code = col_co_code unless col_co_code == SKIP
  @col_co_country_code = col_co_country_code unless col_co_country_code == SKIP
  @current_page = current_page unless current_page == SKIP
  @invoice_points_only = invoice_points_only unless invoice_points_only == SKIP
  @col_co_id = col_co_id unless col_co_id == SKIP
  @return_tolls_customer_id = return_tolls_customer_id unless return_tolls_customer_id == SKIP
  @accounts = accounts unless accounts == SKIP
  @account_name =  unless  == SKIP
  @status_list = status_list unless status_list == SKIP
end

Instance Attribute Details

#account_nameString

Account Name of the customer. Optional. Minimum of 4 characters should be provided else not considered. Accounts those have the entered value at any part of the Name will be returned.

Returns:

  • (String)


97
98
99
# File 'lib/shell_data_reporting_ap_is/models/account_request.rb', line 97

def 
  @account_name
end

#accountsArray[Accounts]

Return e-Toll Customer details When True.

Returns:



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

def accounts
  @accounts
end

#col_co_codeInteger

Collecting Company Code (Shell Code) of the selected payer. ColCoCode or ColCoCountryCode is Mandatory for serviced OUs such as Romania, Latvia, Lithuania, Estonia, Ukraine etc. It is optional for other countries if ColCoID is provided.

Returns:

  • (Integer)


57
58
59
# File 'lib/shell_data_reporting_ap_is/models/account_request.rb', line 57

def col_co_code
  @col_co_code
end

#col_co_country_codeString

The 2-character ISO Code for the customer and card owning country. ColCoCode or ColCoCountryCode is Mandatory for serviced OUs such as Romania, Latvia, Lithuania, Estonia, Ukraine etc. It is optional for other countries if ColCoID is provided.

Returns:

  • (String)


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

def col_co_country_code
  @col_co_country_code
end

#col_co_idInteger

Collecting Company Id (in GFN) of the selected payer. Optional if ColCoCode or ColCoCountryCode is passed else Mandatory.

Returns:

  • (Integer)


81
82
83
# File 'lib/shell_data_reporting_ap_is/models/account_request.rb', line 81

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/account_request.rb', line 70

def current_page
  @current_page
end

#include_card_summaryTrueClass | FalseClass

Include card summary details in the response. When passed as false, the card summary related parameters on response will be set to null. Optional – default value: true.

Returns:

  • (TrueClass | FalseClass)


30
31
32
# File 'lib/shell_data_reporting_ap_is/models/account_request.rb', line 30

def include_card_summary
  @include_card_summary
end

#invoice_points_onlyTrueClass | FalseClass

Optional – default value: false. When passed as true, the API will return accounts that are configured as Invoice Point only.

Returns:

  • (TrueClass | FalseClass)


76
77
78
# File 'lib/shell_data_reporting_ap_is/models/account_request.rb', line 76

def invoice_points_only
  @invoice_points_only
end

#page_sizeInteger

Page Size – Number of records to show on a page. Optional Default value 50

Returns:

  • (Integer)


46
47
48
# File 'lib/shell_data_reporting_ap_is/models/account_request.rb', line 46

def page_size
  @page_size
end

#payer_idInteger

Payer id of the customer. Optional if PayerNumber is passed, else Mandatory.

Returns:

  • (Integer)


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

def payer_id
  @payer_id
end

#payer_numberString

PayerNumber of the customer. Optional if PayerId is passed, else Mandatory.

Returns:

  • (String)


40
41
42
# File 'lib/shell_data_reporting_ap_is/models/account_request.rb', line 40

def payer_number
  @payer_number
end

#request_idString

API Request Id

Returns:

  • (String)


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

def request_id
  @request_id
end

#return_tolls_customer_idTrueClass | FalseClass

Return e-Toll Customer details When True.

Returns:

  • (TrueClass | FalseClass)


85
86
87
# File 'lib/shell_data_reporting_ap_is/models/account_request.rb', line 85

def return_tolls_customer_id
  @return_tolls_customer_id
end

#statusString

Account Status. Optional if StatusList is passed, else mandatory. Ignored if StatusList is passed. Allowed values: • ALL • ACTIVE • BLOCKED • CANCELLED • CREDITLOCK • DELINQUENCYLOCK

Returns:

  • (String)


23
24
25
# File 'lib/shell_data_reporting_ap_is/models/account_request.rb', line 23

def status
  @status
end

#status_listArray[String]

Account Statuses. Optional Multiple statuses are allowed to be included in the search criteria. Allowed values: • ACTIVE • BLOCKED • CANCELLED • CREDITLOCK • DELINQUENCYLOCK

Returns:

  • (Array[String])


109
110
111
# File 'lib/shell_data_reporting_ap_is/models/account_request.rb', line 109

def status_list
  @status_list
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



194
195
196
197
198
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
# File 'lib/shell_data_reporting_ap_is/models/account_request.rb', line 194

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  status = hash.key?('Status') ? hash['Status'] : SKIP
  include_card_summary = hash['IncludeCardSummary'] ||= true
  payer_id = hash.key?('PayerId') ? hash['PayerId'] : SKIP
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP
  page_size = hash.key?('PageSize') ? hash['PageSize'] : SKIP
  request_id = hash.key?('RequestId') ? hash['RequestId'] : SKIP
  col_co_code = hash.key?('ColCoCode') ? hash['ColCoCode'] : SKIP
  col_co_country_code =
    hash.key?('ColCoCountryCode') ? hash['ColCoCountryCode'] : SKIP
  current_page = hash.key?('CurrentPage') ? hash['CurrentPage'] : SKIP
  invoice_points_only = hash['InvoicePointsOnly'] ||= false
  col_co_id = hash.key?('ColCoId') ? hash['ColCoId'] : SKIP
  return_tolls_customer_id =
    hash.key?('ReturnTollsCustomerId') ? hash['ReturnTollsCustomerId'] : 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')
   = hash.key?('AccountName') ? hash['AccountName'] : SKIP
  status_list = hash.key?('StatusList') ? hash['StatusList'] : SKIP

  # Create object from extracted values.
  AccountRequest.new(status,
                     include_card_summary,
                     payer_id,
                     payer_number,
                     page_size,
                     request_id,
                     col_co_code,
                     col_co_country_code,
                     current_page,
                     invoice_points_only,
                     col_co_id,
                     return_tolls_customer_id,
                     accounts,
                     ,
                     status_list)
end

.namesObject

A mapping from model property names to API property names.



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/shell_data_reporting_ap_is/models/account_request.rb', line 112

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['status'] = 'Status'
  @_hash['include_card_summary'] = 'IncludeCardSummary'
  @_hash['payer_id'] = 'PayerId'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['page_size'] = 'PageSize'
  @_hash['request_id'] = 'RequestId'
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash['col_co_country_code'] = 'ColCoCountryCode'
  @_hash['current_page'] = 'CurrentPage'
  @_hash['invoice_points_only'] = 'InvoicePointsOnly'
  @_hash['col_co_id'] = 'ColCoId'
  @_hash['return_tolls_customer_id'] = 'ReturnTollsCustomerId'
  @_hash['accounts'] = 'Accounts'
  @_hash['account_name'] = 'AccountName'
  @_hash['status_list'] = 'StatusList'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  %w[
    status
    payer_id
    payer_number
    page_size
    request_id
    col_co_code
    col_co_country_code
    current_page
    invoice_points_only
    col_co_id
    account_name
  ]
end

.optionalsObject

An array for optional fields



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/account_request.rb', line 133

def self.optionals
  %w[
    status
    include_card_summary
    payer_id
    payer_number
    page_size
    request_id
    col_co_code
    col_co_country_code
    current_page
    invoice_points_only
    col_co_id
    return_tolls_customer_id
    accounts
    account_name
    status_list
  ]
end