aws-sdk-context 1.0.0

AWS SDK for AWS Context
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 CreateCurationPolicyInput {
    /// <p>A unique, case-sensitive identifier that you provide to make the request idempotent. A retry with the same token and the same parameters returns the curation policy that the first request created. If you don't specify one, the AWS SDKs generate one.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>The name of the curation policy. 3 to 63 characters: it must start with a letter and can contain only ASCII letters, digits, and hyphens.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>A description of the curation policy. Up to 1,024 characters, with no control characters.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The policy's rules, as a Cedar policy document.</p>
    pub policy_document: ::std::option::Option<::std::string::String>,
    /// <p>The number of seconds that a curation proposal held for review under this policy can wait for a decision before it is rejected automatically. Valid range: 86,400 (1 day) to 15,552,000 (180 days). If you omit it, proposals held under this policy are never rejected automatically.</p>
    pub auto_reject_after_seconds: ::std::option::Option<i64>,
    /// <p>Tags to add to the curation policy when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with <code>aws:</code>. To add tags, you also need <code>context:TagResource</code> permission on the new curation policy. If you specify more than 50 user tags, the request fails with <code>ServiceQuotaExceededException</code>, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails with <code>ValidationException</code>.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateCurationPolicyInput {
    /// <p>A unique, case-sensitive identifier that you provide to make the request idempotent. A retry with the same token and the same parameters returns the curation policy that the first request created. If you don't specify one, the AWS SDKs generate one.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>The name of the curation policy. 3 to 63 characters: it must start with a letter and can contain only ASCII letters, digits, and hyphens.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>A description of the curation policy. Up to 1,024 characters, with no control characters.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The policy's rules, as a Cedar policy document.</p>
    pub fn policy_document(&self) -> ::std::option::Option<&str> {
        self.policy_document.as_deref()
    }
    /// <p>The number of seconds that a curation proposal held for review under this policy can wait for a decision before it is rejected automatically. Valid range: 86,400 (1 day) to 15,552,000 (180 days). If you omit it, proposals held under this policy are never rejected automatically.</p>
    pub fn auto_reject_after_seconds(&self) -> ::std::option::Option<i64> {
        self.auto_reject_after_seconds
    }
    /// <p>Tags to add to the curation policy when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with <code>aws:</code>. To add tags, you also need <code>context:TagResource</code> permission on the new curation policy. If you specify more than 50 user tags, the request fails with <code>ServiceQuotaExceededException</code>, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails with <code>ValidationException</code>.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl CreateCurationPolicyInput {
    /// Creates a new builder-style object to manufacture [`CreateCurationPolicyInput`](crate::operation::create_curation_policy::CreateCurationPolicyInput).
    pub fn builder() -> crate::operation::create_curation_policy::builders::CreateCurationPolicyInputBuilder {
        crate::operation::create_curation_policy::builders::CreateCurationPolicyInputBuilder::default()
    }
}

/// A builder for [`CreateCurationPolicyInput`](crate::operation::create_curation_policy::CreateCurationPolicyInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateCurationPolicyInputBuilder {
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) policy_document: ::std::option::Option<::std::string::String>,
    pub(crate) auto_reject_after_seconds: ::std::option::Option<i64>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateCurationPolicyInputBuilder {
    /// <p>A unique, case-sensitive identifier that you provide to make the request idempotent. A retry with the same token and the same parameters returns the curation policy that the first request created. If you don't specify one, the AWS SDKs generate one.</p>
    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>A unique, case-sensitive identifier that you provide to make the request idempotent. A retry with the same token and the same parameters returns the curation policy that the first request created. If you don't specify one, the AWS SDKs generate one.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to make the request idempotent. A retry with the same token and the same parameters returns the curation policy that the first request created. If you don't specify one, the AWS SDKs generate one.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>The name of the curation policy. 3 to 63 characters: it must start with a letter and can contain only ASCII letters, digits, and hyphens.</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>The name of the curation policy. 3 to 63 characters: it must start with a letter and can contain only ASCII letters, digits, and hyphens.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the curation policy. 3 to 63 characters: it must start with a letter and can contain only ASCII letters, digits, and hyphens.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>A description of the curation policy. Up to 1,024 characters, with no control characters.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A description of the curation policy. Up to 1,024 characters, with no control characters.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A description of the curation policy. Up to 1,024 characters, with no control characters.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The policy's rules, as a Cedar policy document.</p>
    /// This field is required.
    pub fn policy_document(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.policy_document = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The policy's rules, as a Cedar policy document.</p>
    pub fn set_policy_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.policy_document = input;
        self
    }
    /// <p>The policy's rules, as a Cedar policy document.</p>
    pub fn get_policy_document(&self) -> &::std::option::Option<::std::string::String> {
        &self.policy_document
    }
    /// <p>The number of seconds that a curation proposal held for review under this policy can wait for a decision before it is rejected automatically. Valid range: 86,400 (1 day) to 15,552,000 (180 days). If you omit it, proposals held under this policy are never rejected automatically.</p>
    pub fn auto_reject_after_seconds(mut self, input: i64) -> Self {
        self.auto_reject_after_seconds = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of seconds that a curation proposal held for review under this policy can wait for a decision before it is rejected automatically. Valid range: 86,400 (1 day) to 15,552,000 (180 days). If you omit it, proposals held under this policy are never rejected automatically.</p>
    pub fn set_auto_reject_after_seconds(mut self, input: ::std::option::Option<i64>) -> Self {
        self.auto_reject_after_seconds = input;
        self
    }
    /// <p>The number of seconds that a curation proposal held for review under this policy can wait for a decision before it is rejected automatically. Valid range: 86,400 (1 day) to 15,552,000 (180 days). If you omit it, proposals held under this policy are never rejected automatically.</p>
    pub fn get_auto_reject_after_seconds(&self) -> &::std::option::Option<i64> {
        &self.auto_reject_after_seconds
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Tags to add to the curation policy when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with <code>aws:</code>. To add tags, you also need <code>context:TagResource</code> permission on the new curation policy. If you specify more than 50 user tags, the request fails with <code>ServiceQuotaExceededException</code>, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails with <code>ValidationException</code>.</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 to add to the curation policy when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with <code>aws:</code>. To add tags, you also need <code>context:TagResource</code> permission on the new curation policy. If you specify more than 50 user tags, the request fails with <code>ServiceQuotaExceededException</code>, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails with <code>ValidationException</code>.</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 to add to the curation policy when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with <code>aws:</code>. To add tags, you also need <code>context:TagResource</code> permission on the new curation policy. If you specify more than 50 user tags, the request fails with <code>ServiceQuotaExceededException</code>, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails with <code>ValidationException</code>.</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 [`CreateCurationPolicyInput`](crate::operation::create_curation_policy::CreateCurationPolicyInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_curation_policy::CreateCurationPolicyInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_curation_policy::CreateCurationPolicyInput {
            client_token: self.client_token,
            name: self.name,
            description: self.description,
            policy_document: self.policy_document,
            auto_reject_after_seconds: self.auto_reject_after_seconds,
            tags: self.tags,
        })
    }
}