Class: Samsara::Types::LiveSharingLinkResponseObjectResponseBody

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expires_at_time: OMIT, live_sharing_url:, name:, additional_properties: nil) ⇒ Samsara::Types::LiveSharingLinkResponseObjectResponseBody

Parameters:

  • expires_at_time (String) (defaults to: OMIT) —

    Date that this link expires, in RFC 3339 format.

  • live_sharing_url (String) —

    The shareable URL of the vehicle's location.

  • name (String) —

    Name of the Live Sharing Link.

  • additional_properties (OpenStruct) (defaults to: nil) —

    Additional properties unmapped to the current class definition



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.

Returns:

  • (OpenStruct) —

    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.

Returns:

  • (String) —

    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.

Returns:

  • (String) —

    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.

Returns:

  • (String) —

    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

Parameters:

  • json_object (String)

Returns:



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

Parameters:

  • obj (Object)

Returns:

  • (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

Returns:

  • (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