aws-sdk-bedrockagentruntime 1.126.0

AWS SDK for Agents for Amazon Bedrock Runtime
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateSessionInput {
    /// <p>A map of key-value pairs containing attributes to be persisted across the session. For example the user's ID, their language preference, and the type of device they are using.</p>
    pub session_metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>The unique identifier of the session to modify. You can specify either the session's <code>sessionId</code> or its Amazon Resource Name (ARN).</p>
    pub session_identifier: ::std::option::Option<::std::string::String>,
}
impl UpdateSessionInput {
    /// <p>A map of key-value pairs containing attributes to be persisted across the session. For example the user's ID, their language preference, and the type of device they are using.</p>
    pub fn session_metadata(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.session_metadata.as_ref()
    }
    /// <p>The unique identifier of the session to modify. You can specify either the session's <code>sessionId</code> or its Amazon Resource Name (ARN).</p>
    pub fn session_identifier(&self) -> ::std::option::Option<&str> {
        self.session_identifier.as_deref()
    }
}
impl UpdateSessionInput {
    /// Creates a new builder-style object to manufacture [`UpdateSessionInput`](crate::operation::update_session::UpdateSessionInput).
    pub fn builder() -> crate::operation::update_session::builders::UpdateSessionInputBuilder {
        crate::operation::update_session::builders::UpdateSessionInputBuilder::default()
    }
}

/// A builder for [`UpdateSessionInput`](crate::operation::update_session::UpdateSessionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateSessionInputBuilder {
    pub(crate) session_metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) session_identifier: ::std::option::Option<::std::string::String>,
}
impl UpdateSessionInputBuilder {
    /// Adds a key-value pair to `session_metadata`.
    ///
    /// To override the contents of this collection use [`set_session_metadata`](Self::set_session_metadata).
    ///
    /// <p>A map of key-value pairs containing attributes to be persisted across the session. For example the user's ID, their language preference, and the type of device they are using.</p>
    pub fn session_metadata(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        let mut hash_map = self.session_metadata.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.session_metadata = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>A map of key-value pairs containing attributes to be persisted across the session. For example the user's ID, their language preference, and the type of device they are using.</p>
    pub fn set_session_metadata(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.session_metadata = input;
        self
    }
    /// <p>A map of key-value pairs containing attributes to be persisted across the session. For example the user's ID, their language preference, and the type of device they are using.</p>
    pub fn get_session_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.session_metadata
    }
    /// <p>The unique identifier of the session to modify. You can specify either the session's <code>sessionId</code> or its Amazon Resource Name (ARN).</p>
    /// This field is required.
    pub fn session_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.session_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the session to modify. You can specify either the session's <code>sessionId</code> or its Amazon Resource Name (ARN).</p>
    pub fn set_session_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.session_identifier = input;
        self
    }
    /// <p>The unique identifier of the session to modify. You can specify either the session's <code>sessionId</code> or its Amazon Resource Name (ARN).</p>
    pub fn get_session_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_identifier
    }
    /// Consumes the builder and constructs a [`UpdateSessionInput`](crate::operation::update_session::UpdateSessionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_session::UpdateSessionInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_session::UpdateSessionInput {
            session_metadata: self.session_metadata,
            session_identifier: self.session_identifier,
        })
    }
}