aws_sdk_devopsguru/types/_tag_collection_filter.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A collection of Amazon Web Services tags used to filter insights. This is used to return insights generated from only resources that contain the tags in the tag collection.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct TagCollectionFilter {
7 /// <p>An Amazon Web Services tag <i>key</i> that is used to identify the Amazon Web Services resources that DevOps Guru analyzes. All Amazon Web Services resources in your account and Region tagged with this <i>key</i> make up your DevOps Guru application and analysis boundary.</p><important>
8 /// <p>The string used for a <i>key</i> in a tag that you use to define your resource coverage must begin with the prefix <code>Devops-guru-</code>. The tag <i>key</i> might be <code>DevOps-Guru-deployment-application</code> or <code>devops-guru-rds-application</code>. When you create a <i>key</i>, the case of characters in the <i>key</i> can be whatever you choose. After you create a <i>key</i>, it is case-sensitive. For example, DevOps Guru works with a <i>key</i> named <code>devops-guru-rds</code> and a <i>key</i> named <code>DevOps-Guru-RDS</code>, and these act as two different <i>keys</i>. Possible <i>key</i>/<i>value</i> pairs in your application might be <code>Devops-Guru-production-application/RDS</code> or <code>Devops-Guru-production-application/containers</code>.</p>
9 /// </important>
10 pub app_boundary_key: ::std::string::String,
11 /// <p>The values in an Amazon Web Services tag collection.</p>
12 /// <p>The tag's <i>value</i> is an optional field used to associate a string with the tag <i>key</i> (for example, <code>111122223333</code>, <code>Production</code>, or a team name). The <i>key</i> and <i>value</i> are the tag's <i>key</i> pair. Omitting the tag <i>value</i> is the same as using an empty string. Like tag <i>keys</i>, tag <i>values</i> are case-sensitive. You can specify a maximum of 256 characters for a tag value.</p>
13 pub tag_values: ::std::vec::Vec<::std::string::String>,
14}
15impl TagCollectionFilter {
16 /// <p>An Amazon Web Services tag <i>key</i> that is used to identify the Amazon Web Services resources that DevOps Guru analyzes. All Amazon Web Services resources in your account and Region tagged with this <i>key</i> make up your DevOps Guru application and analysis boundary.</p><important>
17 /// <p>The string used for a <i>key</i> in a tag that you use to define your resource coverage must begin with the prefix <code>Devops-guru-</code>. The tag <i>key</i> might be <code>DevOps-Guru-deployment-application</code> or <code>devops-guru-rds-application</code>. When you create a <i>key</i>, the case of characters in the <i>key</i> can be whatever you choose. After you create a <i>key</i>, it is case-sensitive. For example, DevOps Guru works with a <i>key</i> named <code>devops-guru-rds</code> and a <i>key</i> named <code>DevOps-Guru-RDS</code>, and these act as two different <i>keys</i>. Possible <i>key</i>/<i>value</i> pairs in your application might be <code>Devops-Guru-production-application/RDS</code> or <code>Devops-Guru-production-application/containers</code>.</p>
18 /// </important>
19 pub fn app_boundary_key(&self) -> &str {
20 use std::ops::Deref;
21 self.app_boundary_key.deref()
22 }
23 /// <p>The values in an Amazon Web Services tag collection.</p>
24 /// <p>The tag's <i>value</i> is an optional field used to associate a string with the tag <i>key</i> (for example, <code>111122223333</code>, <code>Production</code>, or a team name). The <i>key</i> and <i>value</i> are the tag's <i>key</i> pair. Omitting the tag <i>value</i> is the same as using an empty string. Like tag <i>keys</i>, tag <i>values</i> are case-sensitive. You can specify a maximum of 256 characters for a tag value.</p>
25 pub fn tag_values(&self) -> &[::std::string::String] {
26 use std::ops::Deref;
27 self.tag_values.deref()
28 }
29}
30impl TagCollectionFilter {
31 /// Creates a new builder-style object to manufacture [`TagCollectionFilter`](crate::types::TagCollectionFilter).
32 pub fn builder() -> crate::types::builders::TagCollectionFilterBuilder {
33 crate::types::builders::TagCollectionFilterBuilder::default()
34 }
35}
36
37/// A builder for [`TagCollectionFilter`](crate::types::TagCollectionFilter).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct TagCollectionFilterBuilder {
41 pub(crate) app_boundary_key: ::std::option::Option<::std::string::String>,
42 pub(crate) tag_values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
43}
44impl TagCollectionFilterBuilder {
45 /// <p>An Amazon Web Services tag <i>key</i> that is used to identify the Amazon Web Services resources that DevOps Guru analyzes. All Amazon Web Services resources in your account and Region tagged with this <i>key</i> make up your DevOps Guru application and analysis boundary.</p><important>
46 /// <p>The string used for a <i>key</i> in a tag that you use to define your resource coverage must begin with the prefix <code>Devops-guru-</code>. The tag <i>key</i> might be <code>DevOps-Guru-deployment-application</code> or <code>devops-guru-rds-application</code>. When you create a <i>key</i>, the case of characters in the <i>key</i> can be whatever you choose. After you create a <i>key</i>, it is case-sensitive. For example, DevOps Guru works with a <i>key</i> named <code>devops-guru-rds</code> and a <i>key</i> named <code>DevOps-Guru-RDS</code>, and these act as two different <i>keys</i>. Possible <i>key</i>/<i>value</i> pairs in your application might be <code>Devops-Guru-production-application/RDS</code> or <code>Devops-Guru-production-application/containers</code>.</p>
47 /// </important>
48 /// This field is required.
49 pub fn app_boundary_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
50 self.app_boundary_key = ::std::option::Option::Some(input.into());
51 self
52 }
53 /// <p>An Amazon Web Services tag <i>key</i> that is used to identify the Amazon Web Services resources that DevOps Guru analyzes. All Amazon Web Services resources in your account and Region tagged with this <i>key</i> make up your DevOps Guru application and analysis boundary.</p><important>
54 /// <p>The string used for a <i>key</i> in a tag that you use to define your resource coverage must begin with the prefix <code>Devops-guru-</code>. The tag <i>key</i> might be <code>DevOps-Guru-deployment-application</code> or <code>devops-guru-rds-application</code>. When you create a <i>key</i>, the case of characters in the <i>key</i> can be whatever you choose. After you create a <i>key</i>, it is case-sensitive. For example, DevOps Guru works with a <i>key</i> named <code>devops-guru-rds</code> and a <i>key</i> named <code>DevOps-Guru-RDS</code>, and these act as two different <i>keys</i>. Possible <i>key</i>/<i>value</i> pairs in your application might be <code>Devops-Guru-production-application/RDS</code> or <code>Devops-Guru-production-application/containers</code>.</p>
55 /// </important>
56 pub fn set_app_boundary_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57 self.app_boundary_key = input;
58 self
59 }
60 /// <p>An Amazon Web Services tag <i>key</i> that is used to identify the Amazon Web Services resources that DevOps Guru analyzes. All Amazon Web Services resources in your account and Region tagged with this <i>key</i> make up your DevOps Guru application and analysis boundary.</p><important>
61 /// <p>The string used for a <i>key</i> in a tag that you use to define your resource coverage must begin with the prefix <code>Devops-guru-</code>. The tag <i>key</i> might be <code>DevOps-Guru-deployment-application</code> or <code>devops-guru-rds-application</code>. When you create a <i>key</i>, the case of characters in the <i>key</i> can be whatever you choose. After you create a <i>key</i>, it is case-sensitive. For example, DevOps Guru works with a <i>key</i> named <code>devops-guru-rds</code> and a <i>key</i> named <code>DevOps-Guru-RDS</code>, and these act as two different <i>keys</i>. Possible <i>key</i>/<i>value</i> pairs in your application might be <code>Devops-Guru-production-application/RDS</code> or <code>Devops-Guru-production-application/containers</code>.</p>
62 /// </important>
63 pub fn get_app_boundary_key(&self) -> &::std::option::Option<::std::string::String> {
64 &self.app_boundary_key
65 }
66 /// Appends an item to `tag_values`.
67 ///
68 /// To override the contents of this collection use [`set_tag_values`](Self::set_tag_values).
69 ///
70 /// <p>The values in an Amazon Web Services tag collection.</p>
71 /// <p>The tag's <i>value</i> is an optional field used to associate a string with the tag <i>key</i> (for example, <code>111122223333</code>, <code>Production</code>, or a team name). The <i>key</i> and <i>value</i> are the tag's <i>key</i> pair. Omitting the tag <i>value</i> is the same as using an empty string. Like tag <i>keys</i>, tag <i>values</i> are case-sensitive. You can specify a maximum of 256 characters for a tag value.</p>
72 pub fn tag_values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73 let mut v = self.tag_values.unwrap_or_default();
74 v.push(input.into());
75 self.tag_values = ::std::option::Option::Some(v);
76 self
77 }
78 /// <p>The values in an Amazon Web Services tag collection.</p>
79 /// <p>The tag's <i>value</i> is an optional field used to associate a string with the tag <i>key</i> (for example, <code>111122223333</code>, <code>Production</code>, or a team name). The <i>key</i> and <i>value</i> are the tag's <i>key</i> pair. Omitting the tag <i>value</i> is the same as using an empty string. Like tag <i>keys</i>, tag <i>values</i> are case-sensitive. You can specify a maximum of 256 characters for a tag value.</p>
80 pub fn set_tag_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
81 self.tag_values = input;
82 self
83 }
84 /// <p>The values in an Amazon Web Services tag collection.</p>
85 /// <p>The tag's <i>value</i> is an optional field used to associate a string with the tag <i>key</i> (for example, <code>111122223333</code>, <code>Production</code>, or a team name). The <i>key</i> and <i>value</i> are the tag's <i>key</i> pair. Omitting the tag <i>value</i> is the same as using an empty string. Like tag <i>keys</i>, tag <i>values</i> are case-sensitive. You can specify a maximum of 256 characters for a tag value.</p>
86 pub fn get_tag_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
87 &self.tag_values
88 }
89 /// Consumes the builder and constructs a [`TagCollectionFilter`](crate::types::TagCollectionFilter).
90 /// This method will fail if any of the following fields are not set:
91 /// - [`app_boundary_key`](crate::types::builders::TagCollectionFilterBuilder::app_boundary_key)
92 /// - [`tag_values`](crate::types::builders::TagCollectionFilterBuilder::tag_values)
93 pub fn build(self) -> ::std::result::Result<crate::types::TagCollectionFilter, ::aws_smithy_types::error::operation::BuildError> {
94 ::std::result::Result::Ok(crate::types::TagCollectionFilter {
95 app_boundary_key: self.app_boundary_key.ok_or_else(|| {
96 ::aws_smithy_types::error::operation::BuildError::missing_field(
97 "app_boundary_key",
98 "app_boundary_key was not specified but it is required when building TagCollectionFilter",
99 )
100 })?,
101 tag_values: self.tag_values.ok_or_else(|| {
102 ::aws_smithy_types::error::operation::BuildError::missing_field(
103 "tag_values",
104 "tag_values was not specified but it is required when building TagCollectionFilter",
105 )
106 })?,
107 })
108 }
109}