aws-sdk-bedrockagentcorecontrol 1.30.0

AWS SDK for Amazon Bedrock AgentCore Control
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_gateway::_create_gateway_output::CreateGatewayOutputBuilder;

pub use crate::operation::create_gateway::_create_gateway_input::CreateGatewayInputBuilder;

impl crate::operation::create_gateway::builders::CreateGatewayInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_gateway::CreateGatewayOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_gateway::CreateGatewayError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_gateway();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateGateway`.
///
/// <p>Creates a gateway for Amazon Bedrock Agent. A gateway serves as an integration point between your agent and external services.</p>
/// <p>If you specify <code>CUSTOM_JWT</code> as the <code>authorizerType</code>, you must provide an <code>authorizerConfiguration</code>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateGatewayFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_gateway::builders::CreateGatewayInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_gateway::CreateGatewayOutput,
        crate::operation::create_gateway::CreateGatewayError,
    > for CreateGatewayFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_gateway::CreateGatewayOutput,
            crate::operation::create_gateway::CreateGatewayError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateGatewayFluentBuilder {
    /// Creates a new `CreateGatewayFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the CreateGateway as a reference.
    pub fn as_input(&self) -> &crate::operation::create_gateway::builders::CreateGatewayInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_gateway::CreateGatewayOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_gateway::CreateGatewayError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::create_gateway::CreateGateway::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_gateway::CreateGateway::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::create_gateway::CreateGatewayOutput,
        crate::operation::create_gateway::CreateGatewayError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The name of the gateway. The name must be unique within your account.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(input.into());
        self
    }
    /// <p>The name of the gateway. The name must be unique within your account.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_name(input);
        self
    }
    /// <p>The name of the gateway. The name must be unique within your account.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// <p>The description of the gateway.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// <p>The description of the gateway.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// <p>The description of the gateway.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.client_token(input.into());
        self
    }
    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_client_token(input);
        self
    }
    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_client_token()
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role that provides permissions for the gateway to access Amazon Web Services services.</p>
    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.role_arn(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role that provides permissions for the gateway to access Amazon Web Services services.</p>
    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_role_arn(input);
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role that provides permissions for the gateway to access Amazon Web Services services.</p>
    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_role_arn()
    }
    /// <p>The protocol type for the gateway.</p>
    pub fn protocol_type(mut self, input: crate::types::GatewayProtocolType) -> Self {
        self.inner = self.inner.protocol_type(input);
        self
    }
    /// <p>The protocol type for the gateway.</p>
    pub fn set_protocol_type(mut self, input: ::std::option::Option<crate::types::GatewayProtocolType>) -> Self {
        self.inner = self.inner.set_protocol_type(input);
        self
    }
    /// <p>The protocol type for the gateway.</p>
    pub fn get_protocol_type(&self) -> &::std::option::Option<crate::types::GatewayProtocolType> {
        self.inner.get_protocol_type()
    }
    /// <p>The configuration settings for the protocol specified in the <code>protocolType</code> parameter.</p>
    pub fn protocol_configuration(mut self, input: crate::types::GatewayProtocolConfiguration) -> Self {
        self.inner = self.inner.protocol_configuration(input);
        self
    }
    /// <p>The configuration settings for the protocol specified in the <code>protocolType</code> parameter.</p>
    pub fn set_protocol_configuration(mut self, input: ::std::option::Option<crate::types::GatewayProtocolConfiguration>) -> Self {
        self.inner = self.inner.set_protocol_configuration(input);
        self
    }
    /// <p>The configuration settings for the protocol specified in the <code>protocolType</code> parameter.</p>
    pub fn get_protocol_configuration(&self) -> &::std::option::Option<crate::types::GatewayProtocolConfiguration> {
        self.inner.get_protocol_configuration()
    }
    /// <p>The type of authorizer to use for the gateway.</p>
    /// <ul>
    /// <li>
    /// <p><code>CUSTOM_JWT</code> - Authorize with a bearer token.</p></li>
    /// <li>
    /// <p><code>AWS_IAM</code> - Authorize with your Amazon Web Services IAM credentials.</p></li>
    /// <li>
    /// <p><code>NONE</code> - No authorization</p></li>
    /// </ul>
    pub fn authorizer_type(mut self, input: crate::types::AuthorizerType) -> Self {
        self.inner = self.inner.authorizer_type(input);
        self
    }
    /// <p>The type of authorizer to use for the gateway.</p>
    /// <ul>
    /// <li>
    /// <p><code>CUSTOM_JWT</code> - Authorize with a bearer token.</p></li>
    /// <li>
    /// <p><code>AWS_IAM</code> - Authorize with your Amazon Web Services IAM credentials.</p></li>
    /// <li>
    /// <p><code>NONE</code> - No authorization</p></li>
    /// </ul>
    pub fn set_authorizer_type(mut self, input: ::std::option::Option<crate::types::AuthorizerType>) -> Self {
        self.inner = self.inner.set_authorizer_type(input);
        self
    }
    /// <p>The type of authorizer to use for the gateway.</p>
    /// <ul>
    /// <li>
    /// <p><code>CUSTOM_JWT</code> - Authorize with a bearer token.</p></li>
    /// <li>
    /// <p><code>AWS_IAM</code> - Authorize with your Amazon Web Services IAM credentials.</p></li>
    /// <li>
    /// <p><code>NONE</code> - No authorization</p></li>
    /// </ul>
    pub fn get_authorizer_type(&self) -> &::std::option::Option<crate::types::AuthorizerType> {
        self.inner.get_authorizer_type()
    }
    /// <p>The authorizer configuration for the gateway. Required if <code>authorizerType</code> is <code>CUSTOM_JWT</code>.</p>
    pub fn authorizer_configuration(mut self, input: crate::types::AuthorizerConfiguration) -> Self {
        self.inner = self.inner.authorizer_configuration(input);
        self
    }
    /// <p>The authorizer configuration for the gateway. Required if <code>authorizerType</code> is <code>CUSTOM_JWT</code>.</p>
    pub fn set_authorizer_configuration(mut self, input: ::std::option::Option<crate::types::AuthorizerConfiguration>) -> Self {
        self.inner = self.inner.set_authorizer_configuration(input);
        self
    }
    /// <p>The authorizer configuration for the gateway. Required if <code>authorizerType</code> is <code>CUSTOM_JWT</code>.</p>
    pub fn get_authorizer_configuration(&self) -> &::std::option::Option<crate::types::AuthorizerConfiguration> {
        self.inner.get_authorizer_configuration()
    }
    /// <p>The Amazon Resource Name (ARN) of the KMS key used to encrypt data associated with the gateway.</p>
    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.kms_key_arn(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the KMS key used to encrypt data associated with the gateway.</p>
    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_kms_key_arn(input);
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the KMS key used to encrypt data associated with the gateway.</p>
    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_kms_key_arn()
    }
    ///
    /// Appends an item to `interceptorConfigurations`.
    ///
    /// To override the contents of this collection use [`set_interceptor_configurations`](Self::set_interceptor_configurations).
    ///
    /// <p>A list of configuration settings for a gateway interceptor. Gateway interceptors allow custom code to be invoked during gateway invocations.</p>
    pub fn interceptor_configurations(mut self, input: crate::types::GatewayInterceptorConfiguration) -> Self {
        self.inner = self.inner.interceptor_configurations(input);
        self
    }
    /// <p>A list of configuration settings for a gateway interceptor. Gateway interceptors allow custom code to be invoked during gateway invocations.</p>
    pub fn set_interceptor_configurations(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<crate::types::GatewayInterceptorConfiguration>>,
    ) -> Self {
        self.inner = self.inner.set_interceptor_configurations(input);
        self
    }
    /// <p>A list of configuration settings for a gateway interceptor. Gateway interceptors allow custom code to be invoked during gateway invocations.</p>
    pub fn get_interceptor_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GatewayInterceptorConfiguration>> {
        self.inner.get_interceptor_configurations()
    }
    /// <p>The policy engine configuration for the gateway. A policy engine is a collection of policies that evaluates and authorizes agent tool calls. When associated with a gateway, the policy engine intercepts all agent requests and determines whether to allow or deny each action based on the defined policies.</p>
    pub fn policy_engine_configuration(mut self, input: crate::types::GatewayPolicyEngineConfiguration) -> Self {
        self.inner = self.inner.policy_engine_configuration(input);
        self
    }
    /// <p>The policy engine configuration for the gateway. A policy engine is a collection of policies that evaluates and authorizes agent tool calls. When associated with a gateway, the policy engine intercepts all agent requests and determines whether to allow or deny each action based on the defined policies.</p>
    pub fn set_policy_engine_configuration(mut self, input: ::std::option::Option<crate::types::GatewayPolicyEngineConfiguration>) -> Self {
        self.inner = self.inner.set_policy_engine_configuration(input);
        self
    }
    /// <p>The policy engine configuration for the gateway. A policy engine is a collection of policies that evaluates and authorizes agent tool calls. When associated with a gateway, the policy engine intercepts all agent requests and determines whether to allow or deny each action based on the defined policies.</p>
    pub fn get_policy_engine_configuration(&self) -> &::std::option::Option<crate::types::GatewayPolicyEngineConfiguration> {
        self.inner.get_policy_engine_configuration()
    }
    /// <p>The level of detail in error messages returned when invoking the gateway.</p>
    /// <ul>
    /// <li>
    /// <p>If the value is <code>DEBUG</code>, granular exception messages are returned to help a user debug the gateway.</p></li>
    /// <li>
    /// <p>If the value is omitted, a generic error message is returned to the end user.</p></li>
    /// </ul>
    pub fn exception_level(mut self, input: crate::types::ExceptionLevel) -> Self {
        self.inner = self.inner.exception_level(input);
        self
    }
    /// <p>The level of detail in error messages returned when invoking the gateway.</p>
    /// <ul>
    /// <li>
    /// <p>If the value is <code>DEBUG</code>, granular exception messages are returned to help a user debug the gateway.</p></li>
    /// <li>
    /// <p>If the value is omitted, a generic error message is returned to the end user.</p></li>
    /// </ul>
    pub fn set_exception_level(mut self, input: ::std::option::Option<crate::types::ExceptionLevel>) -> Self {
        self.inner = self.inner.set_exception_level(input);
        self
    }
    /// <p>The level of detail in error messages returned when invoking the gateway.</p>
    /// <ul>
    /// <li>
    /// <p>If the value is <code>DEBUG</code>, granular exception messages are returned to help a user debug the gateway.</p></li>
    /// <li>
    /// <p>If the value is omitted, a generic error message is returned to the end user.</p></li>
    /// </ul>
    pub fn get_exception_level(&self) -> &::std::option::Option<crate::types::ExceptionLevel> {
        self.inner.get_exception_level()
    }
    ///
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>A map of key-value pairs to associate with the gateway as metadata tags.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.tags(k.into(), v.into());
        self
    }
    /// <p>A map of key-value pairs to associate with the gateway as metadata tags.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
    /// <p>A map of key-value pairs to associate with the gateway as metadata tags.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.inner.get_tags()
    }
}