Class: Bandwidth::PageInfo
- Defined in:
- lib/bandwidth/messaging_lib/messaging/models/page_info.rb
Overview
PageInfo Model.
Instance Attribute Summary collapse
-
#next_page ⇒ String
The link to the next page for pagination.
-
#next_page_token ⇒ String
The isolated pagination token for the next page.
-
#prev_page ⇒ String
The link to the previous page for pagination.
-
#prev_page_token ⇒ String
The isolated pagination token for the previous page.
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.
Instance Method Summary collapse
-
#initialize(prev_page = nil, next_page = nil, prev_page_token = nil, next_page_token = nil) ⇒ PageInfo
constructor
A new instance of PageInfo.
-
#nullables ⇒ Object
An array for nullable fields.
-
#optionals ⇒ Object
An array for optional fields.
Methods inherited from BaseModel
Constructor Details
#initialize(prev_page = nil, next_page = nil, prev_page_token = nil, next_page_token = nil) ⇒ PageInfo
Returns a new instance of PageInfo.
53 54 55 56 57 58 59 60 61 |
# File 'lib/bandwidth/messaging_lib/messaging/models/page_info.rb', line 53 def initialize(prev_page = nil, next_page = nil, prev_page_token = nil, next_page_token = nil) @prev_page = prev_page unless prev_page == SKIP @next_page = next_page unless next_page == SKIP @prev_page_token = prev_page_token unless prev_page_token == SKIP @next_page_token = next_page_token unless next_page_token == SKIP end |
Instance Attribute Details
#next_page ⇒ String
The link to the next page for pagination
18 19 20 |
# File 'lib/bandwidth/messaging_lib/messaging/models/page_info.rb', line 18 def next_page @next_page end |
#next_page_token ⇒ String
The isolated pagination token for the next page
26 27 28 |
# File 'lib/bandwidth/messaging_lib/messaging/models/page_info.rb', line 26 def next_page_token @next_page_token end |
#prev_page ⇒ String
The link to the previous page for pagination
14 15 16 |
# File 'lib/bandwidth/messaging_lib/messaging/models/page_info.rb', line 14 def prev_page @prev_page end |
#prev_page_token ⇒ String
The isolated pagination token for the previous page
22 23 24 |
# File 'lib/bandwidth/messaging_lib/messaging/models/page_info.rb', line 22 def prev_page_token @prev_page_token end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/bandwidth/messaging_lib/messaging/models/page_info.rb', line 64 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. prev_page = hash.key?('prevPage') ? hash['prevPage'] : SKIP next_page = hash.key?('nextPage') ? hash['nextPage'] : SKIP prev_page_token = hash.key?('prevPageToken') ? hash['prevPageToken'] : SKIP next_page_token = hash.key?('nextPageToken') ? hash['nextPageToken'] : SKIP # Create object from extracted values. PageInfo.new(prev_page, next_page, prev_page_token, next_page_token) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/bandwidth/messaging_lib/messaging/models/page_info.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['prev_page'] = 'prevPage' @_hash['next_page'] = 'nextPage' @_hash['prev_page_token'] = 'prevPageToken' @_hash['next_page_token'] = 'nextPageToken' @_hash end |
Instance Method Details
#nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/bandwidth/messaging_lib/messaging/models/page_info.rb', line 49 def nullables [] end |
#optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 46 |
# File 'lib/bandwidth/messaging_lib/messaging/models/page_info.rb', line 39 def optionals %w[ prev_page next_page prev_page_token next_page_token ] end |