aws_sdk_oam/operation/get_link/
_get_link_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetLinkOutput {
6    /// <p>The ARN of the link.</p>
7    pub arn: ::std::option::Option<::std::string::String>,
8    /// <p>The random ID string that Amazon Web Services generated as part of the link ARN.</p>
9    pub id: ::std::option::Option<::std::string::String>,
10    /// <p>The label that you assigned to this link, with the variables resolved to their actual values.</p>
11    pub label: ::std::option::Option<::std::string::String>,
12    /// <p>The exact label template that was specified when the link was created, with the template variables not resolved.</p>
13    pub label_template: ::std::option::Option<::std::string::String>,
14    /// <p>The resource types supported by this link.</p>
15    pub resource_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
16    /// <p>The ARN of the sink that is used for this link.</p>
17    pub sink_arn: ::std::option::Option<::std::string::String>,
18    /// <p>The tags assigned to the link.</p>
19    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
20    /// <p>This structure includes filters that specify which metric namespaces and which log groups are shared from the source account to the monitoring account.</p>
21    pub link_configuration: ::std::option::Option<crate::types::LinkConfiguration>,
22    _request_id: Option<String>,
23}
24impl GetLinkOutput {
25    /// <p>The ARN of the link.</p>
26    pub fn arn(&self) -> ::std::option::Option<&str> {
27        self.arn.as_deref()
28    }
29    /// <p>The random ID string that Amazon Web Services generated as part of the link ARN.</p>
30    pub fn id(&self) -> ::std::option::Option<&str> {
31        self.id.as_deref()
32    }
33    /// <p>The label that you assigned to this link, with the variables resolved to their actual values.</p>
34    pub fn label(&self) -> ::std::option::Option<&str> {
35        self.label.as_deref()
36    }
37    /// <p>The exact label template that was specified when the link was created, with the template variables not resolved.</p>
38    pub fn label_template(&self) -> ::std::option::Option<&str> {
39        self.label_template.as_deref()
40    }
41    /// <p>The resource types supported by this link.</p>
42    ///
43    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resource_types.is_none()`.
44    pub fn resource_types(&self) -> &[::std::string::String] {
45        self.resource_types.as_deref().unwrap_or_default()
46    }
47    /// <p>The ARN of the sink that is used for this link.</p>
48    pub fn sink_arn(&self) -> ::std::option::Option<&str> {
49        self.sink_arn.as_deref()
50    }
51    /// <p>The tags assigned to the link.</p>
52    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
53        self.tags.as_ref()
54    }
55    /// <p>This structure includes filters that specify which metric namespaces and which log groups are shared from the source account to the monitoring account.</p>
56    pub fn link_configuration(&self) -> ::std::option::Option<&crate::types::LinkConfiguration> {
57        self.link_configuration.as_ref()
58    }
59}
60impl ::aws_types::request_id::RequestId for GetLinkOutput {
61    fn request_id(&self) -> Option<&str> {
62        self._request_id.as_deref()
63    }
64}
65impl GetLinkOutput {
66    /// Creates a new builder-style object to manufacture [`GetLinkOutput`](crate::operation::get_link::GetLinkOutput).
67    pub fn builder() -> crate::operation::get_link::builders::GetLinkOutputBuilder {
68        crate::operation::get_link::builders::GetLinkOutputBuilder::default()
69    }
70}
71
72/// A builder for [`GetLinkOutput`](crate::operation::get_link::GetLinkOutput).
73#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
74#[non_exhaustive]
75pub struct GetLinkOutputBuilder {
76    pub(crate) arn: ::std::option::Option<::std::string::String>,
77    pub(crate) id: ::std::option::Option<::std::string::String>,
78    pub(crate) label: ::std::option::Option<::std::string::String>,
79    pub(crate) label_template: ::std::option::Option<::std::string::String>,
80    pub(crate) resource_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
81    pub(crate) sink_arn: ::std::option::Option<::std::string::String>,
82    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
83    pub(crate) link_configuration: ::std::option::Option<crate::types::LinkConfiguration>,
84    _request_id: Option<String>,
85}
86impl GetLinkOutputBuilder {
87    /// <p>The ARN of the link.</p>
88    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.arn = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The ARN of the link.</p>
93    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.arn = input;
95        self
96    }
97    /// <p>The ARN of the link.</p>
98    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
99        &self.arn
100    }
101    /// <p>The random ID string that Amazon Web Services generated as part of the link ARN.</p>
102    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.id = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>The random ID string that Amazon Web Services generated as part of the link ARN.</p>
107    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.id = input;
109        self
110    }
111    /// <p>The random ID string that Amazon Web Services generated as part of the link ARN.</p>
112    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
113        &self.id
114    }
115    /// <p>The label that you assigned to this link, with the variables resolved to their actual values.</p>
116    pub fn label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.label = ::std::option::Option::Some(input.into());
118        self
119    }
120    /// <p>The label that you assigned to this link, with the variables resolved to their actual values.</p>
121    pub fn set_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.label = input;
123        self
124    }
125    /// <p>The label that you assigned to this link, with the variables resolved to their actual values.</p>
126    pub fn get_label(&self) -> &::std::option::Option<::std::string::String> {
127        &self.label
128    }
129    /// <p>The exact label template that was specified when the link was created, with the template variables not resolved.</p>
130    pub fn label_template(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.label_template = ::std::option::Option::Some(input.into());
132        self
133    }
134    /// <p>The exact label template that was specified when the link was created, with the template variables not resolved.</p>
135    pub fn set_label_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.label_template = input;
137        self
138    }
139    /// <p>The exact label template that was specified when the link was created, with the template variables not resolved.</p>
140    pub fn get_label_template(&self) -> &::std::option::Option<::std::string::String> {
141        &self.label_template
142    }
143    /// Appends an item to `resource_types`.
144    ///
145    /// To override the contents of this collection use [`set_resource_types`](Self::set_resource_types).
146    ///
147    /// <p>The resource types supported by this link.</p>
148    pub fn resource_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        let mut v = self.resource_types.unwrap_or_default();
150        v.push(input.into());
151        self.resource_types = ::std::option::Option::Some(v);
152        self
153    }
154    /// <p>The resource types supported by this link.</p>
155    pub fn set_resource_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
156        self.resource_types = input;
157        self
158    }
159    /// <p>The resource types supported by this link.</p>
160    pub fn get_resource_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
161        &self.resource_types
162    }
163    /// <p>The ARN of the sink that is used for this link.</p>
164    pub fn sink_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.sink_arn = ::std::option::Option::Some(input.into());
166        self
167    }
168    /// <p>The ARN of the sink that is used for this link.</p>
169    pub fn set_sink_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.sink_arn = input;
171        self
172    }
173    /// <p>The ARN of the sink that is used for this link.</p>
174    pub fn get_sink_arn(&self) -> &::std::option::Option<::std::string::String> {
175        &self.sink_arn
176    }
177    /// Adds a key-value pair to `tags`.
178    ///
179    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
180    ///
181    /// <p>The tags assigned to the link.</p>
182    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
183        let mut hash_map = self.tags.unwrap_or_default();
184        hash_map.insert(k.into(), v.into());
185        self.tags = ::std::option::Option::Some(hash_map);
186        self
187    }
188    /// <p>The tags assigned to the link.</p>
189    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
190        self.tags = input;
191        self
192    }
193    /// <p>The tags assigned to the link.</p>
194    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
195        &self.tags
196    }
197    /// <p>This structure includes filters that specify which metric namespaces and which log groups are shared from the source account to the monitoring account.</p>
198    pub fn link_configuration(mut self, input: crate::types::LinkConfiguration) -> Self {
199        self.link_configuration = ::std::option::Option::Some(input);
200        self
201    }
202    /// <p>This structure includes filters that specify which metric namespaces and which log groups are shared from the source account to the monitoring account.</p>
203    pub fn set_link_configuration(mut self, input: ::std::option::Option<crate::types::LinkConfiguration>) -> Self {
204        self.link_configuration = input;
205        self
206    }
207    /// <p>This structure includes filters that specify which metric namespaces and which log groups are shared from the source account to the monitoring account.</p>
208    pub fn get_link_configuration(&self) -> &::std::option::Option<crate::types::LinkConfiguration> {
209        &self.link_configuration
210    }
211    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
212        self._request_id = Some(request_id.into());
213        self
214    }
215
216    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
217        self._request_id = request_id;
218        self
219    }
220    /// Consumes the builder and constructs a [`GetLinkOutput`](crate::operation::get_link::GetLinkOutput).
221    pub fn build(self) -> crate::operation::get_link::GetLinkOutput {
222        crate::operation::get_link::GetLinkOutput {
223            arn: self.arn,
224            id: self.id,
225            label: self.label,
226            label_template: self.label_template,
227            resource_types: self.resource_types,
228            sink_arn: self.sink_arn,
229            tags: self.tags,
230            link_configuration: self.link_configuration,
231            _request_id: self._request_id,
232        }
233    }
234}