Class: AWSCDK::BedrockAgentCore::GatewayTargetOpenAPIProps

Inherits:
GatewayTargetCommonProps
  • Object
show all
Defined in:
bedrock_agent_core/gateway_target_open_api_props.rb

Overview

Properties for creating an OpenAPI-based Gateway Target.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description: nil, gateway_target_name: nil, api_schema:, gateway:, credential_provider_configurations: nil, validate_open_api_schema: nil) ⇒ GatewayTargetOpenAPIProps

Returns a new instance of GatewayTargetOpenAPIProps.

Parameters:

  • description (String, nil) (defaults to: nil)

    Optional description for the gateway target The description can have up to 200 characters.

  • gateway_target_name (String, nil) (defaults to: nil)

    The name of the gateway target The name must be unique within the gateway Pattern: ^([0-9a-zA-Z][-]?)1,100$.

  • api_schema (AWSCDK::BedrockAgentCore::APISchema)

    The OpenAPI schema defining the API.

  • gateway (AWSCDK::BedrockAgentCore::IGateway)

    The gateway this target belongs to.

  • credential_provider_configurations (Array<AWSCDK::BedrockAgentCore::ICredentialProviderConfig>, nil) (defaults to: nil)

    Credential providers for authentication OpenAPI targets support API key and OAuth authentication (not IAM).

  • validate_open_api_schema (Boolean, nil) (defaults to: nil)

    Whether to validate the OpenAPI schema (only applies to inline schemas) Note: Validation is only performed for inline schemas during CDK synthesis.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'bedrock_agent_core/gateway_target_open_api_props.rb', line 13

def initialize(description: nil, gateway_target_name: nil, api_schema:, gateway:, credential_provider_configurations: nil, validate_open_api_schema: nil)
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @gateway_target_name = gateway_target_name
  Jsii::Type.check_type(@gateway_target_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "gatewayTargetName") unless @gateway_target_name.nil?
  @api_schema = api_schema
  Jsii::Type.check_type(@api_schema, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5BcGlTY2hlbWEifQ==")), "apiSchema")
  @gateway = gateway
  Jsii::Type.check_type(@gateway, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5JR2F0ZXdheSJ9")), "gateway")
  @credential_provider_configurations = credential_provider_configurations
  Jsii::Type.check_type(@credential_provider_configurations, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrYWdlbnRjb3JlLklDcmVkZW50aWFsUHJvdmlkZXJDb25maWcifSwia2luZCI6ImFycmF5In19")), "credentialProviderConfigurations") unless @credential_provider_configurations.nil?
  @validate_open_api_schema = validate_open_api_schema
  Jsii::Type.check_type(@validate_open_api_schema, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "validateOpenApiSchema") unless @validate_open_api_schema.nil?
end

Instance Attribute Details

#api_schemaAWSCDK::BedrockAgentCore::APISchema (readonly)

The OpenAPI schema defining the API.



41
42
43
# File 'bedrock_agent_core/gateway_target_open_api_props.rb', line 41

def api_schema
  @api_schema
end

#credential_provider_configurationsArray<AWSCDK::BedrockAgentCore::ICredentialProviderConfig>? (readonly)

Note:

Default: - If not provided, defaults to IAM role which will fail at runtime

Credential providers for authentication OpenAPI targets support API key and OAuth authentication (not IAM).



50
51
52
# File 'bedrock_agent_core/gateway_target_open_api_props.rb', line 50

def credential_provider_configurations
  @credential_provider_configurations
end

#descriptionString? (readonly)

Note:

Default: - No description

Optional description for the gateway target The description can have up to 200 characters.

Returns:

  • (String, nil)


32
33
34
# File 'bedrock_agent_core/gateway_target_open_api_props.rb', line 32

def description
  @description
end

#gatewayAWSCDK::BedrockAgentCore::IGateway (readonly)

The gateway this target belongs to.



45
46
47
# File 'bedrock_agent_core/gateway_target_open_api_props.rb', line 45

def gateway
  @gateway
end

#gateway_target_nameString? (readonly)

Note:

Default: - auto generate

The name of the gateway target The name must be unique within the gateway Pattern: ^([0-9a-zA-Z][-]?)1,100$.

Returns:

  • (String, nil)


37
38
39
# File 'bedrock_agent_core/gateway_target_open_api_props.rb', line 37

def gateway_target_name
  @gateway_target_name
end

#validate_open_api_schemaBoolean? (readonly)

Note:

Default: true

Whether to validate the OpenAPI schema (only applies to inline schemas) Note: Validation is only performed for inline schemas during CDK synthesis.

S3 and asset-based schemas cannot be validated at synthesis time.

Returns:

  • (Boolean, nil)


57
58
59
# File 'bedrock_agent_core/gateway_target_open_api_props.rb', line 57

def validate_open_api_schema
  @validate_open_api_schema
end

Class Method Details

.jsii_propertiesObject



59
60
61
62
63
64
65
66
67
68
# File 'bedrock_agent_core/gateway_target_open_api_props.rb', line 59

def self.jsii_properties
  {
    :description => "description",
    :gateway_target_name => "gatewayTargetName",
    :api_schema => "apiSchema",
    :gateway => "gateway",
    :credential_provider_configurations => "credentialProviderConfigurations",
    :validate_open_api_schema => "validateOpenApiSchema",
  }
end

Instance Method Details

#to_jsiiObject



70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'bedrock_agent_core/gateway_target_open_api_props.rb', line 70

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "description" => @description,
    "gatewayTargetName" => @gateway_target_name,
    "apiSchema" => @api_schema,
    "gateway" => @gateway,
    "credentialProviderConfigurations" => @credential_provider_configurations,
    "validateOpenApiSchema" => @validate_open_api_schema,
  })
  result.compact
end