Class: Samsara::Types::MinimalRouteAuditLogsResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::MinimalRouteAuditLogsResponseBody
- 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
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#stops ⇒ Object
readonly
in the response.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::MinimalRouteAuditLogsResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(stops: OMIT, additional_properties: nil) ⇒ Samsara::Types::MinimalRouteAuditLogsResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(stops: OMIT, additional_properties: nil) ⇒ Samsara::Types::MinimalRouteAuditLogsResponseBody
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_properties ⇒ OpenStruct (readonly)
Returns 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 |
#stops ⇒ Object (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
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
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_json ⇒ 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 |