Class: Samsara::Types::FormsTextValueObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::FormsTextValueObjectResponseBody
- Defined in:
- lib/samsara_api/types/forms_text_value_object_response_body.rb
Overview
The value of a text 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.
-
#value ⇒ String
readonly
Text value.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::FormsTextValueObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(value:, additional_properties: nil) ⇒ Samsara::Types::FormsTextValueObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(value:, additional_properties: nil) ⇒ Samsara::Types::FormsTextValueObjectResponseBody
22 23 24 25 26 |
# File 'lib/samsara_api/types/forms_text_value_object_response_body.rb', line 22 def initialize(value:, additional_properties: nil) @value = value @additional_properties = additional_properties @_field_set = { "value": value } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
12 13 14 |
# File 'lib/samsara_api/types/forms_text_value_object_response_body.rb', line 12 def additional_properties @additional_properties end |
#value ⇒ String (readonly)
Returns Text value.
10 11 12 |
# File 'lib/samsara_api/types/forms_text_value_object_response_body.rb', line 10 def value @value end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::FormsTextValueObjectResponseBody
31 32 33 34 35 36 |
# File 'lib/samsara_api/types/forms_text_value_object_response_body.rb', line 31 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) value = parsed_json["value"] new(value: value, additional_properties: struct) end |
.validate_raw(obj:) ⇒ Void
49 50 51 |
# File 'lib/samsara_api/types/forms_text_value_object_response_body.rb', line 49 def self.validate_raw(obj:) obj.value.is_a?(String) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
40 41 42 |
# File 'lib/samsara_api/types/forms_text_value_object_response_body.rb', line 40 def to_json @_field_set&.to_json end |