Class: ShellDataReportingApIs::InvoiceDatesRequestFilters

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

Overview

InvoiceDatesRequestFilters 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, col_co_id = SKIP, payer_id = SKIP, payer_number = SKIP, from_date = SKIP, to_date = SKIP, accounts = SKIP) ⇒ InvoiceDatesRequestFilters

Returns a new instance of InvoiceDatesRequestFilters.



98
99
100
101
102
103
104
105
106
107
108
# File 'lib/shell_data_reporting_ap_is/models/invoice_dates_request_filters.rb', line 98

def initialize(col_co_code = SKIP, col_co_id = SKIP, payer_id = SKIP,
               payer_number = SKIP, from_date = SKIP, to_date = SKIP,
               accounts = SKIP)
  @col_co_code = col_co_code unless col_co_code == SKIP
  @col_co_id = col_co_id unless col_co_id == SKIP
  @payer_id = payer_id unless payer_id == SKIP
  @payer_number = payer_number unless payer_number == SKIP
  @from_date = from_date unless from_date == SKIP
  @to_date = to_date unless to_date == SKIP
  @accounts = accounts unless accounts == SKIP
end

Instance Attribute Details

#accountsArray[Accounts]

Invoice date searched until this date. Optional. This input is a search criterion, if given. Date format: yyyyMMdd

Returns:



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

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-Philippines 5-UK

Returns:

  • (Integer)


19
20
21
# File 'lib/shell_data_reporting_ap_is/models/invoice_dates_request_filters.rb', line 19

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-Philippines 5-UK

Returns:

  • (Integer)


27
28
29
# File 'lib/shell_data_reporting_ap_is/models/invoice_dates_request_filters.rb', line 27

def col_co_id
  @col_co_id
end

#from_dateString

Invoice date searched from this date. Optional. This input is a search criterion, if given. Date format: yyyyMMdd

Returns:

  • (String)


44
45
46
# File 'lib/shell_data_reporting_ap_is/models/invoice_dates_request_filters.rb', line 44

def from_date
  @from_date
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/invoice_dates_request_filters.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/invoice_dates_request_filters.rb', line 37

def payer_number
  @payer_number
end

#to_dateString

Invoice date searched until this date. Optional. This input is a search criterion, if given. Date format: yyyyMMdd

Returns:

  • (String)


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

def to_date
  @to_date
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/shell_data_reporting_ap_is/models/invoice_dates_request_filters.rb', line 111

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  col_co_code = hash.key?('ColCoCode') ? hash['ColCoCode'] : SKIP
  col_co_id = hash.key?('ColCoId') ? hash['ColCoId'] : SKIP
  payer_id = hash.key?('PayerId') ? hash['PayerId'] : SKIP
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP
  from_date = hash.key?('FromDate') ? hash['FromDate'] : SKIP
  to_date = hash.key?('ToDate') ? hash['ToDate'] : 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.
  InvoiceDatesRequestFilters.new(col_co_code,
                                 col_co_id,
                                 payer_id,
                                 payer_number,
                                 from_date,
                                 to_date,
                                 accounts)
end

.namesObject

A mapping from model property names to API property names.



61
62
63
64
65
66
67
68
69
70
71
# File 'lib/shell_data_reporting_ap_is/models/invoice_dates_request_filters.rb', line 61

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash['col_co_id'] = 'ColCoId'
  @_hash['payer_id'] = 'PayerId'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['from_date'] = 'FromDate'
  @_hash['to_date'] = 'ToDate'
  @_hash['accounts'] = 'Accounts'
  @_hash
end

.nullablesObject

An array for nullable fields



87
88
89
90
91
92
93
94
95
96
# File 'lib/shell_data_reporting_ap_is/models/invoice_dates_request_filters.rb', line 87

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

.optionalsObject

An array for optional fields



74
75
76
77
78
79
80
81
82
83
84
# File 'lib/shell_data_reporting_ap_is/models/invoice_dates_request_filters.rb', line 74

def self.optionals
  %w[
    col_co_code
    col_co_id
    payer_id
    payer_number
    from_date
    to_date
    accounts
  ]
end