Class: Datadog::Core::Telemetry::V1::Integration

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/core/telemetry/v1/integration.rb

Overview

Describes attributes for integration object

Constant Summary collapse

ERROR_NIL_ENABLED_MESSAGE =
':enabled must not be nil'.freeze
ERROR_NIL_NAME_MESSAGE =
':name must not be nil'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enabled:, name:, auto_enabled: nil, compatible: nil, error: nil, version: nil) ⇒ Integration

Returns a new instance of Integration.

Parameters:

  • enabled (Boolean)

    Whether integration is enabled at time of request

  • name (String)

    Integration name

  • auto_enabled (Boolean) (defaults to: nil)

    If integration is not enabled by default, but by user choice

  • compatible (Boolean) (defaults to: nil)

    If integration is available, but incompatible

  • error (String) (defaults to: nil)

    Error message if integration fails to load

  • version (String) (defaults to: nil)

    Integration version (if specified in app-started, it should be for other events too)



24
25
26
27
28
29
30
31
32
# File 'lib/datadog/core/telemetry/v1/integration.rb', line 24

def initialize(enabled:, name:, auto_enabled: nil, compatible: nil, error: nil, version: nil)
  validate(enabled: enabled, name: name)
  @auto_enabled = auto_enabled
  @compatible = compatible
  @enabled = enabled
  @error = error
  @name = name
  @version = version
end

Instance Attribute Details

#auto_enabledObject (readonly)

Returns the value of attribute auto_enabled.



10
11
12
# File 'lib/datadog/core/telemetry/v1/integration.rb', line 10

def auto_enabled
  @auto_enabled
end

#compatibleObject (readonly)

Returns the value of attribute compatible.



10
11
12
# File 'lib/datadog/core/telemetry/v1/integration.rb', line 10

def compatible
  @compatible
end

#enabledObject (readonly)

Returns the value of attribute enabled.



10
11
12
# File 'lib/datadog/core/telemetry/v1/integration.rb', line 10

def enabled
  @enabled
end

#errorObject (readonly)

Returns the value of attribute error.



10
11
12
# File 'lib/datadog/core/telemetry/v1/integration.rb', line 10

def error
  @error
end

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/datadog/core/telemetry/v1/integration.rb', line 10

def name
  @name
end

#versionObject (readonly)

Returns the value of attribute version.



10
11
12
# File 'lib/datadog/core/telemetry/v1/integration.rb', line 10

def version
  @version
end

Instance Method Details

#to_hObject



34
35
36
37
38
39
40
41
42
43
# File 'lib/datadog/core/telemetry/v1/integration.rb', line 34

def to_h
  {
    auto_enabled: @auto_enabled,
    compatible: @compatible,
    enabled: @enabled,
    error: @error,
    name: @name,
    version: @version
  }
end