Class: Samsara::Types::PaginationResponse
- Inherits:
-
Object
- Object
- Samsara::Types::PaginationResponse
- Defined in:
- lib/samsara_api/types/pagination_response.rb
Overview
Pagination parameters.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#end_cursor ⇒ Object
readonly
parameter.
-
#has_next_page ⇒ Object
readonly
endCursor.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(end_cursor:, has_next_page:, additional_properties: nil) ⇒ Samsara::Types::PaginationResponse constructor
- #to_json ⇒ String
Constructor Details
#initialize(end_cursor:, has_next_page:, additional_properties: nil) ⇒ Samsara::Types::PaginationResponse
31 32 33 34 35 36 |
# File 'lib/samsara_api/types/pagination_response.rb', line 31 def initialize(end_cursor:, has_next_page:, additional_properties: nil) @end_cursor = end_cursor @has_next_page = has_next_page @additional_properties = additional_properties @_field_set = { "endCursor": end_cursor, "hasNextPage": has_next_page } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
17 18 19 |
# File 'lib/samsara_api/types/pagination_response.rb', line 17 def additional_properties @additional_properties end |
#end_cursor ⇒ Object (readonly)
parameter. This may be an empty string if there are no more pages left to view.
12 13 14 |
# File 'lib/samsara_api/types/pagination_response.rb', line 12 def end_cursor @end_cursor end |
#has_next_page ⇒ Object (readonly)
endCursor.
15 16 17 |
# File 'lib/samsara_api/types/pagination_response.rb', line 15 def has_next_page @has_next_page end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::PaginationResponse
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/samsara_api/types/pagination_response.rb', line 41 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) end_cursor = parsed_json["endCursor"] has_next_page = parsed_json["hasNextPage"] new( end_cursor: end_cursor, has_next_page: has_next_page, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
64 65 66 67 |
# File 'lib/samsara_api/types/pagination_response.rb', line 64 def self.validate_raw(obj:) obj.end_cursor.is_a?(String) != false || raise("Passed value for field obj.end_cursor is not the expected type, validation failed.") obj.has_next_page.is_a?(Boolean) != false || raise("Passed value for field obj.has_next_page is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
55 56 57 |
# File 'lib/samsara_api/types/pagination_response.rb', line 55 def to_json @_field_set&.to_json end |