Class: Samsara::Types::LiveSharingLinkResponseObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::LiveSharingLinkResponseObjectResponseBody
- Defined in:
- lib/samsara_api/types/live_sharing_link_response_object_response_body.rb
Overview
Live Sharing Link response object.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#expires_at_time ⇒ String
readonly
Date that this link expires, in RFC 3339 format.
-
#live_sharing_url ⇒ String
readonly
The shareable URL of the vehicle's location.
-
#name ⇒ String
readonly
Name of the Live Sharing Link.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::LiveSharingLinkResponseObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(expires_at_time: OMIT, live_sharing_url:, name:, additional_properties: nil) ⇒ Samsara::Types::LiveSharingLinkResponseObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(expires_at_time: OMIT, live_sharing_url:, name:, additional_properties: nil) ⇒ Samsara::Types::LiveSharingLinkResponseObjectResponseBody
28 29 30 31 32 33 34 35 36 |
# File 'lib/samsara_api/types/live_sharing_link_response_object_response_body.rb', line 28 def initialize(expires_at_time: OMIT, live_sharing_url:, name:, additional_properties: nil) @expires_at_time = expires_at_time if expires_at_time != OMIT @live_sharing_url = live_sharing_url @name = name @additional_properties = additional_properties @_field_set = { "expiresAtTime": expires_at_time, "liveSharingUrl": live_sharing_url, "name": name }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
16 17 18 |
# File 'lib/samsara_api/types/live_sharing_link_response_object_response_body.rb', line 16 def additional_properties @additional_properties end |
#expires_at_time ⇒ String (readonly)
Returns Date that this link expires, in RFC 3339 format.
10 11 12 |
# File 'lib/samsara_api/types/live_sharing_link_response_object_response_body.rb', line 10 def expires_at_time @expires_at_time end |
#live_sharing_url ⇒ String (readonly)
Returns The shareable URL of the vehicle's location.
12 13 14 |
# File 'lib/samsara_api/types/live_sharing_link_response_object_response_body.rb', line 12 def live_sharing_url @live_sharing_url end |
#name ⇒ String (readonly)
Returns Name of the Live Sharing Link.
14 15 16 |
# File 'lib/samsara_api/types/live_sharing_link_response_object_response_body.rb', line 14 def name @name end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::LiveSharingLinkResponseObjectResponseBody
42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/samsara_api/types/live_sharing_link_response_object_response_body.rb', line 42 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) expires_at_time = parsed_json["expiresAtTime"] live_sharing_url = parsed_json["liveSharingUrl"] name = parsed_json["name"] new( expires_at_time: expires_at_time, live_sharing_url: live_sharing_url, name: name, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
68 69 70 71 72 |
# File 'lib/samsara_api/types/live_sharing_link_response_object_response_body.rb', line 68 def self.validate_raw(obj:) obj.expires_at_time&.is_a?(String) != false || raise("Passed value for field obj.expires_at_time is not the expected type, validation failed.") obj.live_sharing_url.is_a?(String) != false || raise("Passed value for field obj.live_sharing_url 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.") end |
Instance Method Details
#to_json ⇒ String
59 60 61 |
# File 'lib/samsara_api/types/live_sharing_link_response_object_response_body.rb', line 59 def to_json @_field_set&.to_json end |