Class: Samsara::SafetyEvents::AsyncAuditLogsClient
- Inherits:
-
Object
- Object
- Samsara::SafetyEvents::AsyncAuditLogsClient
- Defined in:
- lib/samsara_api/safety_events/audit_logs/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#feed(after: nil, start_time: nil, request_options: nil) ⇒ Object
api.safety_events.audit_logs.feed.
- #initialize(request_client:) ⇒ Samsara::SafetyEvents::AsyncAuditLogsClient constructor
Constructor Details
#initialize(request_client:) ⇒ Samsara::SafetyEvents::AsyncAuditLogsClient
84 85 86 |
# File 'lib/samsara_api/safety_events/audit_logs/client.rb', line 84 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Samsara::AsyncRequestClient (readonly)
79 80 81 |
# File 'lib/samsara_api/safety_events/audit_logs/client.rb', line 79 def request_client @request_client end |
Instance Method Details
#feed(after: nil, start_time: nil, request_options: nil) ⇒ Object
api.safety_events.audit_logs.feed
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/samsara_api/safety_events/audit_logs/client.rb', line 127 def feed(after: nil, start_time: nil, request_options: nil) Async do response = @request_client.conn.get do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.token.nil? req.headers["Authorization"] = .token end req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "after": after, "startTime": start_time }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/fleet/safety-events/audit-logs/feed" end Samsara::Types::SafetyEventsGetSafetyActivityEventFeedResponseBody.from_json(json_object: response.body) end end |