Class: AdvancedBilling::ListInvoiceEventsResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::ListInvoiceEventsResponse
- Defined in:
- lib/advanced_billing/models/list_invoice_events_response.rb
Overview
ListInvoiceEventsResponse Model.
Instance Attribute Summary collapse
-
#events ⇒ Array[InvoiceEvent]
TODO: Write general description for this method.
-
#page ⇒ Integer
TODO: Write general description for this method.
-
#per_page ⇒ 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(events = SKIP, page = SKIP, per_page = SKIP, total_pages = SKIP) ⇒ ListInvoiceEventsResponse
constructor
A new instance of ListInvoiceEventsResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(events = SKIP, page = SKIP, per_page = SKIP, total_pages = SKIP) ⇒ ListInvoiceEventsResponse
Returns a new instance of ListInvoiceEventsResponse.
53 54 55 56 57 58 59 |
# File 'lib/advanced_billing/models/list_invoice_events_response.rb', line 53 def initialize(events = SKIP, page = SKIP, per_page = SKIP, total_pages = SKIP) @events = events unless events == SKIP @page = page unless page == SKIP @per_page = per_page unless per_page == SKIP @total_pages = total_pages unless total_pages == SKIP end |
Instance Attribute Details
#events ⇒ Array[InvoiceEvent]
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/list_invoice_events_response.rb', line 14 def events @events end |
#page ⇒ Integer
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/list_invoice_events_response.rb', line 18 def page @page end |
#per_page ⇒ Integer
TODO: Write general description for this method
22 23 24 |
# File 'lib/advanced_billing/models/list_invoice_events_response.rb', line 22 def per_page @per_page end |
#total_pages ⇒ Integer
TODO: Write general description for this method
26 27 28 |
# File 'lib/advanced_billing/models/list_invoice_events_response.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.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/advanced_billing/models/list_invoice_events_response.rb', line 62 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it events = nil unless hash['events'].nil? events = [] hash['events'].each do |structure| events << (InvoiceEvent.from_hash(structure) if structure) end end events = SKIP unless hash.key?('events') page = hash.key?('page') ? hash['page'] : SKIP per_page = hash.key?('per_page') ? hash['per_page'] : SKIP total_pages = hash.key?('total_pages') ? hash['total_pages'] : SKIP # Create object from extracted values. ListInvoiceEventsResponse.new(events, page, per_page, total_pages) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/advanced_billing/models/list_invoice_events_response.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['events'] = 'events' @_hash['page'] = 'page' @_hash['per_page'] = 'per_page' @_hash['total_pages'] = 'total_pages' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/advanced_billing/models/list_invoice_events_response.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 46 |
# File 'lib/advanced_billing/models/list_invoice_events_response.rb', line 39 def self.optionals %w[ events page per_page total_pages ] end |