Class: ShellDataReportingApIs::StatementOfAccountRequestFilters

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

Overview

StatementOfAccountRequestFilters 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_code = SKIP, payer_id = SKIP, payer_number = SKIP, include_monthly_invoice_trend = SKIP, include_past_statement_of_accounts = SKIP, due_or_over_due_soa_documents_only = SKIP, number_of_soa_documents = SKIP, include_account_invoices_summary = SKIP, col_co_id = SKIP, accounts = SKIP) ⇒ StatementOfAccountRequestFilters

Returns a new instance of StatementOfAccountRequestFilters.



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_request_filters.rb', line 120

def initialize(col_co_code = SKIP, payer_id = SKIP, payer_number = SKIP,
               include_monthly_invoice_trend = SKIP,
               include_past_statement_of_accounts = SKIP,
               due_or_over_due_soa_documents_only = SKIP,
               number_of_soa_documents = SKIP,
                = SKIP, col_co_id = SKIP,
               accounts = 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
  unless include_monthly_invoice_trend == SKIP
    @include_monthly_invoice_trend =
      include_monthly_invoice_trend
  end
  unless include_past_statement_of_accounts == SKIP
    @include_past_statement_of_accounts =
      include_past_statement_of_accounts
  end
  unless due_or_over_due_soa_documents_only == SKIP
    @due_or_over_due_soa_documents_only =
      due_or_over_due_soa_documents_only
  end
  @number_of_soa_documents = number_of_soa_documents unless number_of_soa_documents == SKIP
  unless  == SKIP
    @include_account_invoices_summary =
      
  end
  @col_co_id = col_co_id unless col_co_id == SKIP
  @accounts = accounts unless accounts == SKIP
end

Instance Attribute Details

#accountsArray[Accounts]

Collecting Company Id of the selected payer. Optional If ColCo Code is passed else Mandatory.

Returns:



68
69
70
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_request_filters.rb', line 68

def accounts
  @accounts
end

#col_co_codeInteger

Collecting Company Code (Shell Code) of the selected payer. Optional If ColCo Id is passed else Mandatory.

Returns:

  • (Integer)


15
16
17
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_request_filters.rb', line 15

def col_co_code
  @col_co_code
end

#col_co_idInteger

Collecting Company Id of the selected payer. Optional If ColCo Code is passed else Mandatory.

Returns:

  • (Integer)


63
64
65
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_request_filters.rb', line 63

def col_co_id
  @col_co_id
end

#due_or_over_due_soa_documents_onlyTrueClass | FalseClass

True/False Optional Default is False. If true PastStatementOfAccounts entity on this API output should contain the SOA documents that are due or overdue only.

Returns:

  • (TrueClass | FalseClass)


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

def due_or_over_due_soa_documents_only
  @due_or_over_due_soa_documents_only
end

#include_account_invoices_summaryTrueClass | FalseClass

True/False Optional. Default value is false. When true InvoicesSummaries list will be returned in the API output.

Returns:

  • (TrueClass | FalseClass)


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

def 
  @include_account_invoices_summary
end

#include_monthly_invoice_trendTrueClass | FalseClass

True/False. Optional. Default is False. True if the past 13 monthly invoice trend to be included as part of the response. Else false.

Returns:

  • (TrueClass | FalseClass)


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

def include_monthly_invoice_trend
  @include_monthly_invoice_trend
end

#include_past_statement_of_accountsTrueClass | FalseClass

True/False. Optional. Default is False. True if the past X SOA documents are to be included as part of the response. Else false.

Returns:

  • (TrueClass | FalseClass)


39
40
41
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_request_filters.rb', line 39

def include_past_statement_of_accounts
  @include_past_statement_of_accounts
end

#number_of_soa_documentsInteger

This parameter is only applicable when “IncludePastStatementOfAccounts” parameter is set to True.

Returns:

  • (Integer)


51
52
53
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_request_filters.rb', line 51

def number_of_soa_documents
  @number_of_soa_documents
end

#payer_idInteger

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

Returns:

  • (Integer)


20
21
22
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_request_filters.rb', line 20

def payer_id
  @payer_id
end

#payer_numberString

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

Returns:

  • (String)


25
26
27
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_request_filters.rb', line 25

def payer_number
  @payer_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_request_filters.rb', line 152

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  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
  include_monthly_invoice_trend =
    hash.key?('IncludeMonthlyInvoiceTrend') ? hash['IncludeMonthlyInvoiceTrend'] : SKIP
  include_past_statement_of_accounts =
    hash.key?('IncludePastStatementOfAccounts') ? hash['IncludePastStatementOfAccounts'] : SKIP
  due_or_over_due_soa_documents_only =
    hash.key?('DueOrOverDueSOADocumentsOnly') ? hash['DueOrOverDueSOADocumentsOnly'] : SKIP
  number_of_soa_documents =
    hash.key?('NumberOfSOADocuments') ? hash['NumberOfSOADocuments'] : SKIP
   =
    hash.key?('IncludeAccountInvoicesSummary') ? hash['IncludeAccountInvoicesSummary'] : SKIP
  col_co_id = hash.key?('ColCoId') ? hash['ColCoId'] : 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')

  # Create object from extracted values.
  StatementOfAccountRequestFilters.new(col_co_code,
                                       payer_id,
                                       payer_number,
                                       include_monthly_invoice_trend,
                                       include_past_statement_of_accounts,
                                       due_or_over_due_soa_documents_only,
                                       number_of_soa_documents,
                                       ,
                                       col_co_id,
                                       accounts)
end

.namesObject

A mapping from model property names to API property names.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_request_filters.rb', line 71

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash['payer_id'] = 'PayerId'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['include_monthly_invoice_trend'] = 'IncludeMonthlyInvoiceTrend'
  @_hash['include_past_statement_of_accounts'] =
    'IncludePastStatementOfAccounts'
  @_hash['due_or_over_due_soa_documents_only'] =
    'DueOrOverDueSOADocumentsOnly'
  @_hash['number_of_soa_documents'] = 'NumberOfSOADocuments'
  @_hash['include_account_invoices_summary'] =
    'IncludeAccountInvoicesSummary'
  @_hash['col_co_id'] = 'ColCoId'
  @_hash['accounts'] = 'Accounts'
  @_hash
end

.nullablesObject

An array for nullable fields



106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_request_filters.rb', line 106

def self.nullables
  %w[
    col_co_code
    payer_id
    payer_number
    include_monthly_invoice_trend
    include_past_statement_of_accounts
    due_or_over_due_soa_documents_only
    number_of_soa_documents
    include_account_invoices_summary
    col_co_id
  ]
end

.optionalsObject

An array for optional fields



90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_request_filters.rb', line 90

def self.optionals
  %w[
    col_co_code
    payer_id
    payer_number
    include_monthly_invoice_trend
    include_past_statement_of_accounts
    due_or_over_due_soa_documents_only
    number_of_soa_documents
    include_account_invoices_summary
    col_co_id
    accounts
  ]
end