Class: ShellDataReportingApIs::SearchDocReq

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

Overview

SearchDocReq 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(payer_number = nil, col_co_code = nil, account_number = SKIP, account_number_list = SKIP, invoice_number = SKIP, invoice_number_list = SKIP, issuing_date_from = SKIP, issuing_date_to = SKIP, due_date_from = SKIP, due_date_to = SKIP, gross_amount = SKIP, gross_amount_operator = SKIP, document_type = SKIP, vat_issuer_country = SKIP, sorty_by = SKIP) ⇒ SearchDocReq

Returns a new instance of SearchDocReq.



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

def initialize(payer_number = nil, col_co_code = nil,  = SKIP,
                = SKIP, invoice_number = SKIP,
               invoice_number_list = SKIP, issuing_date_from = SKIP,
               issuing_date_to = SKIP, due_date_from = SKIP,
               due_date_to = SKIP, gross_amount = SKIP,
               gross_amount_operator = SKIP, document_type = SKIP,
               vat_issuer_country = SKIP, sorty_by = SKIP)
  @payer_number = payer_number
  @account_number =  unless  == SKIP
  @account_number_list =  unless  == SKIP
  @invoice_number = invoice_number unless invoice_number == SKIP
  @invoice_number_list = invoice_number_list unless invoice_number_list == SKIP
  @issuing_date_from = issuing_date_from unless issuing_date_from == SKIP
  @issuing_date_to = issuing_date_to unless issuing_date_to == SKIP
  @due_date_from = due_date_from unless due_date_from == SKIP
  @due_date_to = due_date_to unless due_date_to == SKIP
  @gross_amount = gross_amount unless gross_amount == SKIP
  @gross_amount_operator = gross_amount_operator unless gross_amount_operator == SKIP
  @document_type = document_type unless document_type == SKIP
  @vat_issuer_country = vat_issuer_country unless vat_issuer_country == SKIP
  @sorty_by = sorty_by unless sorty_by == SKIP
  @col_co_code = col_co_code
end

Instance Attribute Details

#account_numberString

Account Number of the customer. Mandatory for customer users else optional. This input is a search criterion, if given. Example: GB000000123

Returns:

  • (String)


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

def 
  @account_number
end

#account_number_listArray[String]

Account Number of the customers. optional. This input is a search criterion, if given. Example: [“GB00000123”, “GB00000225”]

Returns:

  • (Array[String])


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

def 
  @account_number_list
end

#col_co_codeInteger

Collecting Company Code of the selected payer. Mandatory Example: 86-Philippines 5-UK

Returns:

  • (Integer)


115
116
117
# File 'lib/shell_data_reporting_ap_is/models/search_doc_req.rb', line 115

def col_co_code
  @col_co_code
end

#document_typeString

Document Type Optional One of the following values: • NAT (National) • INT (International) • SOA (Statement of Account)

Returns:

  • (String)


95
96
97
# File 'lib/shell_data_reporting_ap_is/models/search_doc_req.rb', line 95

def document_type
  @document_type
end

#due_date_fromString

Invoice Due Date Range/From Optional Format: yyyy/MM/dd

Returns:

  • (String)


61
62
63
# File 'lib/shell_data_reporting_ap_is/models/search_doc_req.rb', line 61

def due_date_from
  @due_date_from
end

#due_date_toString

Invoice Due Date Range/To Optional Format: yyyy/MM/dd

Returns:

  • (String)


67
68
69
# File 'lib/shell_data_reporting_ap_is/models/search_doc_req.rb', line 67

def due_date_to
  @due_date_to
end

#gross_amountString

Gross amount of the bill. Optional

Returns:

  • (String)


72
73
74
# File 'lib/shell_data_reporting_ap_is/models/search_doc_req.rb', line 72

def gross_amount
  @gross_amount
end

#gross_amount_operatorString

Criteria on the gross amount, for instance use GT when to retrieve the invoices for that gross amount is greater than the given amount on GrossAmount parameter above. Optional This parameter will be ignored if GrossAmount parameter is not set. One of the following values: • LT (Less Than) • LE (Lesser or Equal) • EQ (equal) • GE (Greater or equal) • GT (Greater than)

Returns:

  • (String)


86
87
88
# File 'lib/shell_data_reporting_ap_is/models/search_doc_req.rb', line 86

def gross_amount_operator
  @gross_amount_operator
end

#invoice_numberString

Invoice number. Optional if InvoiceNumberList is passed else Mandatory This input is a search criterion, if given. Example: 0123456789

Returns:

  • (String)


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

def invoice_number
  @invoice_number
end

#invoice_number_listArray[String]

List of Invoice number. Optional if InvoiceNumber is passed else Mandatory Example: [“0123456789”, “0123459799”]

Returns:

  • (Array[String])


43
44
45
# File 'lib/shell_data_reporting_ap_is/models/search_doc_req.rb', line 43

def invoice_number_list
  @invoice_number_list
end

#issuing_date_fromString

Invoice Issuing Date Range/From Optional Format: yyyy/MM/dd

Returns:

  • (String)


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

def issuing_date_from
  @issuing_date_from
end

#issuing_date_toString

Invoice Issuing Date Range/To Optional Format: yyyy/MM/dd

Returns:

  • (String)


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

def issuing_date_to
  @issuing_date_to
end

#payer_numberString

Payer Number of the selected payer. Mandatory Example: GB000000123

Returns:

  • (String)


16
17
18
# File 'lib/shell_data_reporting_ap_is/models/search_doc_req.rb', line 16

def payer_number
  @payer_number
end

#sorty_byArray[String]

Collecting Company Code of the selected payer. Mandatory Example: 86-Philippines 5-UK

Returns:

  • (Array[String])


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

def sorty_by
  @sorty_by
end

#vat_issuer_countryString

Two letter ISO country code.

Returns:

  • (String)


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

def vat_issuer_country
  @vat_issuer_country
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/shell_data_reporting_ap_is/models/search_doc_req.rb', line 200

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : nil
  col_co_code = hash.key?('ColCoCode') ? hash['ColCoCode'] : nil
   = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
   =
    hash.key?('AccountNumberList') ? hash['AccountNumberList'] : SKIP
  invoice_number = hash.key?('InvoiceNumber') ? hash['InvoiceNumber'] : SKIP
  invoice_number_list =
    hash.key?('InvoiceNumberList') ? hash['InvoiceNumberList'] : SKIP
  issuing_date_from =
    hash.key?('IssuingDateFrom') ? hash['IssuingDateFrom'] : SKIP
  issuing_date_to =
    hash.key?('IssuingDateTo') ? hash['IssuingDateTo'] : SKIP
  due_date_from = hash.key?('DueDateFrom') ? hash['DueDateFrom'] : SKIP
  due_date_to = hash.key?('DueDateTo') ? hash['DueDateTo'] : SKIP
  gross_amount = hash.key?('GrossAmount') ? hash['GrossAmount'] : SKIP
  gross_amount_operator =
    hash.key?('GrossAmountOperator') ? hash['GrossAmountOperator'] : SKIP
  document_type = hash.key?('DocumentType') ? hash['DocumentType'] : SKIP
  vat_issuer_country =
    hash.key?('VATIssuerCountry') ? hash['VATIssuerCountry'] : SKIP
  sorty_by = hash.key?('SortyBy') ? hash['SortyBy'] : SKIP

  # Create object from extracted values.
  SearchDocReq.new(payer_number,
                   col_co_code,
                   ,
                   ,
                   invoice_number,
                   invoice_number_list,
                   issuing_date_from,
                   issuing_date_to,
                   due_date_from,
                   due_date_to,
                   gross_amount,
                   gross_amount_operator,
                   document_type,
                   vat_issuer_country,
                   sorty_by)
end

.namesObject

A mapping from model property names to API property names.



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/shell_data_reporting_ap_is/models/search_doc_req.rb', line 118

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['account_number'] = 'AccountNumber'
  @_hash['account_number_list'] = 'AccountNumberList'
  @_hash['invoice_number'] = 'InvoiceNumber'
  @_hash['invoice_number_list'] = 'InvoiceNumberList'
  @_hash['issuing_date_from'] = 'IssuingDateFrom'
  @_hash['issuing_date_to'] = 'IssuingDateTo'
  @_hash['due_date_from'] = 'DueDateFrom'
  @_hash['due_date_to'] = 'DueDateTo'
  @_hash['gross_amount'] = 'GrossAmount'
  @_hash['gross_amount_operator'] = 'GrossAmountOperator'
  @_hash['document_type'] = 'DocumentType'
  @_hash['vat_issuer_country'] = 'VATIssuerCountry'
  @_hash['sorty_by'] = 'SortyBy'
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash
end

.nullablesObject

An array for nullable fields



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/shell_data_reporting_ap_is/models/search_doc_req.rb', line 158

def self.nullables
  %w[
    payer_number
    account_number
    invoice_number
    issuing_date_from
    issuing_date_to
    due_date_from
    due_date_to
    gross_amount
    gross_amount_operator
    document_type
    vat_issuer_country
    col_co_code
  ]
end

.optionalsObject

An array for optional fields



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/shell_data_reporting_ap_is/models/search_doc_req.rb', line 139

def self.optionals
  %w[
    account_number
    account_number_list
    invoice_number
    invoice_number_list
    issuing_date_from
    issuing_date_to
    due_date_from
    due_date_to
    gross_amount
    gross_amount_operator
    document_type
    vat_issuer_country
    sorty_by
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/shell_data_reporting_ap_is/models/search_doc_req.rb', line 257

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} payer_number: #{@payer_number.inspect}, account_number:"\
  " #{@account_number.inspect}, account_number_list: #{@account_number_list.inspect},"\
  " invoice_number: #{@invoice_number.inspect}, invoice_number_list:"\
  " #{@invoice_number_list.inspect}, issuing_date_from: #{@issuing_date_from.inspect},"\
  " issuing_date_to: #{@issuing_date_to.inspect}, due_date_from: #{@due_date_from.inspect},"\
  " due_date_to: #{@due_date_to.inspect}, gross_amount: #{@gross_amount.inspect},"\
  " gross_amount_operator: #{@gross_amount_operator.inspect}, document_type:"\
  " #{@document_type.inspect}, vat_issuer_country: #{@vat_issuer_country.inspect}, sorty_by:"\
  " #{@sorty_by.inspect}, col_co_code: #{@col_co_code.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



245
246
247
248
249
250
251
252
253
254
# File 'lib/shell_data_reporting_ap_is/models/search_doc_req.rb', line 245

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} payer_number: #{@payer_number}, account_number: #{@account_number},"\
  " account_number_list: #{@account_number_list}, invoice_number: #{@invoice_number},"\
  " invoice_number_list: #{@invoice_number_list}, issuing_date_from: #{@issuing_date_from},"\
  " issuing_date_to: #{@issuing_date_to}, due_date_from: #{@due_date_from}, due_date_to:"\
  " #{@due_date_to}, gross_amount: #{@gross_amount}, gross_amount_operator:"\
  " #{@gross_amount_operator}, document_type: #{@document_type}, vat_issuer_country:"\
  " #{@vat_issuer_country}, sorty_by: #{@sorty_by}, col_co_code: #{@col_co_code}>"
end