aws-sdk-bedrockagentcore 1.45.0

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

pub use crate::operation::save_browser_session_profile::_save_browser_session_profile_output::SaveBrowserSessionProfileOutputBuilder;

impl crate::operation::save_browser_session_profile::builders::SaveBrowserSessionProfileInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::save_browser_session_profile::SaveBrowserSessionProfileOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::save_browser_session_profile::SaveBrowserSessionProfileError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.save_browser_session_profile();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `SaveBrowserSessionProfile`.
///
/// <p>Saves the current state of a browser session as a reusable profile in Amazon Bedrock AgentCore. A browser profile captures persistent browser data such as cookies and local storage from an active session, enabling you to reuse this data in future browser sessions.</p>
/// <p>To save a browser session profile, you must specify the profile identifier, browser identifier, and session ID. The session must be active when saving the profile. Once saved, the profile can be used with the <code>StartBrowserSession</code> operation to initialize new sessions with the stored browser state.</p>
/// <p>Browser profiles are useful for scenarios that require persistent authentication, maintaining user preferences across sessions, or continuing tasks that depend on previously stored browser data.</p>
/// <p>The following operations are related to <code>SaveBrowserSessionProfile</code>:</p>
/// <ul>
/// <li>
/// <p><a href="https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_StartBrowserSession.html">StartBrowserSession</a></p></li>
/// <li>
/// <p><a href="https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_GetBrowserSession.html">GetBrowserSession</a></p></li>
/// </ul>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct SaveBrowserSessionProfileFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::save_browser_session_profile::builders::SaveBrowserSessionProfileInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::save_browser_session_profile::SaveBrowserSessionProfileOutput,
        crate::operation::save_browser_session_profile::SaveBrowserSessionProfileError,
    > for SaveBrowserSessionProfileFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::save_browser_session_profile::SaveBrowserSessionProfileOutput,
            crate::operation::save_browser_session_profile::SaveBrowserSessionProfileError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl SaveBrowserSessionProfileFluentBuilder {
    /// Creates a new `SaveBrowserSessionProfileFluentBuilder`.
    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 SaveBrowserSessionProfile as a reference.
    pub fn as_input(&self) -> &crate::operation::save_browser_session_profile::builders::SaveBrowserSessionProfileInputBuilder {
        &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::save_browser_session_profile::SaveBrowserSessionProfileOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::save_browser_session_profile::SaveBrowserSessionProfileError,
            ::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::save_browser_session_profile::SaveBrowserSessionProfile::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::save_browser_session_profile::SaveBrowserSessionProfile::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::save_browser_session_profile::SaveBrowserSessionProfileOutput,
        crate::operation::save_browser_session_profile::SaveBrowserSessionProfileError,
        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 trace identifier for request tracking.</p>
    pub fn trace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.trace_id(input.into());
        self
    }
    /// <p>The trace identifier for request tracking.</p>
    pub fn set_trace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_trace_id(input);
        self
    }
    /// <p>The trace identifier for request tracking.</p>
    pub fn get_trace_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_trace_id()
    }
    /// <p>The parent trace information for distributed tracing.</p>
    pub fn trace_parent(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.trace_parent(input.into());
        self
    }
    /// <p>The parent trace information for distributed tracing.</p>
    pub fn set_trace_parent(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_trace_parent(input);
        self
    }
    /// <p>The parent trace information for distributed tracing.</p>
    pub fn get_trace_parent(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_trace_parent()
    }
    /// <p>The unique identifier for the browser profile. This identifier is used to reference the profile when starting new browser sessions. The identifier must follow the pattern of an alphanumeric name (up to 48 characters) followed by a hyphen and a 10-character alphanumeric suffix.</p>
    pub fn profile_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.profile_identifier(input.into());
        self
    }
    /// <p>The unique identifier for the browser profile. This identifier is used to reference the profile when starting new browser sessions. The identifier must follow the pattern of an alphanumeric name (up to 48 characters) followed by a hyphen and a 10-character alphanumeric suffix.</p>
    pub fn set_profile_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_profile_identifier(input);
        self
    }
    /// <p>The unique identifier for the browser profile. This identifier is used to reference the profile when starting new browser sessions. The identifier must follow the pattern of an alphanumeric name (up to 48 characters) followed by a hyphen and a 10-character alphanumeric suffix.</p>
    pub fn get_profile_identifier(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_profile_identifier()
    }
    /// <p>The unique identifier of the browser associated with the session from which to save the profile.</p>
    pub fn browser_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.browser_identifier(input.into());
        self
    }
    /// <p>The unique identifier of the browser associated with the session from which to save the profile.</p>
    pub fn set_browser_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_browser_identifier(input);
        self
    }
    /// <p>The unique identifier of the browser associated with the session from which to save the profile.</p>
    pub fn get_browser_identifier(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_browser_identifier()
    }
    /// <p>The unique identifier of the browser session from which to save the profile. The session must be active when saving the profile.</p>
    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.session_id(input.into());
        self
    }
    /// <p>The unique identifier of the browser session from which to save the profile. The session must be active when saving the profile.</p>
    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_session_id(input);
        self
    }
    /// <p>The unique identifier of the browser session from which to save the profile. The session must be active when saving the profile.</p>
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_session_id()
    }
    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock AgentCore ignores the request, but does not return an error.</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 this token matches a previous request, Amazon Bedrock AgentCore ignores the request, but does not return an error.</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 this token matches a previous request, Amazon Bedrock AgentCore ignores the request, but does not return an error.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_client_token()
    }
}