Class: Smplkit::Audit::ForwarderEnvironment

Inherits:
Struct
  • Object
show all
Defined in:
lib/smplkit/audit/models.rb

Overview

Per-environment enablement and optional configuration override for a forwarder.

A forwarder delivers events in a given environment only when that environment has an entry in Smplkit::Audit::Forwarder#environments with enabled: true. An environment with no entry (or enabled: false) receives no deliveries.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enabled: false, configuration: nil) ⇒ ForwarderEnvironment

Returns a new instance of ForwarderEnvironment.



407
408
409
# File 'lib/smplkit/audit/models.rb', line 407

def initialize(enabled: false, configuration: nil)
  super
end

Instance Attribute Details

#configurationHttpConfiguration?

Returns Optional per-environment destination configuration that fully replaces the forwarder’s base Smplkit::Audit::Forwarder#configuration for this environment. nil (the default) inherits the base configuration. As with the base configuration, header values are plaintext on writes and returned redacted on reads —re-supply real values before Smplkit::Audit::Forwarder#save.

Returns:



406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/smplkit/audit/models.rb', line 406

ForwarderEnvironment = Struct.new(:enabled, :configuration, keyword_init: true) do
  def initialize(enabled: false, configuration: nil)
    super
  end

  def self.from_wire(src)
    return new if src.nil?

    cfg = src.configuration
    new(
      enabled: src.enabled.nil? ? false : src.enabled,
      configuration: cfg.nil? ? nil : HttpConfiguration.from_wire(cfg)
    )
  end
end

#enabledBoolean

Returns Whether the forwarder delivers events in this environment. Defaults to false.

Returns:

  • (Boolean)

    Whether the forwarder delivers events in this environment. Defaults to false.



406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/smplkit/audit/models.rb', line 406

ForwarderEnvironment = Struct.new(:enabled, :configuration, keyword_init: true) do
  def initialize(enabled: false, configuration: nil)
    super
  end

  def self.from_wire(src)
    return new if src.nil?

    cfg = src.configuration
    new(
      enabled: src.enabled.nil? ? false : src.enabled,
      configuration: cfg.nil? ? nil : HttpConfiguration.from_wire(cfg)
    )
  end
end

Class Method Details

.from_wire(src) ⇒ Object



411
412
413
414
415
416
417
418
419
# File 'lib/smplkit/audit/models.rb', line 411

def self.from_wire(src)
  return new if src.nil?

  cfg = src.configuration
  new(
    enabled: src.enabled.nil? ? false : src.enabled,
    configuration: cfg.nil? ? nil : HttpConfiguration.from_wire(cfg)
  )
end