Class: Samsara::Types::FormsTableRowObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::FormsTableRowObjectResponseBody
- Defined in:
- lib/samsara_api/types/forms_table_row_object_response_body.rb
Overview
Defines a row in a table form input field.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#cells ⇒ Array<Samsara::Types::FormsTableCellObjectResponseBody>
readonly
List of cells in the row.
-
#id ⇒ String
readonly
Unique identifier for the row.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::FormsTableRowObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(cells:, id:, additional_properties: nil) ⇒ Samsara::Types::FormsTableRowObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(cells:, id:, additional_properties: nil) ⇒ Samsara::Types::FormsTableRowObjectResponseBody
26 27 28 29 30 31 |
# File 'lib/samsara_api/types/forms_table_row_object_response_body.rb', line 26 def initialize(cells:, id:, additional_properties: nil) @cells = cells @id = id @additional_properties = additional_properties @_field_set = { "cells": cells, "id": id } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
15 16 17 |
# File 'lib/samsara_api/types/forms_table_row_object_response_body.rb', line 15 def additional_properties @additional_properties end |
#cells ⇒ Array<Samsara::Types::FormsTableCellObjectResponseBody> (readonly)
Returns List of cells in the row.
11 12 13 |
# File 'lib/samsara_api/types/forms_table_row_object_response_body.rb', line 11 def cells @cells end |
#id ⇒ String (readonly)
Returns Unique identifier for the row.
13 14 15 |
# File 'lib/samsara_api/types/forms_table_row_object_response_body.rb', line 13 def id @id end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::FormsTableRowObjectResponseBody
36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/samsara_api/types/forms_table_row_object_response_body.rb', line 36 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) cells = parsed_json["cells"]&.map do | item | item = item.to_json Samsara::Types::FormsTableCellObjectResponseBody.from_json(json_object: item) end id = parsed_json["id"] new( cells: cells, id: id, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
62 63 64 65 |
# File 'lib/samsara_api/types/forms_table_row_object_response_body.rb', line 62 def self.validate_raw(obj:) obj.cells.is_a?(Array) != false || raise("Passed value for field obj.cells is not the expected type, validation failed.") obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
53 54 55 |
# File 'lib/samsara_api/types/forms_table_row_object_response_body.rb', line 53 def to_json @_field_set&.to_json end |