aws-sdk-cloudwatchlogs 1.81.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 PutIndexPolicyInput {
    /// <p>Specify either the log group name or log group ARN to apply this field index policy to. If you specify an ARN, use the format arn:aws:logs:<i>region</i>:<i>account-id</i>:log-group:<i>log_group_name</i> Don't include an * at the end.</p>
    pub log_group_identifier: ::std::option::Option<::std::string::String>,
    /// <p>The index policy document, in JSON format. The following is an example of an index policy document that creates two indexes, <code>RequestId</code> and <code>TransactionId</code>.</p>
    /// <p><code>"policyDocument": "{ "Fields": \[ "RequestId", "TransactionId" \] }"</code></p>
    /// <p>The policy document must include at least one field index. For more information about the fields that can be included and other restrictions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Field-Indexing-Syntax.html">Field index syntax and quotas</a>.</p>
    pub policy_document: ::std::option::Option<::std::string::String>,
}
impl PutIndexPolicyInput {
    /// <p>Specify either the log group name or log group ARN to apply this field index policy to. If you specify an ARN, use the format arn:aws:logs:<i>region</i>:<i>account-id</i>:log-group:<i>log_group_name</i> Don't include an * at the end.</p>
    pub fn log_group_identifier(&self) -> ::std::option::Option<&str> {
        self.log_group_identifier.as_deref()
    }
    /// <p>The index policy document, in JSON format. The following is an example of an index policy document that creates two indexes, <code>RequestId</code> and <code>TransactionId</code>.</p>
    /// <p><code>"policyDocument": "{ "Fields": \[ "RequestId", "TransactionId" \] }"</code></p>
    /// <p>The policy document must include at least one field index. For more information about the fields that can be included and other restrictions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Field-Indexing-Syntax.html">Field index syntax and quotas</a>.</p>
    pub fn policy_document(&self) -> ::std::option::Option<&str> {
        self.policy_document.as_deref()
    }
}
impl PutIndexPolicyInput {
    /// Creates a new builder-style object to manufacture [`PutIndexPolicyInput`](crate::operation::put_index_policy::PutIndexPolicyInput).
    pub fn builder() -> crate::operation::put_index_policy::builders::PutIndexPolicyInputBuilder {
        crate::operation::put_index_policy::builders::PutIndexPolicyInputBuilder::default()
    }
}

/// A builder for [`PutIndexPolicyInput`](crate::operation::put_index_policy::PutIndexPolicyInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutIndexPolicyInputBuilder {
    pub(crate) log_group_identifier: ::std::option::Option<::std::string::String>,
    pub(crate) policy_document: ::std::option::Option<::std::string::String>,
}
impl PutIndexPolicyInputBuilder {
    /// <p>Specify either the log group name or log group ARN to apply this field index policy to. If you specify an ARN, use the format arn:aws:logs:<i>region</i>:<i>account-id</i>:log-group:<i>log_group_name</i> Don't include an * at the end.</p>
    /// This field is required.
    pub fn log_group_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.log_group_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specify either the log group name or log group ARN to apply this field index policy to. If you specify an ARN, use the format arn:aws:logs:<i>region</i>:<i>account-id</i>:log-group:<i>log_group_name</i> Don't include an * at the end.</p>
    pub fn set_log_group_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.log_group_identifier = input;
        self
    }
    /// <p>Specify either the log group name or log group ARN to apply this field index policy to. If you specify an ARN, use the format arn:aws:logs:<i>region</i>:<i>account-id</i>:log-group:<i>log_group_name</i> Don't include an * at the end.</p>
    pub fn get_log_group_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.log_group_identifier
    }
    /// <p>The index policy document, in JSON format. The following is an example of an index policy document that creates two indexes, <code>RequestId</code> and <code>TransactionId</code>.</p>
    /// <p><code>"policyDocument": "{ "Fields": \[ "RequestId", "TransactionId" \] }"</code></p>
    /// <p>The policy document must include at least one field index. For more information about the fields that can be included and other restrictions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Field-Indexing-Syntax.html">Field index syntax and quotas</a>.</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 index policy document, in JSON format. The following is an example of an index policy document that creates two indexes, <code>RequestId</code> and <code>TransactionId</code>.</p>
    /// <p><code>"policyDocument": "{ "Fields": \[ "RequestId", "TransactionId" \] }"</code></p>
    /// <p>The policy document must include at least one field index. For more information about the fields that can be included and other restrictions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Field-Indexing-Syntax.html">Field index syntax and quotas</a>.</p>
    pub fn set_policy_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.policy_document = input;
        self
    }
    /// <p>The index policy document, in JSON format. The following is an example of an index policy document that creates two indexes, <code>RequestId</code> and <code>TransactionId</code>.</p>
    /// <p><code>"policyDocument": "{ "Fields": \[ "RequestId", "TransactionId" \] }"</code></p>
    /// <p>The policy document must include at least one field index. For more information about the fields that can be included and other restrictions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Field-Indexing-Syntax.html">Field index syntax and quotas</a>.</p>
    pub fn get_policy_document(&self) -> &::std::option::Option<::std::string::String> {
        &self.policy_document
    }
    /// Consumes the builder and constructs a [`PutIndexPolicyInput`](crate::operation::put_index_policy::PutIndexPolicyInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::put_index_policy::PutIndexPolicyInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::put_index_policy::PutIndexPolicyInput {
            log_group_identifier: self.log_group_identifier,
            policy_document: self.policy_document,
        })
    }
}