aws_sdk_applicationinsights/types/_log_pattern.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>An object that defines the log patterns that belongs to a <code>LogPatternSet</code>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct LogPattern {
7 /// <p>The name of the log pattern. A log pattern name can contain as many as 30 characters, and it cannot be empty. The characters can be Unicode letters, digits, or one of the following symbols: period, dash, underscore.</p>
8 pub pattern_set_name: ::std::option::Option<::std::string::String>,
9 /// <p>The name of the log pattern. A log pattern name can contain as many as 50 characters, and it cannot be empty. The characters can be Unicode letters, digits, or one of the following symbols: period, dash, underscore.</p>
10 pub pattern_name: ::std::option::Option<::std::string::String>,
11 /// <p>A regular expression that defines the log pattern. A log pattern can contain as many as 50 characters, and it cannot be empty. The pattern must be DFA compatible. Patterns that utilize forward lookahead or backreference constructions are not supported.</p>
12 pub pattern: ::std::option::Option<::std::string::String>,
13 /// <p>Rank of the log pattern. Must be a value between <code>1</code> and <code>1,000,000</code>. The patterns are sorted by rank, so we recommend that you set your highest priority patterns with the lowest rank. A pattern of rank <code>1</code> will be the first to get matched to a log line. A pattern of rank <code>1,000,000</code> will be last to get matched. When you configure custom log patterns from the console, a <code>Low</code> severity pattern translates to a <code>750,000</code> rank. A <code>Medium</code> severity pattern translates to a <code>500,000</code> rank. And a <code>High</code> severity pattern translates to a <code>250,000</code> rank. Rank values less than <code>1</code> or greater than <code>1,000,000</code> are reserved for Amazon Web Services provided patterns.</p>
14 pub rank: i32,
15}
16impl LogPattern {
17 /// <p>The name of the log pattern. A log pattern name can contain as many as 30 characters, and it cannot be empty. The characters can be Unicode letters, digits, or one of the following symbols: period, dash, underscore.</p>
18 pub fn pattern_set_name(&self) -> ::std::option::Option<&str> {
19 self.pattern_set_name.as_deref()
20 }
21 /// <p>The name of the log pattern. A log pattern name can contain as many as 50 characters, and it cannot be empty. The characters can be Unicode letters, digits, or one of the following symbols: period, dash, underscore.</p>
22 pub fn pattern_name(&self) -> ::std::option::Option<&str> {
23 self.pattern_name.as_deref()
24 }
25 /// <p>A regular expression that defines the log pattern. A log pattern can contain as many as 50 characters, and it cannot be empty. The pattern must be DFA compatible. Patterns that utilize forward lookahead or backreference constructions are not supported.</p>
26 pub fn pattern(&self) -> ::std::option::Option<&str> {
27 self.pattern.as_deref()
28 }
29 /// <p>Rank of the log pattern. Must be a value between <code>1</code> and <code>1,000,000</code>. The patterns are sorted by rank, so we recommend that you set your highest priority patterns with the lowest rank. A pattern of rank <code>1</code> will be the first to get matched to a log line. A pattern of rank <code>1,000,000</code> will be last to get matched. When you configure custom log patterns from the console, a <code>Low</code> severity pattern translates to a <code>750,000</code> rank. A <code>Medium</code> severity pattern translates to a <code>500,000</code> rank. And a <code>High</code> severity pattern translates to a <code>250,000</code> rank. Rank values less than <code>1</code> or greater than <code>1,000,000</code> are reserved for Amazon Web Services provided patterns.</p>
30 pub fn rank(&self) -> i32 {
31 self.rank
32 }
33}
34impl LogPattern {
35 /// Creates a new builder-style object to manufacture [`LogPattern`](crate::types::LogPattern).
36 pub fn builder() -> crate::types::builders::LogPatternBuilder {
37 crate::types::builders::LogPatternBuilder::default()
38 }
39}
40
41/// A builder for [`LogPattern`](crate::types::LogPattern).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct LogPatternBuilder {
45 pub(crate) pattern_set_name: ::std::option::Option<::std::string::String>,
46 pub(crate) pattern_name: ::std::option::Option<::std::string::String>,
47 pub(crate) pattern: ::std::option::Option<::std::string::String>,
48 pub(crate) rank: ::std::option::Option<i32>,
49}
50impl LogPatternBuilder {
51 /// <p>The name of the log pattern. A log pattern name can contain as many as 30 characters, and it cannot be empty. The characters can be Unicode letters, digits, or one of the following symbols: period, dash, underscore.</p>
52 pub fn pattern_set_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53 self.pattern_set_name = ::std::option::Option::Some(input.into());
54 self
55 }
56 /// <p>The name of the log pattern. A log pattern name can contain as many as 30 characters, and it cannot be empty. The characters can be Unicode letters, digits, or one of the following symbols: period, dash, underscore.</p>
57 pub fn set_pattern_set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58 self.pattern_set_name = input;
59 self
60 }
61 /// <p>The name of the log pattern. A log pattern name can contain as many as 30 characters, and it cannot be empty. The characters can be Unicode letters, digits, or one of the following symbols: period, dash, underscore.</p>
62 pub fn get_pattern_set_name(&self) -> &::std::option::Option<::std::string::String> {
63 &self.pattern_set_name
64 }
65 /// <p>The name of the log pattern. A log pattern name can contain as many as 50 characters, and it cannot be empty. The characters can be Unicode letters, digits, or one of the following symbols: period, dash, underscore.</p>
66 pub fn pattern_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 self.pattern_name = ::std::option::Option::Some(input.into());
68 self
69 }
70 /// <p>The name of the log pattern. A log pattern name can contain as many as 50 characters, and it cannot be empty. The characters can be Unicode letters, digits, or one of the following symbols: period, dash, underscore.</p>
71 pub fn set_pattern_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72 self.pattern_name = input;
73 self
74 }
75 /// <p>The name of the log pattern. A log pattern name can contain as many as 50 characters, and it cannot be empty. The characters can be Unicode letters, digits, or one of the following symbols: period, dash, underscore.</p>
76 pub fn get_pattern_name(&self) -> &::std::option::Option<::std::string::String> {
77 &self.pattern_name
78 }
79 /// <p>A regular expression that defines the log pattern. A log pattern can contain as many as 50 characters, and it cannot be empty. The pattern must be DFA compatible. Patterns that utilize forward lookahead or backreference constructions are not supported.</p>
80 pub fn pattern(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81 self.pattern = ::std::option::Option::Some(input.into());
82 self
83 }
84 /// <p>A regular expression that defines the log pattern. A log pattern can contain as many as 50 characters, and it cannot be empty. The pattern must be DFA compatible. Patterns that utilize forward lookahead or backreference constructions are not supported.</p>
85 pub fn set_pattern(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86 self.pattern = input;
87 self
88 }
89 /// <p>A regular expression that defines the log pattern. A log pattern can contain as many as 50 characters, and it cannot be empty. The pattern must be DFA compatible. Patterns that utilize forward lookahead or backreference constructions are not supported.</p>
90 pub fn get_pattern(&self) -> &::std::option::Option<::std::string::String> {
91 &self.pattern
92 }
93 /// <p>Rank of the log pattern. Must be a value between <code>1</code> and <code>1,000,000</code>. The patterns are sorted by rank, so we recommend that you set your highest priority patterns with the lowest rank. A pattern of rank <code>1</code> will be the first to get matched to a log line. A pattern of rank <code>1,000,000</code> will be last to get matched. When you configure custom log patterns from the console, a <code>Low</code> severity pattern translates to a <code>750,000</code> rank. A <code>Medium</code> severity pattern translates to a <code>500,000</code> rank. And a <code>High</code> severity pattern translates to a <code>250,000</code> rank. Rank values less than <code>1</code> or greater than <code>1,000,000</code> are reserved for Amazon Web Services provided patterns.</p>
94 pub fn rank(mut self, input: i32) -> Self {
95 self.rank = ::std::option::Option::Some(input);
96 self
97 }
98 /// <p>Rank of the log pattern. Must be a value between <code>1</code> and <code>1,000,000</code>. The patterns are sorted by rank, so we recommend that you set your highest priority patterns with the lowest rank. A pattern of rank <code>1</code> will be the first to get matched to a log line. A pattern of rank <code>1,000,000</code> will be last to get matched. When you configure custom log patterns from the console, a <code>Low</code> severity pattern translates to a <code>750,000</code> rank. A <code>Medium</code> severity pattern translates to a <code>500,000</code> rank. And a <code>High</code> severity pattern translates to a <code>250,000</code> rank. Rank values less than <code>1</code> or greater than <code>1,000,000</code> are reserved for Amazon Web Services provided patterns.</p>
99 pub fn set_rank(mut self, input: ::std::option::Option<i32>) -> Self {
100 self.rank = input;
101 self
102 }
103 /// <p>Rank of the log pattern. Must be a value between <code>1</code> and <code>1,000,000</code>. The patterns are sorted by rank, so we recommend that you set your highest priority patterns with the lowest rank. A pattern of rank <code>1</code> will be the first to get matched to a log line. A pattern of rank <code>1,000,000</code> will be last to get matched. When you configure custom log patterns from the console, a <code>Low</code> severity pattern translates to a <code>750,000</code> rank. A <code>Medium</code> severity pattern translates to a <code>500,000</code> rank. And a <code>High</code> severity pattern translates to a <code>250,000</code> rank. Rank values less than <code>1</code> or greater than <code>1,000,000</code> are reserved for Amazon Web Services provided patterns.</p>
104 pub fn get_rank(&self) -> &::std::option::Option<i32> {
105 &self.rank
106 }
107 /// Consumes the builder and constructs a [`LogPattern`](crate::types::LogPattern).
108 pub fn build(self) -> crate::types::LogPattern {
109 crate::types::LogPattern {
110 pattern_set_name: self.pattern_set_name,
111 pattern_name: self.pattern_name,
112 pattern: self.pattern,
113 rank: self.rank.unwrap_or_default(),
114 }
115 }
116}