Class: Samsara::Types::FormTemplateSectionObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::FormTemplateSectionObjectResponseBody
- Defined in:
- lib/samsara_api/types/form_template_section_object_response_body.rb
Overview
Form Template section object.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#field_index_first_inclusive ⇒ Object
readonly
Index 0 represents the first field definition of the fields array.
-
#field_index_last_inclusive ⇒ Long
readonly
The index of the last field from the fields array that is in this section.
-
#id ⇒ String
readonly
Identifier of the section.
-
#label ⇒ String
readonly
Label of the section.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::FormTemplateSectionObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(field_index_first_inclusive:, field_index_last_inclusive:, id:, label:, additional_properties: nil) ⇒ Samsara::Types::FormTemplateSectionObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(field_index_first_inclusive:, field_index_last_inclusive:, id:, label:, additional_properties: nil) ⇒ Samsara::Types::FormTemplateSectionObjectResponseBody
33 34 35 36 37 38 39 40 |
# File 'lib/samsara_api/types/form_template_section_object_response_body.rb', line 33 def initialize(field_index_first_inclusive:, field_index_last_inclusive:, id:, label:, additional_properties: nil) @field_index_first_inclusive = field_index_first_inclusive @field_index_last_inclusive = field_index_last_inclusive @id = id @label = label @additional_properties = additional_properties @_field_set = { "fieldIndexFirstInclusive": field_index_first_inclusive, "fieldIndexLastInclusive": field_index_last_inclusive, "id": id, "label": label } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
19 20 21 |
# File 'lib/samsara_api/types/form_template_section_object_response_body.rb', line 19 def additional_properties @additional_properties end |
#field_index_first_inclusive ⇒ Object (readonly)
Index 0 represents the first field definition of the fields array.
11 12 13 |
# File 'lib/samsara_api/types/form_template_section_object_response_body.rb', line 11 def field_index_first_inclusive @field_index_first_inclusive end |
#field_index_last_inclusive ⇒ Long (readonly)
Returns The index of the last field from the fields array that is in this section.
13 14 15 |
# File 'lib/samsara_api/types/form_template_section_object_response_body.rb', line 13 def field_index_last_inclusive @field_index_last_inclusive end |
#id ⇒ String (readonly)
Returns Identifier of the section.
15 16 17 |
# File 'lib/samsara_api/types/form_template_section_object_response_body.rb', line 15 def id @id end |
#label ⇒ String (readonly)
Returns Label of the section.
17 18 19 |
# File 'lib/samsara_api/types/form_template_section_object_response_body.rb', line 17 def label @label end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::FormTemplateSectionObjectResponseBody
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/samsara_api/types/form_template_section_object_response_body.rb', line 46 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) field_index_first_inclusive = parsed_json["fieldIndexFirstInclusive"] field_index_last_inclusive = parsed_json["fieldIndexLastInclusive"] id = parsed_json["id"] label = parsed_json["label"] new( field_index_first_inclusive: field_index_first_inclusive, field_index_last_inclusive: field_index_last_inclusive, id: id, label: label, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
73 74 75 76 77 78 |
# File 'lib/samsara_api/types/form_template_section_object_response_body.rb', line 73 def self.validate_raw(obj:) obj.field_index_first_inclusive.is_a?(Long) != false || raise("Passed value for field obj.field_index_first_inclusive is not the expected type, validation failed.") obj.field_index_last_inclusive.is_a?(Long) != false || raise("Passed value for field obj.field_index_last_inclusive 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.") obj.label.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
64 65 66 |
# File 'lib/samsara_api/types/form_template_section_object_response_body.rb', line 64 def to_json @_field_set&.to_json end |