Class: ShellDataReportingApIs::InvoiceSearchRequest

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

Overview

InvoiceSearchRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(filters = SKIP, page_size = SKIP, page = SKIP, sort_by = SKIP) ⇒ InvoiceSearchRequest

Returns a new instance of InvoiceSearchRequest.



64
65
66
67
68
69
70
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request.rb', line 64

def initialize(filters = SKIP, page_size = SKIP, page = SKIP,
               sort_by = SKIP)
  @filters = filters unless filters == SKIP
  @page_size = page_size unless page_size == SKIP
  @page = page unless page == SKIP
  @sort_by = sort_by unless sort_by == SKIP
end

Instance Attribute Details

#filtersInvoiceSearchRequestFilters

TODO: Write general description for this method



14
15
16
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request.rb', line 14

def filters
  @filters
end

#pageInteger

TODO: Write general description for this method

Returns:

  • (Integer)


22
23
24
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request.rb', line 22

def page
  @page
end

#page_sizeInteger

TODO: Write general description for this method

Returns:

  • (Integer)


18
19
20
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request.rb', line 18

def page_size
  @page_size
end

#sort_byArray[Integer]

Sort option –

  1. InvoiceDate ASC

  2. InvoiceDate DESC

  3. NetAmountCustomerCurrency ASC

  4. NetAmountCustomerCurrency DESC

Optional Note: This option uses a column name with a combination of “ASC or DESC” for sorting. If only the column name is provided, it is sorted by ascending. Example values to be passed:

“InvoiceDate”, “NetAmountCustomerCurrency DESC”

Returns:

  • (Array[Integer])


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

def sort_by
  @sort_by
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  filters = InvoiceSearchRequestFilters.from_hash(hash['Filters']) if hash['Filters']
  page_size = hash.key?('PageSize') ? hash['PageSize'] : SKIP
  page = hash.key?('Page') ? hash['Page'] : SKIP
  sort_by = hash.key?('SortBy') ? hash['SortBy'] : SKIP

  # Create object from extracted values.
  InvoiceSearchRequest.new(filters,
                           page_size,
                           page,
                           sort_by)
end

.namesObject

A mapping from model property names to API property names.



40
41
42
43
44
45
46
47
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request.rb', line 40

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['filters'] = 'Filters'
  @_hash['page_size'] = 'PageSize'
  @_hash['page'] = 'Page'
  @_hash['sort_by'] = 'SortBy'
  @_hash
end

.nullablesObject

An array for nullable fields



60
61
62
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request.rb', line 60

def self.nullables
  []
end

.optionalsObject

An array for optional fields



50
51
52
53
54
55
56
57
# File 'lib/shell_data_reporting_ap_is/models/invoice_search_request.rb', line 50

def self.optionals
  %w[
    filters
    page_size
    page
    sort_by
  ]
end