Class: Samsara::Types::ResolvedBy
- Inherits:
-
Object
- Object
- Samsara::Types::ResolvedBy
- Defined in:
- lib/samsara_api/types/resolved_by.rb
Overview
Information about the user who is resolving a defect.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#id ⇒ String
readonly
The Id of user who is resolving the defect.
-
#type ⇒ String
readonly
The type of user who is resolving the defect.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(id:, type:, additional_properties: nil) ⇒ Samsara::Types::ResolvedBy constructor
- #to_json ⇒ String
Constructor Details
#initialize(id:, type:, additional_properties: nil) ⇒ Samsara::Types::ResolvedBy
25 26 27 28 29 30 |
# File 'lib/samsara_api/types/resolved_by.rb', line 25 def initialize(id:, type:, additional_properties: nil) @id = id @type = type @additional_properties = additional_properties @_field_set = { "id": id, "type": type } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
14 15 16 |
# File 'lib/samsara_api/types/resolved_by.rb', line 14 def additional_properties @additional_properties end |
#id ⇒ String (readonly)
Returns The Id of user who is resolving the defect.
10 11 12 |
# File 'lib/samsara_api/types/resolved_by.rb', line 10 def id @id end |
#type ⇒ String (readonly)
Returns The type of user who is resolving the defect. Must be “mechanic”.
12 13 14 |
# File 'lib/samsara_api/types/resolved_by.rb', line 12 def type @type end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::ResolvedBy
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/samsara_api/types/resolved_by.rb', line 35 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] type = parsed_json["type"] new( id: id, type: type, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
58 59 60 61 |
# File 'lib/samsara_api/types/resolved_by.rb', line 58 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.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
49 50 51 |
# File 'lib/samsara_api/types/resolved_by.rb', line 49 def to_json @_field_set&.to_json end |