class Bandwidth::PageInfo

PageInfo Model.

Attributes

next_page[RW]

The link to the next page for pagination @return [String]

next_page_token[RW]

The isolated pagination token for the next page @return [String]

prev_page[RW]

The link to the previous page for pagination @return [String]

prev_page_token[RW]

The isolated pagination token for the previous page @return [String]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

# File lib/bandwidth/messaging_lib/messaging/models/page_info.rb, line 46
def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  prev_page = hash['prevPage']
  next_page = hash['nextPage']
  prev_page_token = hash['prevPageToken']
  next_page_token = hash['nextPageToken']

  # Create object from extracted values.
  PageInfo.new(prev_page,
               next_page,
               prev_page_token,
               next_page_token)
end
names() click to toggle source

A mapping from model property names to API property names.

# File lib/bandwidth/messaging_lib/messaging/models/page_info.rb, line 26
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
new(prev_page = nil, next_page = nil, prev_page_token = nil, next_page_token = nil) click to toggle source
# File lib/bandwidth/messaging_lib/messaging/models/page_info.rb, line 35
def initialize(prev_page = nil,
               next_page = nil,
               prev_page_token = nil,
               next_page_token = nil)
  @prev_page = prev_page
  @next_page = next_page
  @prev_page_token = prev_page_token
  @next_page_token = next_page_token
end