Class: Samsara::Types::WalkaroundPhotoObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::WalkaroundPhotoObjectResponseBody
- Defined in:
- lib/samsara_api/types/walkaround_photo_object_response_body.rb
Overview
Walkaround’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 walkaround’s photo was created in RFC 3339 format.
-
#name ⇒ String
readonly
The name of the walkaround’s photo.
-
#url ⇒ Object
readonly
after it’s sent.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::WalkaroundPhotoObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(created_at_time:, name:, url:, additional_properties: nil) ⇒ Samsara::Types::WalkaroundPhotoObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(created_at_time:, name:, url:, additional_properties: nil) ⇒ Samsara::Types::WalkaroundPhotoObjectResponseBody
30 31 32 33 34 35 36 |
# File 'lib/samsara_api/types/walkaround_photo_object_response_body.rb', line 30 def initialize(created_at_time:, name:, url:, additional_properties: nil) @created_at_time = created_at_time @name = name @url = url @additional_properties = additional_properties @_field_set = { "createdAtTime": created_at_time, "name": name, "url": url } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
17 18 19 |
# File 'lib/samsara_api/types/walkaround_photo_object_response_body.rb', line 17 def additional_properties @additional_properties end |
#created_at_time ⇒ String (readonly)
Returns Time when walkaround’s photo was created in RFC 3339 format.
10 11 12 |
# File 'lib/samsara_api/types/walkaround_photo_object_response_body.rb', line 10 def created_at_time @created_at_time end |
#name ⇒ String (readonly)
Returns The name of the walkaround’s photo.
12 13 14 |
# File 'lib/samsara_api/types/walkaround_photo_object_response_body.rb', line 12 def name @name end |
#url ⇒ Object (readonly)
after it’s sent
15 16 17 |
# File 'lib/samsara_api/types/walkaround_photo_object_response_body.rb', line 15 def url @url end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::WalkaroundPhotoObjectResponseBody
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/samsara_api/types/walkaround_photo_object_response_body.rb', line 41 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"] name = parsed_json["name"] url = parsed_json["url"] new( created_at_time: created_at_time, name: name, url: url, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
66 67 68 69 70 |
# File 'lib/samsara_api/types/walkaround_photo_object_response_body.rb', line 66 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.name.is_a?(String) != false || raise("Passed value for field obj.name 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
57 58 59 |
# File 'lib/samsara_api/types/walkaround_photo_object_response_body.rb', line 57 def to_json @_field_set&.to_json end |