aws_sdk_connectcases/operation/get_domain/
_get_domain_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 GetDomainOutput {
6    /// <p>The unique identifier of the Cases domain.</p>
7    pub domain_id: ::std::string::String,
8    /// <p>The Amazon Resource Name (ARN) for the Cases domain.</p>
9    pub domain_arn: ::std::string::String,
10    /// <p>The name of the Cases domain.</p>
11    pub name: ::std::string::String,
12    /// <p>The timestamp when the Cases domain was created.</p>
13    pub created_time: ::aws_smithy_types::DateTime,
14    /// <p>The status of the Cases domain.</p>
15    pub domain_status: crate::types::DomainStatus,
16    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
17    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
18    _request_id: Option<String>,
19}
20impl GetDomainOutput {
21    /// <p>The unique identifier of the Cases domain.</p>
22    pub fn domain_id(&self) -> &str {
23        use std::ops::Deref;
24        self.domain_id.deref()
25    }
26    /// <p>The Amazon Resource Name (ARN) for the Cases domain.</p>
27    pub fn domain_arn(&self) -> &str {
28        use std::ops::Deref;
29        self.domain_arn.deref()
30    }
31    /// <p>The name of the Cases domain.</p>
32    pub fn name(&self) -> &str {
33        use std::ops::Deref;
34        self.name.deref()
35    }
36    /// <p>The timestamp when the Cases domain was created.</p>
37    pub fn created_time(&self) -> &::aws_smithy_types::DateTime {
38        &self.created_time
39    }
40    /// <p>The status of the Cases domain.</p>
41    pub fn domain_status(&self) -> &crate::types::DomainStatus {
42        &self.domain_status
43    }
44    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
45    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
46        self.tags.as_ref()
47    }
48}
49impl ::aws_types::request_id::RequestId for GetDomainOutput {
50    fn request_id(&self) -> Option<&str> {
51        self._request_id.as_deref()
52    }
53}
54impl GetDomainOutput {
55    /// Creates a new builder-style object to manufacture [`GetDomainOutput`](crate::operation::get_domain::GetDomainOutput).
56    pub fn builder() -> crate::operation::get_domain::builders::GetDomainOutputBuilder {
57        crate::operation::get_domain::builders::GetDomainOutputBuilder::default()
58    }
59}
60
61/// A builder for [`GetDomainOutput`](crate::operation::get_domain::GetDomainOutput).
62#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
63#[non_exhaustive]
64pub struct GetDomainOutputBuilder {
65    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
66    pub(crate) domain_arn: ::std::option::Option<::std::string::String>,
67    pub(crate) name: ::std::option::Option<::std::string::String>,
68    pub(crate) created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
69    pub(crate) domain_status: ::std::option::Option<crate::types::DomainStatus>,
70    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
71    _request_id: Option<String>,
72}
73impl GetDomainOutputBuilder {
74    /// <p>The unique identifier of the Cases domain.</p>
75    /// This field is required.
76    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.domain_id = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// <p>The unique identifier of the Cases domain.</p>
81    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.domain_id = input;
83        self
84    }
85    /// <p>The unique identifier of the Cases domain.</p>
86    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
87        &self.domain_id
88    }
89    /// <p>The Amazon Resource Name (ARN) for the Cases domain.</p>
90    /// This field is required.
91    pub fn domain_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.domain_arn = ::std::option::Option::Some(input.into());
93        self
94    }
95    /// <p>The Amazon Resource Name (ARN) for the Cases domain.</p>
96    pub fn set_domain_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.domain_arn = input;
98        self
99    }
100    /// <p>The Amazon Resource Name (ARN) for the Cases domain.</p>
101    pub fn get_domain_arn(&self) -> &::std::option::Option<::std::string::String> {
102        &self.domain_arn
103    }
104    /// <p>The name of the Cases domain.</p>
105    /// This field is required.
106    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107        self.name = ::std::option::Option::Some(input.into());
108        self
109    }
110    /// <p>The name of the Cases domain.</p>
111    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
112        self.name = input;
113        self
114    }
115    /// <p>The name of the Cases domain.</p>
116    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
117        &self.name
118    }
119    /// <p>The timestamp when the Cases domain was created.</p>
120    /// This field is required.
121    pub fn created_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
122        self.created_time = ::std::option::Option::Some(input);
123        self
124    }
125    /// <p>The timestamp when the Cases domain was created.</p>
126    pub fn set_created_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
127        self.created_time = input;
128        self
129    }
130    /// <p>The timestamp when the Cases domain was created.</p>
131    pub fn get_created_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
132        &self.created_time
133    }
134    /// <p>The status of the Cases domain.</p>
135    /// This field is required.
136    pub fn domain_status(mut self, input: crate::types::DomainStatus) -> Self {
137        self.domain_status = ::std::option::Option::Some(input);
138        self
139    }
140    /// <p>The status of the Cases domain.</p>
141    pub fn set_domain_status(mut self, input: ::std::option::Option<crate::types::DomainStatus>) -> Self {
142        self.domain_status = input;
143        self
144    }
145    /// <p>The status of the Cases domain.</p>
146    pub fn get_domain_status(&self) -> &::std::option::Option<crate::types::DomainStatus> {
147        &self.domain_status
148    }
149    /// Adds a key-value pair to `tags`.
150    ///
151    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
152    ///
153    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
154    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self {
155        let mut hash_map = self.tags.unwrap_or_default();
156        hash_map.insert(k.into(), v);
157        self.tags = ::std::option::Option::Some(hash_map);
158        self
159    }
160    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
161    pub fn set_tags(
162        mut self,
163        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
164    ) -> Self {
165        self.tags = input;
166        self
167    }
168    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
169    pub fn get_tags(
170        &self,
171    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
172        &self.tags
173    }
174    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
175        self._request_id = Some(request_id.into());
176        self
177    }
178
179    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
180        self._request_id = request_id;
181        self
182    }
183    /// Consumes the builder and constructs a [`GetDomainOutput`](crate::operation::get_domain::GetDomainOutput).
184    /// This method will fail if any of the following fields are not set:
185    /// - [`domain_id`](crate::operation::get_domain::builders::GetDomainOutputBuilder::domain_id)
186    /// - [`domain_arn`](crate::operation::get_domain::builders::GetDomainOutputBuilder::domain_arn)
187    /// - [`name`](crate::operation::get_domain::builders::GetDomainOutputBuilder::name)
188    /// - [`created_time`](crate::operation::get_domain::builders::GetDomainOutputBuilder::created_time)
189    /// - [`domain_status`](crate::operation::get_domain::builders::GetDomainOutputBuilder::domain_status)
190    pub fn build(self) -> ::std::result::Result<crate::operation::get_domain::GetDomainOutput, ::aws_smithy_types::error::operation::BuildError> {
191        ::std::result::Result::Ok(crate::operation::get_domain::GetDomainOutput {
192            domain_id: self.domain_id.ok_or_else(|| {
193                ::aws_smithy_types::error::operation::BuildError::missing_field(
194                    "domain_id",
195                    "domain_id was not specified but it is required when building GetDomainOutput",
196                )
197            })?,
198            domain_arn: self.domain_arn.ok_or_else(|| {
199                ::aws_smithy_types::error::operation::BuildError::missing_field(
200                    "domain_arn",
201                    "domain_arn was not specified but it is required when building GetDomainOutput",
202                )
203            })?,
204            name: self.name.ok_or_else(|| {
205                ::aws_smithy_types::error::operation::BuildError::missing_field(
206                    "name",
207                    "name was not specified but it is required when building GetDomainOutput",
208                )
209            })?,
210            created_time: self.created_time.ok_or_else(|| {
211                ::aws_smithy_types::error::operation::BuildError::missing_field(
212                    "created_time",
213                    "created_time was not specified but it is required when building GetDomainOutput",
214                )
215            })?,
216            domain_status: self.domain_status.ok_or_else(|| {
217                ::aws_smithy_types::error::operation::BuildError::missing_field(
218                    "domain_status",
219                    "domain_status was not specified but it is required when building GetDomainOutput",
220                )
221            })?,
222            tags: self.tags,
223            _request_id: self._request_id,
224        })
225    }
226}