Class: Samsara::Types::FormTemplateSectionObjectResponseBody

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(field_index_first_inclusive:, field_index_last_inclusive:, id:, label:, additional_properties: nil) ⇒ Samsara::Types::FormTemplateSectionObjectResponseBody

Parameters:

  • field_index_last_inclusive (Long)

    The index of the last field from the fields array that is in this section.

  • id (String)

    Identifier of the section.

  • label (String)

    Label of the section.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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_inclusiveObject (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_inclusiveLong (readonly)

Returns The index of the last field from the fields array that is in this section.

Returns:

  • (Long)

    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

#idString (readonly)

Returns Identifier of the section.

Returns:

  • (String)

    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

#labelString (readonly)

Returns Label of the section.

Returns:

  • (String)

    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

Parameters:

  • json_object (String)

Returns:



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

Parameters:

  • obj (Object)

Returns:

  • (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_jsonString

Returns:

  • (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