Class: Samsara::Types::DefectPhotoResponseResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::DefectPhotoResponseResponseBody
- Defined in:
- lib/samsara_api/types/defect_photo_response_response_body.rb
Overview
Defect's photo object
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#created_at_time ⇒ String
readonly
Time when defect's photo was created in RFC 3339 format.
-
#url ⇒ Object
readonly
after it's sent.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::DefectPhotoResponseResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(created_at_time:, url:, additional_properties: nil) ⇒ Samsara::Types::DefectPhotoResponseResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(created_at_time:, url:, additional_properties: nil) ⇒ Samsara::Types::DefectPhotoResponseResponseBody
27 28 29 30 31 32 |
# File 'lib/samsara_api/types/defect_photo_response_response_body.rb', line 27 def initialize(created_at_time:, url:, additional_properties: nil) @created_at_time = created_at_time @url = url @additional_properties = additional_properties @_field_set = { "createdAtTime": created_at_time, "url": url } 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/defect_photo_response_response_body.rb', line 15 def additional_properties @additional_properties end |
#created_at_time ⇒ String (readonly)
Returns Time when defect's photo was created in RFC 3339 format.
10 11 12 |
# File 'lib/samsara_api/types/defect_photo_response_response_body.rb', line 10 def created_at_time @created_at_time end |
#url ⇒ Object (readonly)
after it's sent
13 14 15 |
# File 'lib/samsara_api/types/defect_photo_response_response_body.rb', line 13 def url @url end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::DefectPhotoResponseResponseBody
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/samsara_api/types/defect_photo_response_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) created_at_time = parsed_json["createdAtTime"] url = parsed_json["url"] new( created_at_time: created_at_time, url: url, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
60 61 62 63 |
# File 'lib/samsara_api/types/defect_photo_response_response_body.rb', line 60 def self.validate_raw(obj:) obj.created_at_time.is_a?(String) != false || raise("Passed value for field obj.created_at_time is not the expected type, validation failed.") obj.url.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
51 52 53 |
# File 'lib/samsara_api/types/defect_photo_response_response_body.rb', line 51 def to_json @_field_set&.to_json end |