aws-sdk-cloudwatchlogs 1.60.0

AWS SDK for Amazon CloudWatch Logs
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 PutDestinationPolicyInput {
    /// <p>A name for an existing destination.</p>
    pub destination_name: ::std::option::Option<::std::string::String>,
    /// <p>An IAM policy document that authorizes cross-account users to deliver their log events to the associated destination. This can be up to 5120 bytes.</p>
    pub access_policy: ::std::option::Option<::std::string::String>,
    /// <p>Specify true if you are updating an existing destination policy to grant permission to an organization ID instead of granting permission to individual Amazon Web Services accounts. Before you update a destination policy this way, you must first update the subscription filters in the accounts that send logs to this destination. If you do not, the subscription filters might stop working. By specifying <code>true</code> for <code>forceUpdate</code>, you are affirming that you have already updated the subscription filters. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Cross-Account-Log_Subscription-Update.html"> Updating an existing cross-account subscription</a></p>
    /// <p>If you omit this parameter, the default of <code>false</code> is used.</p>
    pub force_update: ::std::option::Option<bool>,
}
impl PutDestinationPolicyInput {
    /// <p>A name for an existing destination.</p>
    pub fn destination_name(&self) -> ::std::option::Option<&str> {
        self.destination_name.as_deref()
    }
    /// <p>An IAM policy document that authorizes cross-account users to deliver their log events to the associated destination. This can be up to 5120 bytes.</p>
    pub fn access_policy(&self) -> ::std::option::Option<&str> {
        self.access_policy.as_deref()
    }
    /// <p>Specify true if you are updating an existing destination policy to grant permission to an organization ID instead of granting permission to individual Amazon Web Services accounts. Before you update a destination policy this way, you must first update the subscription filters in the accounts that send logs to this destination. If you do not, the subscription filters might stop working. By specifying <code>true</code> for <code>forceUpdate</code>, you are affirming that you have already updated the subscription filters. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Cross-Account-Log_Subscription-Update.html"> Updating an existing cross-account subscription</a></p>
    /// <p>If you omit this parameter, the default of <code>false</code> is used.</p>
    pub fn force_update(&self) -> ::std::option::Option<bool> {
        self.force_update
    }
}
impl PutDestinationPolicyInput {
    /// Creates a new builder-style object to manufacture [`PutDestinationPolicyInput`](crate::operation::put_destination_policy::PutDestinationPolicyInput).
    pub fn builder() -> crate::operation::put_destination_policy::builders::PutDestinationPolicyInputBuilder {
        crate::operation::put_destination_policy::builders::PutDestinationPolicyInputBuilder::default()
    }
}

/// A builder for [`PutDestinationPolicyInput`](crate::operation::put_destination_policy::PutDestinationPolicyInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutDestinationPolicyInputBuilder {
    pub(crate) destination_name: ::std::option::Option<::std::string::String>,
    pub(crate) access_policy: ::std::option::Option<::std::string::String>,
    pub(crate) force_update: ::std::option::Option<bool>,
}
impl PutDestinationPolicyInputBuilder {
    /// <p>A name for an existing destination.</p>
    /// This field is required.
    pub fn destination_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.destination_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A name for an existing destination.</p>
    pub fn set_destination_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.destination_name = input;
        self
    }
    /// <p>A name for an existing destination.</p>
    pub fn get_destination_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.destination_name
    }
    /// <p>An IAM policy document that authorizes cross-account users to deliver their log events to the associated destination. This can be up to 5120 bytes.</p>
    /// This field is required.
    pub fn access_policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.access_policy = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An IAM policy document that authorizes cross-account users to deliver their log events to the associated destination. This can be up to 5120 bytes.</p>
    pub fn set_access_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.access_policy = input;
        self
    }
    /// <p>An IAM policy document that authorizes cross-account users to deliver their log events to the associated destination. This can be up to 5120 bytes.</p>
    pub fn get_access_policy(&self) -> &::std::option::Option<::std::string::String> {
        &self.access_policy
    }
    /// <p>Specify true if you are updating an existing destination policy to grant permission to an organization ID instead of granting permission to individual Amazon Web Services accounts. Before you update a destination policy this way, you must first update the subscription filters in the accounts that send logs to this destination. If you do not, the subscription filters might stop working. By specifying <code>true</code> for <code>forceUpdate</code>, you are affirming that you have already updated the subscription filters. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Cross-Account-Log_Subscription-Update.html"> Updating an existing cross-account subscription</a></p>
    /// <p>If you omit this parameter, the default of <code>false</code> is used.</p>
    pub fn force_update(mut self, input: bool) -> Self {
        self.force_update = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specify true if you are updating an existing destination policy to grant permission to an organization ID instead of granting permission to individual Amazon Web Services accounts. Before you update a destination policy this way, you must first update the subscription filters in the accounts that send logs to this destination. If you do not, the subscription filters might stop working. By specifying <code>true</code> for <code>forceUpdate</code>, you are affirming that you have already updated the subscription filters. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Cross-Account-Log_Subscription-Update.html"> Updating an existing cross-account subscription</a></p>
    /// <p>If you omit this parameter, the default of <code>false</code> is used.</p>
    pub fn set_force_update(mut self, input: ::std::option::Option<bool>) -> Self {
        self.force_update = input;
        self
    }
    /// <p>Specify true if you are updating an existing destination policy to grant permission to an organization ID instead of granting permission to individual Amazon Web Services accounts. Before you update a destination policy this way, you must first update the subscription filters in the accounts that send logs to this destination. If you do not, the subscription filters might stop working. By specifying <code>true</code> for <code>forceUpdate</code>, you are affirming that you have already updated the subscription filters. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Cross-Account-Log_Subscription-Update.html"> Updating an existing cross-account subscription</a></p>
    /// <p>If you omit this parameter, the default of <code>false</code> is used.</p>
    pub fn get_force_update(&self) -> &::std::option::Option<bool> {
        &self.force_update
    }
    /// Consumes the builder and constructs a [`PutDestinationPolicyInput`](crate::operation::put_destination_policy::PutDestinationPolicyInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::put_destination_policy::PutDestinationPolicyInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::put_destination_policy::PutDestinationPolicyInput {
            destination_name: self.destination_name,
            access_policy: self.access_policy,
            force_update: self.force_update,
        })
    }
}