aws_sdk_oam/operation/get_sink/
_get_sink_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 GetSinkOutput {
6    /// <p>The ARN of the sink.</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 sink ARN.</p>
9    pub id: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the sink.</p>
11    pub name: ::std::option::Option<::std::string::String>,
12    /// <p>The tags assigned to the sink.</p>
13    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14    _request_id: Option<String>,
15}
16impl GetSinkOutput {
17    /// <p>The ARN of the sink.</p>
18    pub fn arn(&self) -> ::std::option::Option<&str> {
19        self.arn.as_deref()
20    }
21    /// <p>The random ID string that Amazon Web Services generated as part of the sink ARN.</p>
22    pub fn id(&self) -> ::std::option::Option<&str> {
23        self.id.as_deref()
24    }
25    /// <p>The name of the sink.</p>
26    pub fn name(&self) -> ::std::option::Option<&str> {
27        self.name.as_deref()
28    }
29    /// <p>The tags assigned to the sink.</p>
30    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
31        self.tags.as_ref()
32    }
33}
34impl ::aws_types::request_id::RequestId for GetSinkOutput {
35    fn request_id(&self) -> Option<&str> {
36        self._request_id.as_deref()
37    }
38}
39impl GetSinkOutput {
40    /// Creates a new builder-style object to manufacture [`GetSinkOutput`](crate::operation::get_sink::GetSinkOutput).
41    pub fn builder() -> crate::operation::get_sink::builders::GetSinkOutputBuilder {
42        crate::operation::get_sink::builders::GetSinkOutputBuilder::default()
43    }
44}
45
46/// A builder for [`GetSinkOutput`](crate::operation::get_sink::GetSinkOutput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct GetSinkOutputBuilder {
50    pub(crate) arn: ::std::option::Option<::std::string::String>,
51    pub(crate) id: ::std::option::Option<::std::string::String>,
52    pub(crate) name: ::std::option::Option<::std::string::String>,
53    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
54    _request_id: Option<String>,
55}
56impl GetSinkOutputBuilder {
57    /// <p>The ARN of the sink.</p>
58    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        self.arn = ::std::option::Option::Some(input.into());
60        self
61    }
62    /// <p>The ARN of the sink.</p>
63    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64        self.arn = input;
65        self
66    }
67    /// <p>The ARN of the sink.</p>
68    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
69        &self.arn
70    }
71    /// <p>The random ID string that Amazon Web Services generated as part of the sink ARN.</p>
72    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73        self.id = ::std::option::Option::Some(input.into());
74        self
75    }
76    /// <p>The random ID string that Amazon Web Services generated as part of the sink ARN.</p>
77    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78        self.id = input;
79        self
80    }
81    /// <p>The random ID string that Amazon Web Services generated as part of the sink ARN.</p>
82    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
83        &self.id
84    }
85    /// <p>The name of the sink.</p>
86    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87        self.name = ::std::option::Option::Some(input.into());
88        self
89    }
90    /// <p>The name of the sink.</p>
91    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92        self.name = input;
93        self
94    }
95    /// <p>The name of the sink.</p>
96    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
97        &self.name
98    }
99    /// Adds a key-value pair to `tags`.
100    ///
101    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
102    ///
103    /// <p>The tags assigned to the sink.</p>
104    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
105        let mut hash_map = self.tags.unwrap_or_default();
106        hash_map.insert(k.into(), v.into());
107        self.tags = ::std::option::Option::Some(hash_map);
108        self
109    }
110    /// <p>The tags assigned to the sink.</p>
111    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
112        self.tags = input;
113        self
114    }
115    /// <p>The tags assigned to the sink.</p>
116    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
117        &self.tags
118    }
119    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
120        self._request_id = Some(request_id.into());
121        self
122    }
123
124    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
125        self._request_id = request_id;
126        self
127    }
128    /// Consumes the builder and constructs a [`GetSinkOutput`](crate::operation::get_sink::GetSinkOutput).
129    pub fn build(self) -> crate::operation::get_sink::GetSinkOutput {
130        crate::operation::get_sink::GetSinkOutput {
131            arn: self.arn,
132            id: self.id,
133            name: self.name,
134            tags: self.tags,
135            _request_id: self._request_id,
136        }
137    }
138}