Class: Samsara::Types::ConditionalFieldSectionObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::ConditionalFieldSectionObjectResponseBody
- Defined in:
- lib/samsara_api/types/conditional_field_section_object_response_body.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#conditional_field_first_index ⇒ Object
readonly
triggeringFieldValue in the fieldTypes list.
-
#conditional_field_last_index ⇒ Object
readonly
in the fieldTypes list.
-
#triggering_field_index ⇒ Object
readonly
or more conditional fields.
-
#triggering_field_value ⇒ String
readonly
The multiple choice option value that triggers the conditional fields.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::ConditionalFieldSectionObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(conditional_field_first_index: OMIT, conditional_field_last_index: OMIT, triggering_field_index: OMIT, triggering_field_value: OMIT, additional_properties: nil) ⇒ Samsara::Types::ConditionalFieldSectionObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(conditional_field_first_index: OMIT, conditional_field_last_index: OMIT, triggering_field_index: OMIT, triggering_field_value: OMIT, additional_properties: nil) ⇒ Samsara::Types::ConditionalFieldSectionObjectResponseBody
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/samsara_api/types/conditional_field_section_object_response_body.rb', line 36 def initialize(conditional_field_first_index: OMIT, conditional_field_last_index: OMIT, triggering_field_index: OMIT, triggering_field_value: OMIT, additional_properties: nil) @conditional_field_first_index = conditional_field_first_index if conditional_field_first_index != OMIT @conditional_field_last_index = conditional_field_last_index if conditional_field_last_index != OMIT @triggering_field_index = triggering_field_index if triggering_field_index != OMIT @triggering_field_value = triggering_field_value if triggering_field_value != OMIT @additional_properties = additional_properties @_field_set = { "conditionalFieldFirstIndex": conditional_field_first_index, "conditionalFieldLastIndex": conditional_field_last_index, "triggeringFieldIndex": triggering_field_index, "triggeringFieldValue": triggering_field_value }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
20 21 22 |
# File 'lib/samsara_api/types/conditional_field_section_object_response_body.rb', line 20 def additional_properties @additional_properties end |
#conditional_field_first_index ⇒ Object (readonly)
triggeringFieldValue in the fieldTypes list.
10 11 12 |
# File 'lib/samsara_api/types/conditional_field_section_object_response_body.rb', line 10 def conditional_field_first_index @conditional_field_first_index end |
#conditional_field_last_index ⇒ Object (readonly)
in the fieldTypes list.
13 14 15 |
# File 'lib/samsara_api/types/conditional_field_section_object_response_body.rb', line 13 def conditional_field_last_index @conditional_field_last_index end |
#triggering_field_index ⇒ Object (readonly)
or more conditional fields.
16 17 18 |
# File 'lib/samsara_api/types/conditional_field_section_object_response_body.rb', line 16 def triggering_field_index @triggering_field_index end |
#triggering_field_value ⇒ String (readonly)
Returns The multiple choice option value that triggers the conditional fields.
18 19 20 |
# File 'lib/samsara_api/types/conditional_field_section_object_response_body.rb', line 18 def triggering_field_value @triggering_field_value end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::ConditionalFieldSectionObjectResponseBody
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/samsara_api/types/conditional_field_section_object_response_body.rb', line 51 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) conditional_field_first_index = parsed_json["conditionalFieldFirstIndex"] conditional_field_last_index = parsed_json["conditionalFieldLastIndex"] triggering_field_index = parsed_json["triggeringFieldIndex"] triggering_field_value = parsed_json["triggeringFieldValue"] new( conditional_field_first_index: conditional_field_first_index, conditional_field_last_index: conditional_field_last_index, triggering_field_index: triggering_field_index, triggering_field_value: triggering_field_value, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
79 80 81 82 83 84 |
# File 'lib/samsara_api/types/conditional_field_section_object_response_body.rb', line 79 def self.validate_raw(obj:) obj.conditional_field_first_index&.is_a?(Long) != false || raise("Passed value for field obj.conditional_field_first_index is not the expected type, validation failed.") obj.conditional_field_last_index&.is_a?(Long) != false || raise("Passed value for field obj.conditional_field_last_index is not the expected type, validation failed.") obj.triggering_field_index&.is_a?(Long) != false || raise("Passed value for field obj.triggering_field_index is not the expected type, validation failed.") obj.triggering_field_value&.is_a?(String) != false || raise("Passed value for field obj.triggering_field_value is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
70 71 72 |
# File 'lib/samsara_api/types/conditional_field_section_object_response_body.rb', line 70 def to_json @_field_set&.to_json end |