Class: Samsara::Types::MinimalRouteStopAuditLogsResponseBody

Inherits:
Object
  • Object
show all
Defined in:
lib/samsara_api/types/minimal_route_stop_audit_logs_response_body.rb

Overview

A single route stop for a route.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(actual_arrival_time: OMIT, actual_departure_time: OMIT, en_route_time: OMIT, eta: OMIT, external_ids: OMIT, id:, live_sharing_url: OMIT, scheduled_arrival_time: OMIT, scheduled_departure_time: OMIT, skipped_time: OMIT, state: OMIT, additional_properties: nil) ⇒ Samsara::Types::MinimalRouteStopAuditLogsResponseBody

Parameters:

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

    Additional properties unmapped to the current class definition



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/samsara_api/types/minimal_route_stop_audit_logs_response_body.rb', line 72

def initialize(actual_arrival_time: OMIT, actual_departure_time: OMIT, en_route_time: OMIT, eta: OMIT, external_ids: OMIT, id:, live_sharing_url: OMIT, scheduled_arrival_time: OMIT, scheduled_departure_time: OMIT, skipped_time: OMIT, state: OMIT, additional_properties: nil)
  @actual_arrival_time = actual_arrival_time if actual_arrival_time != OMIT
  @actual_departure_time = actual_departure_time if actual_departure_time != OMIT
  @en_route_time = en_route_time if en_route_time != OMIT
  @eta = eta if eta != OMIT
  @external_ids = external_ids if external_ids != OMIT
  @id = id
  @live_sharing_url = live_sharing_url if live_sharing_url != OMIT
  @scheduled_arrival_time = scheduled_arrival_time if scheduled_arrival_time != OMIT
  @scheduled_departure_time = scheduled_departure_time if scheduled_departure_time != OMIT
  @skipped_time = skipped_time if skipped_time != OMIT
  @state = state if state != OMIT
  @additional_properties = additional_properties
  @_field_set = { "actualArrivalTime": actual_arrival_time, "actualDepartureTime": actual_departure_time, "enRouteTime": en_route_time, "eta": eta, "externalIds": external_ids, "id": id, "liveSharingUrl": live_sharing_url, "scheduledArrivalTime": scheduled_arrival_time, "scheduledDepartureTime": scheduled_departure_time, "skippedTime": skipped_time, "state": state }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#actual_arrival_time ⇒ DateTime (readonly)

Returns Actual arrival time, if it exists, for the route stop in RFC 3339 format.

Returns:

  • (DateTime) —

    Actual arrival time, if it exists, for the route stop in RFC 3339 format.



18
19
20
# File 'lib/samsara_api/types/minimal_route_stop_audit_logs_response_body.rb', line 18

def actual_arrival_time
  @actual_arrival_time
end

#actual_departure_time ⇒ DateTime (readonly)

Returns Actual departure time, if it exists, for the route stop in RFC 3339 format.

Returns:

  • (DateTime) —

    Actual departure time, if it exists, for the route stop in RFC 3339 format.



20
21
22
# File 'lib/samsara_api/types/minimal_route_stop_audit_logs_response_body.rb', line 20

def actual_departure_time
  @actual_departure_time
end

#additional_properties ⇒ OpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct) —

    Additional properties unmapped to the current class definition



46
47
48
# File 'lib/samsara_api/types/minimal_route_stop_audit_logs_response_body.rb', line 46

def additional_properties
  @additional_properties
end

#en_route_time ⇒ DateTime (readonly)

Returns The time the stop became en-route, in RFC 3339 format.

Returns:

  • (DateTime) —

    The time the stop became en-route, in RFC 3339 format.



22
23
24
# File 'lib/samsara_api/types/minimal_route_stop_audit_logs_response_body.rb', line 22

def en_route_time
  @en_route_time
end

#eta ⇒ Object (readonly)

format.



25
26
27
# File 'lib/samsara_api/types/minimal_route_stop_audit_logs_response_body.rb', line 25

def eta
  @eta
end

#external_ids ⇒ Hash{String => String} (readonly)

Returns A map of external ids.

Returns:

  • (Hash{String => String}) —

    A map of external ids



27
28
29
# File 'lib/samsara_api/types/minimal_route_stop_audit_logs_response_body.rb', line 27

def external_ids
  @external_ids
end

#id ⇒ String (readonly)

Returns Unique identifier for the route stop.

Returns:

  • (String) —

    Unique identifier for the route stop.



29
30
31
# File 'lib/samsara_api/types/minimal_route_stop_audit_logs_response_body.rb', line 29

def id
  @id
end

#live_sharing_url ⇒ String (readonly)

Returns The shareable url of the stop's current status.

Returns:

  • (String) —

    The shareable url of the stop's current status.



31
32
33
# File 'lib/samsara_api/types/minimal_route_stop_audit_logs_response_body.rb', line 31

def live_sharing_url
  @live_sharing_url
end

#scheduled_arrival_time ⇒ Object (readonly)

string.



35
36
37
# File 'lib/samsara_api/types/minimal_route_stop_audit_logs_response_body.rb', line 35

def scheduled_arrival_time
  @scheduled_arrival_time
end

#scheduled_departure_time ⇒ Object (readonly)

string.



39
40
41
# File 'lib/samsara_api/types/minimal_route_stop_audit_logs_response_body.rb', line 39

def scheduled_departure_time
  @scheduled_departure_time
end

#skipped_time ⇒ DateTime (readonly)

Returns Skipped time, if it exists, for the route stop in RFC 3339 format.

Returns:

  • (DateTime) —

    Skipped time, if it exists, for the route stop in RFC 3339 format.



41
42
43
# File 'lib/samsara_api/types/minimal_route_stop_audit_logs_response_body.rb', line 41

def skipped_time
  @skipped_time
end

#state ⇒ Object (readonly)

en route, skipped, arrived, departed



44
45
46
# File 'lib/samsara_api/types/minimal_route_stop_audit_logs_response_body.rb', line 44

def state
  @state
end

Class Method Details

.from_json(json_object:) ⇒ Samsara::Types::MinimalRouteStopAuditLogsResponseBody

Parameters:

  • json_object (String)

Returns:



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/samsara_api/types/minimal_route_stop_audit_logs_response_body.rb', line 94

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  actual_arrival_time = unless parsed_json["actualArrivalTime"].nil?
  DateTime.parse(parsed_json["actualArrivalTime"])
else
  nil
end
  actual_departure_time = unless parsed_json["actualDepartureTime"].nil?
  DateTime.parse(parsed_json["actualDepartureTime"])
else
  nil
end
  en_route_time = unless parsed_json["enRouteTime"].nil?
  DateTime.parse(parsed_json["enRouteTime"])
else
  nil
end
  eta = unless parsed_json["eta"].nil?
  DateTime.parse(parsed_json["eta"])
else
  nil
end
  external_ids = parsed_json["externalIds"]
  id = parsed_json["id"]
  live_sharing_url = parsed_json["liveSharingUrl"]
  scheduled_arrival_time = unless parsed_json["scheduledArrivalTime"].nil?
  DateTime.parse(parsed_json["scheduledArrivalTime"])
else
  nil
end
  scheduled_departure_time = unless parsed_json["scheduledDepartureTime"].nil?
  DateTime.parse(parsed_json["scheduledDepartureTime"])
else
  nil
end
  skipped_time = unless parsed_json["skippedTime"].nil?
  DateTime.parse(parsed_json["skippedTime"])
else
  nil
end
  state = parsed_json["state"]
  new(
    actual_arrival_time: actual_arrival_time,
    actual_departure_time: actual_departure_time,
    en_route_time: en_route_time,
    eta: eta,
    external_ids: external_ids,
    id: id,
    live_sharing_url: live_sharing_url,
    scheduled_arrival_time: scheduled_arrival_time,
    scheduled_departure_time: scheduled_departure_time,
    skipped_time: skipped_time,
    state: state,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/samsara_api/types/minimal_route_stop_audit_logs_response_body.rb', line 163

def self.validate_raw(obj:)
  obj.actual_arrival_time&.is_a?(DateTime) != false || raise("Passed value for field obj.actual_arrival_time is not the expected type, validation failed.")
  obj.actual_departure_time&.is_a?(DateTime) != false || raise("Passed value for field obj.actual_departure_time is not the expected type, validation failed.")
  obj.en_route_time&.is_a?(DateTime) != false || raise("Passed value for field obj.en_route_time is not the expected type, validation failed.")
  obj.eta&.is_a?(DateTime) != false || raise("Passed value for field obj.eta is not the expected type, validation failed.")
  obj.external_ids&.is_a?(Hash) != false || raise("Passed value for field obj.external_ids is not the expected type, validation failed.")
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id 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.scheduled_arrival_time&.is_a?(DateTime) != false || raise("Passed value for field obj.scheduled_arrival_time is not the expected type, validation failed.")
  obj.scheduled_departure_time&.is_a?(DateTime) != false || raise("Passed value for field obj.scheduled_departure_time is not the expected type, validation failed.")
  obj.skipped_time&.is_a?(DateTime) != false || raise("Passed value for field obj.skipped_time is not the expected type, validation failed.")
  obj.state&.is_a?(Samsara::Types::MinimalRouteStopAuditLogsResponseBodyState) != false || raise("Passed value for field obj.state is not the expected type, validation failed.")
end

Instance Method Details

#to_json ⇒ String

Returns:

  • (String)


154
155
156
# File 'lib/samsara_api/types/minimal_route_stop_audit_logs_response_body.rb', line 154

def to_json
  @_field_set&.to_json
end