Class: ShellDataReportingApIs::EIDSearchReq

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

Overview

EIDSearchReq 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 = nil, account_group_country = nil, account_group_id = nil, account_group_name = SKIP, from_date = SKIP, to_date = SKIP, invoice_type = SKIP, invoice_status = SKIP, sort_by = SKIP) ⇒ EIDSearchReq

Returns a new instance of EIDSearchReq.



110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/shell_data_reporting_ap_is/models/eid_search_req.rb', line 110

def initialize(col_co_code = nil,  = nil,
                = nil,  = SKIP,
               from_date = SKIP, to_date = SKIP, invoice_type = SKIP,
               invoice_status = SKIP, sort_by = SKIP)
  @col_co_code = col_co_code
  @account_group_country = 
  @account_group_id = 
  @account_group_name =  unless  == SKIP
  @from_date = from_date unless from_date == SKIP
  @to_date = to_date unless to_date == SKIP
  @invoice_type = invoice_type unless invoice_type == SKIP
  @invoice_status = invoice_status unless invoice_status == SKIP
  @sort_by = sort_by unless sort_by == SKIP
end

Instance Attribute Details

#account_group_countryInteger

Country code (colco code) of the account group. Mandatory

Returns:

  • (Integer)


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

def 
  @account_group_country
end

#account_group_idArray[String]

List of IDs of the account groups that user has access to. Mandatory

Returns:

  • (Array[String])


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

def 
  @account_group_id
end

#account_group_nameString

Account group name Optional. This input is a search criterion, if given.

Returns:

  • (String)


31
32
33
# File 'lib/shell_data_reporting_ap_is/models/eid_search_req.rb', line 31

def 
  @account_group_name
end

#col_co_codeInteger

Collecting Company Code of the selected payer. Mandatory

Returns:

  • (Integer)


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

def col_co_code
  @col_co_code
end

#from_dateString

EID date searched from this date. Optional.

Returns:

  • (String)


36
37
38
# File 'lib/shell_data_reporting_ap_is/models/eid_search_req.rb', line 36

def from_date
  @from_date
end

#invoice_statusString

Status of the document. Optional. Possible values: • NEW • VIEWED • DOWNLOADED • RESTORED

Returns:

  • (String)


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

def invoice_status
  @invoice_status
end

#invoice_typeString

Invoice type. Optional. Possible values: • NAT (National) • INT (International)

Returns:

  • (String)


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

def invoice_type
  @invoice_type
end

#sort_byArray[String]

Sort option – • InvoiceNumber ASC • InvoiceDate ASC • InvoiceNumber DESC • InvoiceDate DESC Optional

Returns:

  • (Array[String])


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

def sort_by
  @sort_by
end

#to_dateString

Invoice date searched until this date. Optional.

Returns:

  • (String)


41
42
43
# File 'lib/shell_data_reporting_ap_is/models/eid_search_req.rb', line 41

def to_date
  @to_date
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/shell_data_reporting_ap_is/models/eid_search_req.rb', line 126

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  col_co_code = hash.key?('ColCoCode') ? hash['ColCoCode'] : nil
   =
    hash.key?('AccountGroupCountry') ? hash['AccountGroupCountry'] : nil
   =
    hash.key?('AccountGroupId') ? hash['AccountGroupId'] : nil
   =
    hash.key?('AccountGroupName') ? hash['AccountGroupName'] : SKIP
  from_date = hash.key?('FromDate') ? hash['FromDate'] : SKIP
  to_date = hash.key?('ToDate') ? hash['ToDate'] : SKIP
  invoice_type = hash.key?('InvoiceType') ? hash['InvoiceType'] : SKIP
  invoice_status = hash.key?('InvoiceStatus') ? hash['InvoiceStatus'] : SKIP
  sort_by = hash.key?('SortBy') ? hash['SortBy'] : SKIP

  # Create object from extracted values.
  EIDSearchReq.new(col_co_code,
                   ,
                   ,
                   ,
                   from_date,
                   to_date,
                   invoice_type,
                   invoice_status,
                   sort_by)
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
# File 'lib/shell_data_reporting_ap_is/models/eid_search_req.rb', line 71

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash['account_group_country'] = 'AccountGroupCountry'
  @_hash['account_group_id'] = 'AccountGroupId'
  @_hash['account_group_name'] = 'AccountGroupName'
  @_hash['from_date'] = 'FromDate'
  @_hash['to_date'] = 'ToDate'
  @_hash['invoice_type'] = 'InvoiceType'
  @_hash['invoice_status'] = 'InvoiceStatus'
  @_hash['sort_by'] = 'SortBy'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  %w[
    col_co_code
    account_group_country
    account_group_name
    from_date
    to_date
    invoice_type
    invoice_status
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    account_group_name
    from_date
    to_date
    invoice_type
    invoice_status
    sort_by
  ]
end