Class: FreightFinancialsWebhookIngestionApi::PagedResponseOfInvoice
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FreightFinancialsWebhookIngestionApi::PagedResponseOfInvoice
- Defined in:
- lib/freight_financials_webhook_ingestion_api/models/paged_response_of_invoice.rb
Overview
PagedResponseOfInvoice Model.
Instance Attribute Summary collapse
-
#page_number ⇒ Integer
TODO: Write general description for this method.
-
#page_size ⇒ Integer
TODO: Write general description for this method.
-
#results ⇒ Array[Invoice]
TODO: Write general description for this method.
-
#total_count ⇒ Integer
TODO: Write general description for this method.
-
#total_pages ⇒ Integer
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(page_number: SKIP, page_size: SKIP, total_count: SKIP, total_pages: SKIP, results: SKIP) ⇒ PagedResponseOfInvoice
constructor
A new instance of PagedResponseOfInvoice.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(page_number: SKIP, page_size: SKIP, total_count: SKIP, total_pages: SKIP, results: SKIP) ⇒ PagedResponseOfInvoice
Returns a new instance of PagedResponseOfInvoice.
59 60 61 62 63 64 65 66 |
# File 'lib/freight_financials_webhook_ingestion_api/models/paged_response_of_invoice.rb', line 59 def initialize(page_number: SKIP, page_size: SKIP, total_count: SKIP, total_pages: SKIP, results: SKIP) @page_number = page_number unless page_number == SKIP @page_size = page_size unless page_size == SKIP @total_count = total_count unless total_count == SKIP @total_pages = total_pages unless total_pages == SKIP @results = results unless results == SKIP end |
Instance Attribute Details
#page_number ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/freight_financials_webhook_ingestion_api/models/paged_response_of_invoice.rb', line 14 def page_number @page_number end |
#page_size ⇒ Integer
TODO: Write general description for this method
18 19 20 |
# File 'lib/freight_financials_webhook_ingestion_api/models/paged_response_of_invoice.rb', line 18 def page_size @page_size end |
#results ⇒ Array[Invoice]
TODO: Write general description for this method
30 31 32 |
# File 'lib/freight_financials_webhook_ingestion_api/models/paged_response_of_invoice.rb', line 30 def results @results end |
#total_count ⇒ Integer
TODO: Write general description for this method
22 23 24 |
# File 'lib/freight_financials_webhook_ingestion_api/models/paged_response_of_invoice.rb', line 22 def total_count @total_count end |
#total_pages ⇒ Integer
TODO: Write general description for this method
26 27 28 |
# File 'lib/freight_financials_webhook_ingestion_api/models/paged_response_of_invoice.rb', line 26 def total_pages @total_pages end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/freight_financials_webhook_ingestion_api/models/paged_response_of_invoice.rb', line 69 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. page_number = hash.key?('pageNumber') ? hash['pageNumber'] : SKIP page_size = hash.key?('pageSize') ? hash['pageSize'] : SKIP total_count = hash.key?('totalCount') ? hash['totalCount'] : SKIP total_pages = hash.key?('totalPages') ? hash['totalPages'] : SKIP # Parameter is an array, so we need to iterate through it results = nil unless hash['results'].nil? results = [] hash['results'].each do |structure| results << (Invoice.from_hash(structure) if structure) end end results = SKIP unless hash.key?('results') # Create object from extracted values. PagedResponseOfInvoice.new(page_number: page_number, page_size: page_size, total_count: total_count, total_pages: total_pages, results: results) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/freight_financials_webhook_ingestion_api/models/paged_response_of_invoice.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['page_number'] = 'pageNumber' @_hash['page_size'] = 'pageSize' @_hash['total_count'] = 'totalCount' @_hash['total_pages'] = 'totalPages' @_hash['results'] = 'results' @_hash end |
.nullables ⇒ Object
An array for nullable fields
55 56 57 |
# File 'lib/freight_financials_webhook_ingestion_api/models/paged_response_of_invoice.rb', line 55 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 52 |
# File 'lib/freight_financials_webhook_ingestion_api/models/paged_response_of_invoice.rb', line 44 def self.optionals %w[ page_number page_size total_count total_pages results ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
104 105 106 107 108 109 |
# File 'lib/freight_financials_webhook_ingestion_api/models/paged_response_of_invoice.rb', line 104 def inspect class_name = self.class.name.split('::').last "<#{class_name} page_number: #{@page_number.inspect}, page_size: #{@page_size.inspect},"\ " total_count: #{@total_count.inspect}, total_pages: #{@total_pages.inspect}, results:"\ " #{@results.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
97 98 99 100 101 |
# File 'lib/freight_financials_webhook_ingestion_api/models/paged_response_of_invoice.rb', line 97 def to_s class_name = self.class.name.split('::').last "<#{class_name} page_number: #{@page_number}, page_size: #{@page_size}, total_count:"\ " #{@total_count}, total_pages: #{@total_pages}, results: #{@results}>" end |