aws-sdk-mpa 1.30.0

AWS SDK for AWS Multi-party Approval
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)]
pub struct CreateApprovalTeamInput {
    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services populates this field.</p><note>
    /// <p><b>What is idempotency?</b></p>
    /// <p>When you make a mutating API request, the request typically returns a result before the operation's asynchronous workflows have completed. Operations might also time out or encounter other server issues before they complete, even though the request has already returned a result. This could make it difficult to determine whether the request succeeded or not, and could lead to multiple retries to ensure that the operation completes successfully. However, if the original request and the subsequent retries are successful, the operation is completed multiple times. This means that you might create more resources than you intended.</p>
    /// <p><i>Idempotency</i> ensures that an API request completes no more than one time. With an idempotent request, if the original request completes successfully, any subsequent retries complete successfully without performing any further actions.</p>
    /// </note>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>An <code>ApprovalStrategy</code> object. Contains details for how the team grants approval.</p>
    pub approval_strategy: ::std::option::Option<crate::types::ApprovalStrategy>,
    /// <p>An array of <code>ApprovalTeamRequesterApprovers</code> objects. Contains details for the approvers in the team.</p>
    pub approvers: ::std::option::Option<::std::vec::Vec<crate::types::ApprovalTeamRequestApprover>>,
    /// <p>Description for the team.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>An array of <code>PolicyReference</code> objects. Contains a list of policies that define the permissions for team resources.</p>
    pub policies: ::std::option::Option<::std::vec::Vec<crate::types::PolicyReference>>,
    /// <p>Name of the team.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>Tags you want to attach to the team.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateApprovalTeamInput {
    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services populates this field.</p><note>
    /// <p><b>What is idempotency?</b></p>
    /// <p>When you make a mutating API request, the request typically returns a result before the operation's asynchronous workflows have completed. Operations might also time out or encounter other server issues before they complete, even though the request has already returned a result. This could make it difficult to determine whether the request succeeded or not, and could lead to multiple retries to ensure that the operation completes successfully. However, if the original request and the subsequent retries are successful, the operation is completed multiple times. This means that you might create more resources than you intended.</p>
    /// <p><i>Idempotency</i> ensures that an API request completes no more than one time. With an idempotent request, if the original request completes successfully, any subsequent retries complete successfully without performing any further actions.</p>
    /// </note>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>An <code>ApprovalStrategy</code> object. Contains details for how the team grants approval.</p>
    pub fn approval_strategy(&self) -> ::std::option::Option<&crate::types::ApprovalStrategy> {
        self.approval_strategy.as_ref()
    }
    /// <p>An array of <code>ApprovalTeamRequesterApprovers</code> objects. Contains details for the approvers in the team.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.approvers.is_none()`.
    pub fn approvers(&self) -> &[crate::types::ApprovalTeamRequestApprover] {
        self.approvers.as_deref().unwrap_or_default()
    }
    /// <p>Description for the team.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>An array of <code>PolicyReference</code> objects. Contains a list of policies that define the permissions for team resources.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.policies.is_none()`.
    pub fn policies(&self) -> &[crate::types::PolicyReference] {
        self.policies.as_deref().unwrap_or_default()
    }
    /// <p>Name of the team.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>Tags you want to attach to the team.</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 CreateApprovalTeamInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateApprovalTeamInput");
        formatter.field("client_token", &self.client_token);
        formatter.field("approval_strategy", &self.approval_strategy);
        formatter.field("approvers", &self.approvers);
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("policies", &self.policies);
        formatter.field("name", &self.name);
        formatter.field("tags", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl CreateApprovalTeamInput {
    /// Creates a new builder-style object to manufacture [`CreateApprovalTeamInput`](crate::operation::create_approval_team::CreateApprovalTeamInput).
    pub fn builder() -> crate::operation::create_approval_team::builders::CreateApprovalTeamInputBuilder {
        crate::operation::create_approval_team::builders::CreateApprovalTeamInputBuilder::default()
    }
}

/// A builder for [`CreateApprovalTeamInput`](crate::operation::create_approval_team::CreateApprovalTeamInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateApprovalTeamInputBuilder {
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) approval_strategy: ::std::option::Option<crate::types::ApprovalStrategy>,
    pub(crate) approvers: ::std::option::Option<::std::vec::Vec<crate::types::ApprovalTeamRequestApprover>>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) policies: ::std::option::Option<::std::vec::Vec<crate::types::PolicyReference>>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateApprovalTeamInputBuilder {
    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services populates this field.</p><note>
    /// <p><b>What is idempotency?</b></p>
    /// <p>When you make a mutating API request, the request typically returns a result before the operation's asynchronous workflows have completed. Operations might also time out or encounter other server issues before they complete, even though the request has already returned a result. This could make it difficult to determine whether the request succeeded or not, and could lead to multiple retries to ensure that the operation completes successfully. However, if the original request and the subsequent retries are successful, the operation is completed multiple times. This means that you might create more resources than you intended.</p>
    /// <p><i>Idempotency</i> ensures that an API request completes no more than one time. With an idempotent request, if the original request completes successfully, any subsequent retries complete successfully without performing any further actions.</p>
    /// </note>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services populates this field.</p><note>
    /// <p><b>What is idempotency?</b></p>
    /// <p>When you make a mutating API request, the request typically returns a result before the operation's asynchronous workflows have completed. Operations might also time out or encounter other server issues before they complete, even though the request has already returned a result. This could make it difficult to determine whether the request succeeded or not, and could lead to multiple retries to ensure that the operation completes successfully. However, if the original request and the subsequent retries are successful, the operation is completed multiple times. This means that you might create more resources than you intended.</p>
    /// <p><i>Idempotency</i> ensures that an API request completes no more than one time. With an idempotent request, if the original request completes successfully, any subsequent retries complete successfully without performing any further actions.</p>
    /// </note>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services populates this field.</p><note>
    /// <p><b>What is idempotency?</b></p>
    /// <p>When you make a mutating API request, the request typically returns a result before the operation's asynchronous workflows have completed. Operations might also time out or encounter other server issues before they complete, even though the request has already returned a result. This could make it difficult to determine whether the request succeeded or not, and could lead to multiple retries to ensure that the operation completes successfully. However, if the original request and the subsequent retries are successful, the operation is completed multiple times. This means that you might create more resources than you intended.</p>
    /// <p><i>Idempotency</i> ensures that an API request completes no more than one time. With an idempotent request, if the original request completes successfully, any subsequent retries complete successfully without performing any further actions.</p>
    /// </note>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>An <code>ApprovalStrategy</code> object. Contains details for how the team grants approval.</p>
    /// This field is required.
    pub fn approval_strategy(mut self, input: crate::types::ApprovalStrategy) -> Self {
        self.approval_strategy = ::std::option::Option::Some(input);
        self
    }
    /// <p>An <code>ApprovalStrategy</code> object. Contains details for how the team grants approval.</p>
    pub fn set_approval_strategy(mut self, input: ::std::option::Option<crate::types::ApprovalStrategy>) -> Self {
        self.approval_strategy = input;
        self
    }
    /// <p>An <code>ApprovalStrategy</code> object. Contains details for how the team grants approval.</p>
    pub fn get_approval_strategy(&self) -> &::std::option::Option<crate::types::ApprovalStrategy> {
        &self.approval_strategy
    }
    /// Appends an item to `approvers`.
    ///
    /// To override the contents of this collection use [`set_approvers`](Self::set_approvers).
    ///
    /// <p>An array of <code>ApprovalTeamRequesterApprovers</code> objects. Contains details for the approvers in the team.</p>
    pub fn approvers(mut self, input: crate::types::ApprovalTeamRequestApprover) -> Self {
        let mut v = self.approvers.unwrap_or_default();
        v.push(input);
        self.approvers = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of <code>ApprovalTeamRequesterApprovers</code> objects. Contains details for the approvers in the team.</p>
    pub fn set_approvers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ApprovalTeamRequestApprover>>) -> Self {
        self.approvers = input;
        self
    }
    /// <p>An array of <code>ApprovalTeamRequesterApprovers</code> objects. Contains details for the approvers in the team.</p>
    pub fn get_approvers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ApprovalTeamRequestApprover>> {
        &self.approvers
    }
    /// <p>Description for the team.</p>
    /// This field is required.
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Description for the team.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>Description for the team.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// Appends an item to `policies`.
    ///
    /// To override the contents of this collection use [`set_policies`](Self::set_policies).
    ///
    /// <p>An array of <code>PolicyReference</code> objects. Contains a list of policies that define the permissions for team resources.</p>
    pub fn policies(mut self, input: crate::types::PolicyReference) -> Self {
        let mut v = self.policies.unwrap_or_default();
        v.push(input);
        self.policies = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of <code>PolicyReference</code> objects. Contains a list of policies that define the permissions for team resources.</p>
    pub fn set_policies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PolicyReference>>) -> Self {
        self.policies = input;
        self
    }
    /// <p>An array of <code>PolicyReference</code> objects. Contains a list of policies that define the permissions for team resources.</p>
    pub fn get_policies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PolicyReference>> {
        &self.policies
    }
    /// <p>Name of the team.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Name of the team.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>Name of the team.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Tags you want to attach to the team.</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>Tags you want to attach to the team.</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>Tags you want to attach to the team.</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 [`CreateApprovalTeamInput`](crate::operation::create_approval_team::CreateApprovalTeamInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_approval_team::CreateApprovalTeamInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_approval_team::CreateApprovalTeamInput {
            client_token: self.client_token,
            approval_strategy: self.approval_strategy,
            approvers: self.approvers,
            description: self.description,
            policies: self.policies,
            name: self.name,
            tags: self.tags,
        })
    }
}
impl ::std::fmt::Debug for CreateApprovalTeamInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateApprovalTeamInputBuilder");
        formatter.field("client_token", &self.client_token);
        formatter.field("approval_strategy", &self.approval_strategy);
        formatter.field("approvers", &self.approvers);
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("policies", &self.policies);
        formatter.field("name", &self.name);
        formatter.field("tags", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}