Class: AWSCDK::BedrockAgentCore::MetadataConfiguration

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
bedrock_agent_core/metadata_configuration.rb

Overview

Configuration for passing metadata (headers and query parameters) to the API Gateway target.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(allowed_query_parameters: nil, allowed_request_headers: nil, allowed_response_headers: nil) ⇒ MetadataConfiguration

Returns a new instance of MetadataConfiguration.

Parameters:

  • allowed_query_parameters (Array<String>, nil) (defaults to: nil)

    List of query parameter names to pass through to the target.

  • allowed_request_headers (Array<String>, nil) (defaults to: nil)

    List of request header names to pass through to the target.

  • allowed_response_headers (Array<String>, nil) (defaults to: nil)

    List of response header names to pass through from the target.



10
11
12
13
14
15
16
17
# File 'bedrock_agent_core/metadata_configuration.rb', line 10

def initialize(allowed_query_parameters: nil, allowed_request_headers: nil, allowed_response_headers: nil)
  @allowed_query_parameters = allowed_query_parameters
  Jsii::Type.check_type(@allowed_query_parameters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "allowedQueryParameters") unless @allowed_query_parameters.nil?
  @allowed_request_headers = allowed_request_headers
  Jsii::Type.check_type(@allowed_request_headers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "allowedRequestHeaders") unless @allowed_request_headers.nil?
  @allowed_response_headers = allowed_response_headers
  Jsii::Type.check_type(@allowed_response_headers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "allowedResponseHeaders") unless @allowed_response_headers.nil?
end

Instance Attribute Details

#allowed_query_parametersArray<String>? (readonly)

Note:

Default: - No query parameters are passed through

List of query parameter names to pass through to the target.

Constraints:

  • Array must contain 1-10 items
  • Each parameter name must be 1-40 characters
  • Cannot be an empty array

Returns:

  • (Array<String>, nil)


29
30
31
# File 'bedrock_agent_core/metadata_configuration.rb', line 29

def allowed_query_parameters
  @allowed_query_parameters
end

#allowed_request_headersArray<String>? (readonly)

Note:

Default: - No request headers are passed through

List of request header names to pass through to the target.

Constraints:

  • Array must contain 1-10 items
  • Each header name must be 1-100 characters
  • Cannot be an empty array

Returns:

  • (Array<String>, nil)


40
41
42
# File 'bedrock_agent_core/metadata_configuration.rb', line 40

def allowed_request_headers
  @allowed_request_headers
end

#allowed_response_headersArray<String>? (readonly)

Note:

Default: - No response headers are passed through

List of response header names to pass through from the target.

Constraints:

  • Array must contain 1-10 items
  • Each header name must be 1-100 characters
  • Cannot be an empty array

Returns:

  • (Array<String>, nil)


51
52
53
# File 'bedrock_agent_core/metadata_configuration.rb', line 51

def allowed_response_headers
  @allowed_response_headers
end

Class Method Details

.jsii_propertiesObject



53
54
55
56
57
58
59
# File 'bedrock_agent_core/metadata_configuration.rb', line 53

def self.jsii_properties
  {
    :allowed_query_parameters => "allowedQueryParameters",
    :allowed_request_headers => "allowedRequestHeaders",
    :allowed_response_headers => "allowedResponseHeaders",
  }
end

Instance Method Details

#to_jsiiObject



61
62
63
64
65
66
67
68
69
# File 'bedrock_agent_core/metadata_configuration.rb', line 61

def to_jsii
  result = {}
  result.merge!({
    "allowedQueryParameters" => @allowed_query_parameters,
    "allowedRequestHeaders" => @allowed_request_headers,
    "allowedResponseHeaders" => @allowed_response_headers,
  })
  result.compact
end