aws-sdk-connect 1.153.0

AWS SDK for Amazon Connect Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Information about agent-first preview mode outbound strategy configuration.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Preview {
    /// <p>Countdown timer configuration after the agent accepted the preview outbound contact.</p>
    pub post_accept_timeout_config: ::std::option::Option<crate::types::PostAcceptTimeoutConfig>,
    /// <p>The actions the agent can perform after accepting the preview outbound contact.</p>
    pub allowed_user_actions: ::std::vec::Vec<crate::types::AllowedUserAction>,
}
impl Preview {
    /// <p>Countdown timer configuration after the agent accepted the preview outbound contact.</p>
    pub fn post_accept_timeout_config(&self) -> ::std::option::Option<&crate::types::PostAcceptTimeoutConfig> {
        self.post_accept_timeout_config.as_ref()
    }
    /// <p>The actions the agent can perform after accepting the preview outbound contact.</p>
    pub fn allowed_user_actions(&self) -> &[crate::types::AllowedUserAction] {
        use std::ops::Deref;
        self.allowed_user_actions.deref()
    }
}
impl Preview {
    /// Creates a new builder-style object to manufacture [`Preview`](crate::types::Preview).
    pub fn builder() -> crate::types::builders::PreviewBuilder {
        crate::types::builders::PreviewBuilder::default()
    }
}

/// A builder for [`Preview`](crate::types::Preview).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PreviewBuilder {
    pub(crate) post_accept_timeout_config: ::std::option::Option<crate::types::PostAcceptTimeoutConfig>,
    pub(crate) allowed_user_actions: ::std::option::Option<::std::vec::Vec<crate::types::AllowedUserAction>>,
}
impl PreviewBuilder {
    /// <p>Countdown timer configuration after the agent accepted the preview outbound contact.</p>
    /// This field is required.
    pub fn post_accept_timeout_config(mut self, input: crate::types::PostAcceptTimeoutConfig) -> Self {
        self.post_accept_timeout_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>Countdown timer configuration after the agent accepted the preview outbound contact.</p>
    pub fn set_post_accept_timeout_config(mut self, input: ::std::option::Option<crate::types::PostAcceptTimeoutConfig>) -> Self {
        self.post_accept_timeout_config = input;
        self
    }
    /// <p>Countdown timer configuration after the agent accepted the preview outbound contact.</p>
    pub fn get_post_accept_timeout_config(&self) -> &::std::option::Option<crate::types::PostAcceptTimeoutConfig> {
        &self.post_accept_timeout_config
    }
    /// Appends an item to `allowed_user_actions`.
    ///
    /// To override the contents of this collection use [`set_allowed_user_actions`](Self::set_allowed_user_actions).
    ///
    /// <p>The actions the agent can perform after accepting the preview outbound contact.</p>
    pub fn allowed_user_actions(mut self, input: crate::types::AllowedUserAction) -> Self {
        let mut v = self.allowed_user_actions.unwrap_or_default();
        v.push(input);
        self.allowed_user_actions = ::std::option::Option::Some(v);
        self
    }
    /// <p>The actions the agent can perform after accepting the preview outbound contact.</p>
    pub fn set_allowed_user_actions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AllowedUserAction>>) -> Self {
        self.allowed_user_actions = input;
        self
    }
    /// <p>The actions the agent can perform after accepting the preview outbound contact.</p>
    pub fn get_allowed_user_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AllowedUserAction>> {
        &self.allowed_user_actions
    }
    /// Consumes the builder and constructs a [`Preview`](crate::types::Preview).
    /// This method will fail if any of the following fields are not set:
    /// - [`allowed_user_actions`](crate::types::builders::PreviewBuilder::allowed_user_actions)
    pub fn build(self) -> ::std::result::Result<crate::types::Preview, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Preview {
            post_accept_timeout_config: self.post_accept_timeout_config,
            allowed_user_actions: self.allowed_user_actions.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "allowed_user_actions",
                    "allowed_user_actions was not specified but it is required when building Preview",
                )
            })?,
        })
    }
}