Class: Samsara::Types::CustomHeadersObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::CustomHeadersObjectResponseBody
- Defined in:
- lib/samsara_api/types/custom_headers_object_response_body.rb
Overview
This is the object that stores the key and the value of the custom headers.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#key ⇒ String
readonly
The alphanumeric key of the custom header.
-
#value ⇒ Object
readonly
characters.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::CustomHeadersObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(key:, value:, additional_properties: nil) ⇒ Samsara::Types::CustomHeadersObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(key:, value:, additional_properties: nil) ⇒ Samsara::Types::CustomHeadersObjectResponseBody
27 28 29 30 31 32 |
# File 'lib/samsara_api/types/custom_headers_object_response_body.rb', line 27 def initialize(key:, value:, additional_properties: nil) @key = key @value = value @additional_properties = additional_properties @_field_set = { "key": key, "value": value } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
15 16 17 |
# File 'lib/samsara_api/types/custom_headers_object_response_body.rb', line 15 def additional_properties @additional_properties end |
#key ⇒ String (readonly)
Returns The alphanumeric key of the custom header.
10 11 12 |
# File 'lib/samsara_api/types/custom_headers_object_response_body.rb', line 10 def key @key end |
#value ⇒ Object (readonly)
characters.
13 14 15 |
# File 'lib/samsara_api/types/custom_headers_object_response_body.rb', line 13 def value @value end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::CustomHeadersObjectResponseBody
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/samsara_api/types/custom_headers_object_response_body.rb', line 37 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) key = parsed_json["key"] value = parsed_json["value"] new( key: key, value: value, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
60 61 62 63 |
# File 'lib/samsara_api/types/custom_headers_object_response_body.rb', line 60 def self.validate_raw(obj:) obj.key.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.") 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
51 52 53 |
# File 'lib/samsara_api/types/custom_headers_object_response_body.rb', line 51 def to_json @_field_set&.to_json end |