Class: Samsara::Types::FormsTableColumnObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::FormsTableColumnObjectResponseBody
- Defined in:
- lib/samsara_api/types/forms_table_column_object_response_body.rb
Overview
Defines a column 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.
-
#id ⇒ String
readonly
Unique identifier for the column.
-
#label ⇒ String
readonly
Label of the column.
-
#type ⇒ Object
readonly
‘check_boxes`, `multiple_choice`, `signature`, `media`, `person`.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::FormsTableColumnObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(id:, label:, type:, additional_properties: nil) ⇒ Samsara::Types::FormsTableColumnObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(id:, label:, type:, additional_properties: nil) ⇒ Samsara::Types::FormsTableColumnObjectResponseBody
31 32 33 34 35 36 37 |
# File 'lib/samsara_api/types/forms_table_column_object_response_body.rb', line 31 def initialize(id:, label:, type:, additional_properties: nil) @id = id @label = label @type = type @additional_properties = additional_properties @_field_set = { "id": id, "label": label, "type": type } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
18 19 20 |
# File 'lib/samsara_api/types/forms_table_column_object_response_body.rb', line 18 def additional_properties @additional_properties end |
#id ⇒ String (readonly)
Returns Unique identifier for the column.
11 12 13 |
# File 'lib/samsara_api/types/forms_table_column_object_response_body.rb', line 11 def id @id end |
#label ⇒ String (readonly)
Returns Label of the column.
13 14 15 |
# File 'lib/samsara_api/types/forms_table_column_object_response_body.rb', line 13 def label @label end |
#type ⇒ Object (readonly)
‘check_boxes`, `multiple_choice`, `signature`, `media`, `person`
16 17 18 |
# File 'lib/samsara_api/types/forms_table_column_object_response_body.rb', line 16 def type @type end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::FormsTableColumnObjectResponseBody
42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/samsara_api/types/forms_table_column_object_response_body.rb', line 42 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] label = parsed_json["label"] type = parsed_json["type"] new( id: id, label: label, type: type, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
67 68 69 70 71 |
# File 'lib/samsara_api/types/forms_table_column_object_response_body.rb', line 67 def self.validate_raw(obj:) obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.label.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.") obj.type.is_a?(Samsara::Types::FormsTableColumnObjectResponseBodyType) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
58 59 60 |
# File 'lib/samsara_api/types/forms_table_column_object_response_body.rb', line 58 def to_json @_field_set&.to_json end |