Class: Datadog::OpenFeature::Transport::HTTP::FlagevaluationsSpec

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/open_feature/transport.rb

Overview

API spec for the EVP flagevaluation endpoint. Path: /evp_proxy/v2/api/v2/flagevaluation Header: X-Datadog-EVP-Subdomain: event-platform-intake (same as exposures)

Instance Method Summary collapse

Constructor Details

#initializeFlagevaluationsSpec

Returns a new instance of FlagevaluationsSpec.



41
42
43
44
45
# File 'lib/datadog/open_feature/transport.rb', line 41

def initialize
  @endpoint = Core::Transport::HTTP::API::Endpoint.new(
    :post, "/evp_proxy/v2/api/v2/flagevaluation"
  )
end

Instance Method Details

#call(env, &block) ⇒ Object



47
48
49
50
51
52
53
54
55
56
# File 'lib/datadog/open_feature/transport.rb', line 47

def call(env, &block)
  @endpoint.call(env) do |request_env|
    request_env.headers["Content-Type"] = env.request.parcel.content_type
    request_env.headers[Core::EVP::SUBDOMAIN_HEADER_NAME] =
      Core::EVP::EVENT_PLATFORM_INTAKE_SUBDOMAIN
    request_env.body = env.request.parcel.data

    block.call(request_env)
  end
end