Class: Samsara::Types::FormsTableColumnObjectResponseBody

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, label:, type:, additional_properties: nil) ⇒ Samsara::Types::FormsTableColumnObjectResponseBody

Parameters:

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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

#idString (readonly)

Returns Unique identifier for the column.

Returns:

  • (String)

    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

#labelString (readonly)

Returns Label of the column.

Returns:

  • (String)

    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

#typeObject (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

Parameters:

  • json_object (String)

Returns:



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

Parameters:

  • obj (Object)

Returns:

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

Returns:

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