Class: Samsara::Types::MinimalRouteAuditLogsResponseBody

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

Overview

supported.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stops: OMIT, additional_properties: nil) ⇒ Samsara::Types::MinimalRouteAuditLogsResponseBody

Parameters:

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



28
29
30
31
32
33
34
# File 'lib/samsara_api/types/minimal_route_audit_logs_response_body.rb', line 28

def initialize(stops: OMIT, additional_properties: nil)
  @stops = stops if stops != OMIT
  @additional_properties = additional_properties
  @_field_set = { "stops": stops }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



17
18
19
# File 'lib/samsara_api/types/minimal_route_audit_logs_response_body.rb', line 17

def additional_properties
  @additional_properties
end

#stopsObject (readonly)

in the response.



15
16
17
# File 'lib/samsara_api/types/minimal_route_audit_logs_response_body.rb', line 15

def stops
  @stops
end

Class Method Details

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

Parameters:

  • json_object (String)

Returns:



39
40
41
42
43
44
45
46
47
# File 'lib/samsara_api/types/minimal_route_audit_logs_response_body.rb', line 39

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  stops = parsed_json["stops"]&.map do | item |
  item = item.to_json
  Samsara::Types::MinimalRouteStopAuditLogsResponseBody.from_json(json_object: item)
end
  new(stops: stops, additional_properties: struct)
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


60
61
62
# File 'lib/samsara_api/types/minimal_route_audit_logs_response_body.rb', line 60

def self.validate_raw(obj:)
  obj.stops&.is_a?(Array) != false || raise("Passed value for field obj.stops is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


51
52
53
# File 'lib/samsara_api/types/minimal_route_audit_logs_response_body.rb', line 51

def to_json
  @_field_set&.to_json
end