1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// 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 indexes with different types.</p>
/// <p><code>"policyDocument": "{"Fields": \[ "TransactionId" \], "FieldsV2": {"RequestId": {"type": "FIELD_INDEX"}, "APIName": {"type": "FACET"}, "StatusCode": {"type": "FACET"}}}"</code></p>
/// <p>You can use <code>FieldsV2</code> to specify the type for each field. Supported types are <code>FIELD_INDEX</code> and <code>FACET</code>. Field names within <code>Fields</code> and <code>FieldsV2</code> must be mutually exclusive.</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 indexes with different types.</p>
/// <p><code>"policyDocument": "{"Fields": \[ "TransactionId" \], "FieldsV2": {"RequestId": {"type": "FIELD_INDEX"}, "APIName": {"type": "FACET"}, "StatusCode": {"type": "FACET"}}}"</code></p>
/// <p>You can use <code>FieldsV2</code> to specify the type for each field. Supported types are <code>FIELD_INDEX</code> and <code>FACET</code>. Field names within <code>Fields</code> and <code>FieldsV2</code> must be mutually exclusive.</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 indexes with different types.</p>
/// <p><code>"policyDocument": "{"Fields": \[ "TransactionId" \], "FieldsV2": {"RequestId": {"type": "FIELD_INDEX"}, "APIName": {"type": "FACET"}, "StatusCode": {"type": "FACET"}}}"</code></p>
/// <p>You can use <code>FieldsV2</code> to specify the type for each field. Supported types are <code>FIELD_INDEX</code> and <code>FACET</code>. Field names within <code>Fields</code> and <code>FieldsV2</code> must be mutually exclusive.</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 indexes with different types.</p>
/// <p><code>"policyDocument": "{"Fields": \[ "TransactionId" \], "FieldsV2": {"RequestId": {"type": "FIELD_INDEX"}, "APIName": {"type": "FACET"}, "StatusCode": {"type": "FACET"}}}"</code></p>
/// <p>You can use <code>FieldsV2</code> to specify the type for each field. Supported types are <code>FIELD_INDEX</code> and <code>FACET</code>. Field names within <code>Fields</code> and <code>FieldsV2</code> must be mutually exclusive.</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 indexes with different types.</p>
/// <p><code>"policyDocument": "{"Fields": \[ "TransactionId" \], "FieldsV2": {"RequestId": {"type": "FIELD_INDEX"}, "APIName": {"type": "FACET"}, "StatusCode": {"type": "FACET"}}}"</code></p>
/// <p>You can use <code>FieldsV2</code> to specify the type for each field. Supported types are <code>FIELD_INDEX</code> and <code>FACET</code>. Field names within <code>Fields</code> and <code>FieldsV2</code> must be mutually exclusive.</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,
})
}
}