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>The Amazon Connect instance.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Instance {
    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
    pub id: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the instance.</p>
    pub arn: ::std::option::Option<::std::string::String>,
    /// <p>The identity management type.</p>
    pub identity_management_type: ::std::option::Option<crate::types::DirectoryType>,
    /// <p>The alias of instance.</p>
    pub instance_alias: ::std::option::Option<::std::string::String>,
    /// <p>When the instance was created.</p>
    pub created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The service role of the instance.</p>
    pub service_role: ::std::option::Option<::std::string::String>,
    /// <p>The state of the instance.</p>
    pub instance_status: ::std::option::Option<crate::types::InstanceStatus>,
    /// <p>Relevant details why the instance was not successfully created.</p>
    pub status_reason: ::std::option::Option<crate::types::InstanceStatusReason>,
    /// <p>Whether inbound calls are enabled.</p>
    pub inbound_calls_enabled: ::std::option::Option<bool>,
    /// <p>Whether outbound calls are enabled.</p>
    pub outbound_calls_enabled: ::std::option::Option<bool>,
    /// <p>This URL allows contact center users to access the Amazon Connect admin website.</p>
    pub instance_access_url: ::std::option::Option<::std::string::String>,
    /// <p>The tags of an instance.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl Instance {
    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
    pub fn id(&self) -> ::std::option::Option<&str> {
        self.id.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the instance.</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// <p>The identity management type.</p>
    pub fn identity_management_type(&self) -> ::std::option::Option<&crate::types::DirectoryType> {
        self.identity_management_type.as_ref()
    }
    /// <p>The alias of instance.</p>
    pub fn instance_alias(&self) -> ::std::option::Option<&str> {
        self.instance_alias.as_deref()
    }
    /// <p>When the instance was created.</p>
    pub fn created_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_time.as_ref()
    }
    /// <p>The service role of the instance.</p>
    pub fn service_role(&self) -> ::std::option::Option<&str> {
        self.service_role.as_deref()
    }
    /// <p>The state of the instance.</p>
    pub fn instance_status(&self) -> ::std::option::Option<&crate::types::InstanceStatus> {
        self.instance_status.as_ref()
    }
    /// <p>Relevant details why the instance was not successfully created.</p>
    pub fn status_reason(&self) -> ::std::option::Option<&crate::types::InstanceStatusReason> {
        self.status_reason.as_ref()
    }
    /// <p>Whether inbound calls are enabled.</p>
    pub fn inbound_calls_enabled(&self) -> ::std::option::Option<bool> {
        self.inbound_calls_enabled
    }
    /// <p>Whether outbound calls are enabled.</p>
    pub fn outbound_calls_enabled(&self) -> ::std::option::Option<bool> {
        self.outbound_calls_enabled
    }
    /// <p>This URL allows contact center users to access the Amazon Connect admin website.</p>
    pub fn instance_access_url(&self) -> ::std::option::Option<&str> {
        self.instance_access_url.as_deref()
    }
    /// <p>The tags of an instance.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl ::std::fmt::Debug for Instance {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("Instance");
        formatter.field("id", &self.id);
        formatter.field("arn", &self.arn);
        formatter.field("identity_management_type", &self.identity_management_type);
        formatter.field("instance_alias", &"*** Sensitive Data Redacted ***");
        formatter.field("created_time", &self.created_time);
        formatter.field("service_role", &self.service_role);
        formatter.field("instance_status", &self.instance_status);
        formatter.field("status_reason", &self.status_reason);
        formatter.field("inbound_calls_enabled", &self.inbound_calls_enabled);
        formatter.field("outbound_calls_enabled", &self.outbound_calls_enabled);
        formatter.field("instance_access_url", &self.instance_access_url);
        formatter.field("tags", &self.tags);
        formatter.finish()
    }
}
impl Instance {
    /// Creates a new builder-style object to manufacture [`Instance`](crate::types::Instance).
    pub fn builder() -> crate::types::builders::InstanceBuilder {
        crate::types::builders::InstanceBuilder::default()
    }
}

/// A builder for [`Instance`](crate::types::Instance).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct InstanceBuilder {
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) identity_management_type: ::std::option::Option<crate::types::DirectoryType>,
    pub(crate) instance_alias: ::std::option::Option<::std::string::String>,
    pub(crate) created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) service_role: ::std::option::Option<::std::string::String>,
    pub(crate) instance_status: ::std::option::Option<crate::types::InstanceStatus>,
    pub(crate) status_reason: ::std::option::Option<crate::types::InstanceStatusReason>,
    pub(crate) inbound_calls_enabled: ::std::option::Option<bool>,
    pub(crate) outbound_calls_enabled: ::std::option::Option<bool>,
    pub(crate) instance_access_url: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl InstanceBuilder {
    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// <p>The Amazon Resource Name (ARN) of the instance.</p>
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the instance.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the instance.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The identity management type.</p>
    pub fn identity_management_type(mut self, input: crate::types::DirectoryType) -> Self {
        self.identity_management_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The identity management type.</p>
    pub fn set_identity_management_type(mut self, input: ::std::option::Option<crate::types::DirectoryType>) -> Self {
        self.identity_management_type = input;
        self
    }
    /// <p>The identity management type.</p>
    pub fn get_identity_management_type(&self) -> &::std::option::Option<crate::types::DirectoryType> {
        &self.identity_management_type
    }
    /// <p>The alias of instance.</p>
    pub fn instance_alias(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_alias = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The alias of instance.</p>
    pub fn set_instance_alias(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_alias = input;
        self
    }
    /// <p>The alias of instance.</p>
    pub fn get_instance_alias(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_alias
    }
    /// <p>When the instance was created.</p>
    pub fn created_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>When the instance was created.</p>
    pub fn set_created_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_time = input;
        self
    }
    /// <p>When the instance was created.</p>
    pub fn get_created_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_time
    }
    /// <p>The service role of the instance.</p>
    pub fn service_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.service_role = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The service role of the instance.</p>
    pub fn set_service_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.service_role = input;
        self
    }
    /// <p>The service role of the instance.</p>
    pub fn get_service_role(&self) -> &::std::option::Option<::std::string::String> {
        &self.service_role
    }
    /// <p>The state of the instance.</p>
    pub fn instance_status(mut self, input: crate::types::InstanceStatus) -> Self {
        self.instance_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state of the instance.</p>
    pub fn set_instance_status(mut self, input: ::std::option::Option<crate::types::InstanceStatus>) -> Self {
        self.instance_status = input;
        self
    }
    /// <p>The state of the instance.</p>
    pub fn get_instance_status(&self) -> &::std::option::Option<crate::types::InstanceStatus> {
        &self.instance_status
    }
    /// <p>Relevant details why the instance was not successfully created.</p>
    pub fn status_reason(mut self, input: crate::types::InstanceStatusReason) -> Self {
        self.status_reason = ::std::option::Option::Some(input);
        self
    }
    /// <p>Relevant details why the instance was not successfully created.</p>
    pub fn set_status_reason(mut self, input: ::std::option::Option<crate::types::InstanceStatusReason>) -> Self {
        self.status_reason = input;
        self
    }
    /// <p>Relevant details why the instance was not successfully created.</p>
    pub fn get_status_reason(&self) -> &::std::option::Option<crate::types::InstanceStatusReason> {
        &self.status_reason
    }
    /// <p>Whether inbound calls are enabled.</p>
    pub fn inbound_calls_enabled(mut self, input: bool) -> Self {
        self.inbound_calls_enabled = ::std::option::Option::Some(input);
        self
    }
    /// <p>Whether inbound calls are enabled.</p>
    pub fn set_inbound_calls_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
        self.inbound_calls_enabled = input;
        self
    }
    /// <p>Whether inbound calls are enabled.</p>
    pub fn get_inbound_calls_enabled(&self) -> &::std::option::Option<bool> {
        &self.inbound_calls_enabled
    }
    /// <p>Whether outbound calls are enabled.</p>
    pub fn outbound_calls_enabled(mut self, input: bool) -> Self {
        self.outbound_calls_enabled = ::std::option::Option::Some(input);
        self
    }
    /// <p>Whether outbound calls are enabled.</p>
    pub fn set_outbound_calls_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
        self.outbound_calls_enabled = input;
        self
    }
    /// <p>Whether outbound calls are enabled.</p>
    pub fn get_outbound_calls_enabled(&self) -> &::std::option::Option<bool> {
        &self.outbound_calls_enabled
    }
    /// <p>This URL allows contact center users to access the Amazon Connect admin website.</p>
    pub fn instance_access_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_access_url = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>This URL allows contact center users to access the Amazon Connect admin website.</p>
    pub fn set_instance_access_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_access_url = input;
        self
    }
    /// <p>This URL allows contact center users to access the Amazon Connect admin website.</p>
    pub fn get_instance_access_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_access_url
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags of an instance.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The tags of an instance.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The tags of an instance.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`Instance`](crate::types::Instance).
    pub fn build(self) -> crate::types::Instance {
        crate::types::Instance {
            id: self.id,
            arn: self.arn,
            identity_management_type: self.identity_management_type,
            instance_alias: self.instance_alias,
            created_time: self.created_time,
            service_role: self.service_role,
            instance_status: self.instance_status,
            status_reason: self.status_reason,
            inbound_calls_enabled: self.inbound_calls_enabled,
            outbound_calls_enabled: self.outbound_calls_enabled,
            instance_access_url: self.instance_access_url,
            tags: self.tags,
        }
    }
}
impl ::std::fmt::Debug for InstanceBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("InstanceBuilder");
        formatter.field("id", &self.id);
        formatter.field("arn", &self.arn);
        formatter.field("identity_management_type", &self.identity_management_type);
        formatter.field("instance_alias", &"*** Sensitive Data Redacted ***");
        formatter.field("created_time", &self.created_time);
        formatter.field("service_role", &self.service_role);
        formatter.field("instance_status", &self.instance_status);
        formatter.field("status_reason", &self.status_reason);
        formatter.field("inbound_calls_enabled", &self.inbound_calls_enabled);
        formatter.field("outbound_calls_enabled", &self.outbound_calls_enabled);
        formatter.field("instance_access_url", &self.instance_access_url);
        formatter.field("tags", &self.tags);
        formatter.finish()
    }
}