Class: Smplkit::Audit::AuditClient
- Inherits:
-
Object
- Object
- Smplkit::Audit::AuditClient
- Defined in:
- lib/smplkit/audit/client.rb
Overview
Audit-product entry point — accessed via client.audit.
Today the audit namespace is exclusively #events; future iterations may add SIEM exports as additional sub-clients (ADR-047 §2.7 lists SIEM streaming as a Pro-tier capability).
Constant Summary collapse
- SDK_OWNED_HEADERS =
%w[authorization content-type user-agent].freeze
Instance Attribute Summary collapse
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#forwarders ⇒ Object
readonly
Returns the value of attribute forwarders.
-
#functions ⇒ Object
readonly
Returns the value of attribute functions.
Instance Method Summary collapse
- #_close ⇒ Object
-
#initialize(api_key:, base_url:, timeout: 10.0, extra_headers: nil) ⇒ AuditClient
constructor
A new instance of AuditClient.
Constructor Details
#initialize(api_key:, base_url:, timeout: 10.0, extra_headers: nil) ⇒ AuditClient
Returns a new instance of AuditClient.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/smplkit/audit/client.rb', line 15 def initialize(api_key:, base_url:, timeout: 10.0, extra_headers: nil) cfg = SmplkitGeneratedClient::Audit::Configuration.new cfg.host = URI.parse(base_url).host cfg.scheme = URI.parse(base_url).scheme cfg.access_token = api_key cfg.timeout = timeout api_client = SmplkitGeneratedClient::Audit::ApiClient.new(cfg) api_client.default_headers["User-Agent"] = "smplkit-ruby-sdk/#{Smplkit::VERSION}" extra_headers&.each do |k, v| api_client.default_headers[k] = v unless SDK_OWNED_HEADERS.include?(k.downcase) end events_api = SmplkitGeneratedClient::Audit::EventsApi.new(api_client) forwarders_api = SmplkitGeneratedClient::Audit::ForwardersApi.new(api_client) @events = Events.new(events_api) @forwarders = Forwarders.new(forwarders_api) @functions = Functions.new(forwarders_api) end |
Instance Attribute Details
#events ⇒ Object (readonly)
Returns the value of attribute events.
11 12 13 |
# File 'lib/smplkit/audit/client.rb', line 11 def events @events end |
#forwarders ⇒ Object (readonly)
Returns the value of attribute forwarders.
11 12 13 |
# File 'lib/smplkit/audit/client.rb', line 11 def forwarders @forwarders end |
#functions ⇒ Object (readonly)
Returns the value of attribute functions.
11 12 13 |
# File 'lib/smplkit/audit/client.rb', line 11 def functions @functions end |
Instance Method Details
#_close ⇒ Object
33 34 35 |
# File 'lib/smplkit/audit/client.rb', line 33 def _close @events._close end |