Class: Datadog::Core::Telemetry::Event::AppClientConfigurationChange Private

Inherits:
Base
  • Object
show all
Defined in:
lib/datadog/core/telemetry/event/app_client_configuration_change.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Telemetry class for the ‘app-client-configuration-change’ event

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(changes, origin) ⇒ AppClientConfigurationChange

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of AppClientConfigurationChange.


17
18
19
20
21
# File 'lib/datadog/core/telemetry/event/app_client_configuration_change.rb', line 17

def initialize(changes, origin)
  super()
  @changes = changes
  @origin = origin
end

Instance Attribute Details

#changesObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


11
12
13
# File 'lib/datadog/core/telemetry/event/app_client_configuration_change.rb', line 11

def changes
  @changes
end

#originObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


11
12
13
# File 'lib/datadog/core/telemetry/event/app_client_configuration_change.rb', line 11

def origin
  @origin
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


52
53
54
# File 'lib/datadog/core/telemetry/event/app_client_configuration_change.rb', line 52

def ==(other)
  other.is_a?(AppClientConfigurationChange) && other.changes == @changes && other.origin == @origin
end

#configurationObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/datadog/core/telemetry/event/app_client_configuration_change.rb', line 27

def configuration
  config = Datadog.configuration
  seq_id = Event.configuration_sequence.next

  res = @changes.map do |name, value|
    {
      name: name,
      value: value,
      origin: @origin,
      seq_id: seq_id,
    }
  end

  unless config.dig('appsec', 'sca_enabled').nil?
    res << {
      name: 'appsec.sca_enabled',
      value: config.appsec.sca_enabled,
      origin: 'code',
      seq_id: seq_id,
    }
  end

  res
end

#hashObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


58
59
60
# File 'lib/datadog/core/telemetry/event/app_client_configuration_change.rb', line 58

def hash
  [self.class, @changes, @origin].hash
end

#payloadObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


23
24
25
# File 'lib/datadog/core/telemetry/event/app_client_configuration_change.rb', line 23

def payload
  {configuration: configuration}
end

#typeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


13
14
15
# File 'lib/datadog/core/telemetry/event/app_client_configuration_change.rb', line 13

def type
  'app-client-configuration-change'
end