aws-sdk-qconnect 1.109.0

AWS SDK for Amazon Q Connect
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 UpdateSessionDataOutput {
    /// <p>The Amazon Resource Name (ARN) of the session.</p>
    pub session_arn: ::std::string::String,
    /// <p>The identifier of the session.</p>
    pub session_id: ::std::string::String,
    /// <p>The namespace into which the session data is stored. Supported namespaces are: Custom</p>
    pub namespace: crate::types::SessionDataNamespace,
    /// <p>Data stored in the session.</p>
    pub data: ::std::vec::Vec<crate::types::RuntimeSessionData>,
    _request_id: Option<String>,
}
impl UpdateSessionDataOutput {
    /// <p>The Amazon Resource Name (ARN) of the session.</p>
    pub fn session_arn(&self) -> &str {
        use std::ops::Deref;
        self.session_arn.deref()
    }
    /// <p>The identifier of the session.</p>
    pub fn session_id(&self) -> &str {
        use std::ops::Deref;
        self.session_id.deref()
    }
    /// <p>The namespace into which the session data is stored. Supported namespaces are: Custom</p>
    pub fn namespace(&self) -> &crate::types::SessionDataNamespace {
        &self.namespace
    }
    /// <p>Data stored in the session.</p>
    pub fn data(&self) -> &[crate::types::RuntimeSessionData] {
        use std::ops::Deref;
        self.data.deref()
    }
}
impl ::aws_types::request_id::RequestId for UpdateSessionDataOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl UpdateSessionDataOutput {
    /// Creates a new builder-style object to manufacture [`UpdateSessionDataOutput`](crate::operation::update_session_data::UpdateSessionDataOutput).
    pub fn builder() -> crate::operation::update_session_data::builders::UpdateSessionDataOutputBuilder {
        crate::operation::update_session_data::builders::UpdateSessionDataOutputBuilder::default()
    }
}

/// A builder for [`UpdateSessionDataOutput`](crate::operation::update_session_data::UpdateSessionDataOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateSessionDataOutputBuilder {
    pub(crate) session_arn: ::std::option::Option<::std::string::String>,
    pub(crate) session_id: ::std::option::Option<::std::string::String>,
    pub(crate) namespace: ::std::option::Option<crate::types::SessionDataNamespace>,
    pub(crate) data: ::std::option::Option<::std::vec::Vec<crate::types::RuntimeSessionData>>,
    _request_id: Option<String>,
}
impl UpdateSessionDataOutputBuilder {
    /// <p>The Amazon Resource Name (ARN) of the session.</p>
    /// This field is required.
    pub fn session_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.session_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the session.</p>
    pub fn set_session_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.session_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the session.</p>
    pub fn get_session_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_arn
    }
    /// <p>The identifier of the session.</p>
    /// This field is required.
    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.session_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the session.</p>
    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.session_id = input;
        self
    }
    /// <p>The identifier of the session.</p>
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_id
    }
    /// <p>The namespace into which the session data is stored. Supported namespaces are: Custom</p>
    /// This field is required.
    pub fn namespace(mut self, input: crate::types::SessionDataNamespace) -> Self {
        self.namespace = ::std::option::Option::Some(input);
        self
    }
    /// <p>The namespace into which the session data is stored. Supported namespaces are: Custom</p>
    pub fn set_namespace(mut self, input: ::std::option::Option<crate::types::SessionDataNamespace>) -> Self {
        self.namespace = input;
        self
    }
    /// <p>The namespace into which the session data is stored. Supported namespaces are: Custom</p>
    pub fn get_namespace(&self) -> &::std::option::Option<crate::types::SessionDataNamespace> {
        &self.namespace
    }
    /// Appends an item to `data`.
    ///
    /// To override the contents of this collection use [`set_data`](Self::set_data).
    ///
    /// <p>Data stored in the session.</p>
    pub fn data(mut self, input: crate::types::RuntimeSessionData) -> Self {
        let mut v = self.data.unwrap_or_default();
        v.push(input);
        self.data = ::std::option::Option::Some(v);
        self
    }
    /// <p>Data stored in the session.</p>
    pub fn set_data(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RuntimeSessionData>>) -> Self {
        self.data = input;
        self
    }
    /// <p>Data stored in the session.</p>
    pub fn get_data(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RuntimeSessionData>> {
        &self.data
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`UpdateSessionDataOutput`](crate::operation::update_session_data::UpdateSessionDataOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`session_arn`](crate::operation::update_session_data::builders::UpdateSessionDataOutputBuilder::session_arn)
    /// - [`session_id`](crate::operation::update_session_data::builders::UpdateSessionDataOutputBuilder::session_id)
    /// - [`namespace`](crate::operation::update_session_data::builders::UpdateSessionDataOutputBuilder::namespace)
    /// - [`data`](crate::operation::update_session_data::builders::UpdateSessionDataOutputBuilder::data)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_session_data::UpdateSessionDataOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_session_data::UpdateSessionDataOutput {
            session_arn: self.session_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "session_arn",
                    "session_arn was not specified but it is required when building UpdateSessionDataOutput",
                )
            })?,
            session_id: self.session_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "session_id",
                    "session_id was not specified but it is required when building UpdateSessionDataOutput",
                )
            })?,
            namespace: self.namespace.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "namespace",
                    "namespace was not specified but it is required when building UpdateSessionDataOutput",
                )
            })?,
            data: self.data.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "data",
                    "data was not specified but it is required when building UpdateSessionDataOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}