aws_sdk_datazone/operation/get_subscription/
_get_subscription_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 GetSubscriptionOutput {
6    /// <p>The ID of the subscription.</p>
7    pub id: ::std::string::String,
8    /// <p>The Amazon DataZone user who created the subscription.</p>
9    pub created_by: ::std::string::String,
10    /// <p>The Amazon DataZone user who updated the subscription.</p>
11    pub updated_by: ::std::option::Option<::std::string::String>,
12    /// <p>The ID of the Amazon DataZone domain in which the subscription exists.</p>
13    pub domain_id: ::std::string::String,
14    /// <p>The status of the subscription.</p>
15    pub status: crate::types::SubscriptionStatus,
16    /// <p>The timestamp of when the subscription was created.</p>
17    pub created_at: ::aws_smithy_types::DateTime,
18    /// <p>The timestamp of when the subscription was updated.</p>
19    pub updated_at: ::aws_smithy_types::DateTime,
20    /// <p>The principal that owns the subscription.</p>
21    pub subscribed_principal: ::std::option::Option<crate::types::SubscribedPrincipal>,
22    /// <p>The details of the published asset for which the subscription grant is created.</p>
23    pub subscribed_listing: ::std::option::Option<crate::types::SubscribedListing>,
24    /// <p>The ID of the subscription request.</p>
25    pub subscription_request_id: ::std::option::Option<::std::string::String>,
26    /// <p>The retain permissions of the subscription.</p>
27    pub retain_permissions: ::std::option::Option<bool>,
28    _request_id: Option<String>,
29}
30impl GetSubscriptionOutput {
31    /// <p>The ID of the subscription.</p>
32    pub fn id(&self) -> &str {
33        use std::ops::Deref;
34        self.id.deref()
35    }
36    /// <p>The Amazon DataZone user who created the subscription.</p>
37    pub fn created_by(&self) -> &str {
38        use std::ops::Deref;
39        self.created_by.deref()
40    }
41    /// <p>The Amazon DataZone user who updated the subscription.</p>
42    pub fn updated_by(&self) -> ::std::option::Option<&str> {
43        self.updated_by.as_deref()
44    }
45    /// <p>The ID of the Amazon DataZone domain in which the subscription exists.</p>
46    pub fn domain_id(&self) -> &str {
47        use std::ops::Deref;
48        self.domain_id.deref()
49    }
50    /// <p>The status of the subscription.</p>
51    pub fn status(&self) -> &crate::types::SubscriptionStatus {
52        &self.status
53    }
54    /// <p>The timestamp of when the subscription was created.</p>
55    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
56        &self.created_at
57    }
58    /// <p>The timestamp of when the subscription was updated.</p>
59    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
60        &self.updated_at
61    }
62    /// <p>The principal that owns the subscription.</p>
63    pub fn subscribed_principal(&self) -> ::std::option::Option<&crate::types::SubscribedPrincipal> {
64        self.subscribed_principal.as_ref()
65    }
66    /// <p>The details of the published asset for which the subscription grant is created.</p>
67    pub fn subscribed_listing(&self) -> ::std::option::Option<&crate::types::SubscribedListing> {
68        self.subscribed_listing.as_ref()
69    }
70    /// <p>The ID of the subscription request.</p>
71    pub fn subscription_request_id(&self) -> ::std::option::Option<&str> {
72        self.subscription_request_id.as_deref()
73    }
74    /// <p>The retain permissions of the subscription.</p>
75    pub fn retain_permissions(&self) -> ::std::option::Option<bool> {
76        self.retain_permissions
77    }
78}
79impl ::aws_types::request_id::RequestId for GetSubscriptionOutput {
80    fn request_id(&self) -> Option<&str> {
81        self._request_id.as_deref()
82    }
83}
84impl GetSubscriptionOutput {
85    /// Creates a new builder-style object to manufacture [`GetSubscriptionOutput`](crate::operation::get_subscription::GetSubscriptionOutput).
86    pub fn builder() -> crate::operation::get_subscription::builders::GetSubscriptionOutputBuilder {
87        crate::operation::get_subscription::builders::GetSubscriptionOutputBuilder::default()
88    }
89}
90
91/// A builder for [`GetSubscriptionOutput`](crate::operation::get_subscription::GetSubscriptionOutput).
92#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
93#[non_exhaustive]
94pub struct GetSubscriptionOutputBuilder {
95    pub(crate) id: ::std::option::Option<::std::string::String>,
96    pub(crate) created_by: ::std::option::Option<::std::string::String>,
97    pub(crate) updated_by: ::std::option::Option<::std::string::String>,
98    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
99    pub(crate) status: ::std::option::Option<crate::types::SubscriptionStatus>,
100    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
101    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
102    pub(crate) subscribed_principal: ::std::option::Option<crate::types::SubscribedPrincipal>,
103    pub(crate) subscribed_listing: ::std::option::Option<crate::types::SubscribedListing>,
104    pub(crate) subscription_request_id: ::std::option::Option<::std::string::String>,
105    pub(crate) retain_permissions: ::std::option::Option<bool>,
106    _request_id: Option<String>,
107}
108impl GetSubscriptionOutputBuilder {
109    /// <p>The ID of the subscription.</p>
110    /// This field is required.
111    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
112        self.id = ::std::option::Option::Some(input.into());
113        self
114    }
115    /// <p>The ID of the subscription.</p>
116    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
117        self.id = input;
118        self
119    }
120    /// <p>The ID of the subscription.</p>
121    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
122        &self.id
123    }
124    /// <p>The Amazon DataZone user who created the subscription.</p>
125    /// This field is required.
126    pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.created_by = ::std::option::Option::Some(input.into());
128        self
129    }
130    /// <p>The Amazon DataZone user who created the subscription.</p>
131    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.created_by = input;
133        self
134    }
135    /// <p>The Amazon DataZone user who created the subscription.</p>
136    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
137        &self.created_by
138    }
139    /// <p>The Amazon DataZone user who updated the subscription.</p>
140    pub fn updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.updated_by = ::std::option::Option::Some(input.into());
142        self
143    }
144    /// <p>The Amazon DataZone user who updated the subscription.</p>
145    pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.updated_by = input;
147        self
148    }
149    /// <p>The Amazon DataZone user who updated the subscription.</p>
150    pub fn get_updated_by(&self) -> &::std::option::Option<::std::string::String> {
151        &self.updated_by
152    }
153    /// <p>The ID of the Amazon DataZone domain in which the subscription exists.</p>
154    /// This field is required.
155    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156        self.domain_id = ::std::option::Option::Some(input.into());
157        self
158    }
159    /// <p>The ID of the Amazon DataZone domain in which the subscription exists.</p>
160    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161        self.domain_id = input;
162        self
163    }
164    /// <p>The ID of the Amazon DataZone domain in which the subscription exists.</p>
165    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
166        &self.domain_id
167    }
168    /// <p>The status of the subscription.</p>
169    /// This field is required.
170    pub fn status(mut self, input: crate::types::SubscriptionStatus) -> Self {
171        self.status = ::std::option::Option::Some(input);
172        self
173    }
174    /// <p>The status of the subscription.</p>
175    pub fn set_status(mut self, input: ::std::option::Option<crate::types::SubscriptionStatus>) -> Self {
176        self.status = input;
177        self
178    }
179    /// <p>The status of the subscription.</p>
180    pub fn get_status(&self) -> &::std::option::Option<crate::types::SubscriptionStatus> {
181        &self.status
182    }
183    /// <p>The timestamp of when the subscription was created.</p>
184    /// This field is required.
185    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
186        self.created_at = ::std::option::Option::Some(input);
187        self
188    }
189    /// <p>The timestamp of when the subscription was created.</p>
190    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
191        self.created_at = input;
192        self
193    }
194    /// <p>The timestamp of when the subscription was created.</p>
195    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
196        &self.created_at
197    }
198    /// <p>The timestamp of when the subscription was updated.</p>
199    /// This field is required.
200    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
201        self.updated_at = ::std::option::Option::Some(input);
202        self
203    }
204    /// <p>The timestamp of when the subscription was updated.</p>
205    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
206        self.updated_at = input;
207        self
208    }
209    /// <p>The timestamp of when the subscription was updated.</p>
210    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
211        &self.updated_at
212    }
213    /// <p>The principal that owns the subscription.</p>
214    /// This field is required.
215    pub fn subscribed_principal(mut self, input: crate::types::SubscribedPrincipal) -> Self {
216        self.subscribed_principal = ::std::option::Option::Some(input);
217        self
218    }
219    /// <p>The principal that owns the subscription.</p>
220    pub fn set_subscribed_principal(mut self, input: ::std::option::Option<crate::types::SubscribedPrincipal>) -> Self {
221        self.subscribed_principal = input;
222        self
223    }
224    /// <p>The principal that owns the subscription.</p>
225    pub fn get_subscribed_principal(&self) -> &::std::option::Option<crate::types::SubscribedPrincipal> {
226        &self.subscribed_principal
227    }
228    /// <p>The details of the published asset for which the subscription grant is created.</p>
229    /// This field is required.
230    pub fn subscribed_listing(mut self, input: crate::types::SubscribedListing) -> Self {
231        self.subscribed_listing = ::std::option::Option::Some(input);
232        self
233    }
234    /// <p>The details of the published asset for which the subscription grant is created.</p>
235    pub fn set_subscribed_listing(mut self, input: ::std::option::Option<crate::types::SubscribedListing>) -> Self {
236        self.subscribed_listing = input;
237        self
238    }
239    /// <p>The details of the published asset for which the subscription grant is created.</p>
240    pub fn get_subscribed_listing(&self) -> &::std::option::Option<crate::types::SubscribedListing> {
241        &self.subscribed_listing
242    }
243    /// <p>The ID of the subscription request.</p>
244    pub fn subscription_request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
245        self.subscription_request_id = ::std::option::Option::Some(input.into());
246        self
247    }
248    /// <p>The ID of the subscription request.</p>
249    pub fn set_subscription_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
250        self.subscription_request_id = input;
251        self
252    }
253    /// <p>The ID of the subscription request.</p>
254    pub fn get_subscription_request_id(&self) -> &::std::option::Option<::std::string::String> {
255        &self.subscription_request_id
256    }
257    /// <p>The retain permissions of the subscription.</p>
258    pub fn retain_permissions(mut self, input: bool) -> Self {
259        self.retain_permissions = ::std::option::Option::Some(input);
260        self
261    }
262    /// <p>The retain permissions of the subscription.</p>
263    pub fn set_retain_permissions(mut self, input: ::std::option::Option<bool>) -> Self {
264        self.retain_permissions = input;
265        self
266    }
267    /// <p>The retain permissions of the subscription.</p>
268    pub fn get_retain_permissions(&self) -> &::std::option::Option<bool> {
269        &self.retain_permissions
270    }
271    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
272        self._request_id = Some(request_id.into());
273        self
274    }
275
276    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
277        self._request_id = request_id;
278        self
279    }
280    /// Consumes the builder and constructs a [`GetSubscriptionOutput`](crate::operation::get_subscription::GetSubscriptionOutput).
281    /// This method will fail if any of the following fields are not set:
282    /// - [`id`](crate::operation::get_subscription::builders::GetSubscriptionOutputBuilder::id)
283    /// - [`created_by`](crate::operation::get_subscription::builders::GetSubscriptionOutputBuilder::created_by)
284    /// - [`domain_id`](crate::operation::get_subscription::builders::GetSubscriptionOutputBuilder::domain_id)
285    /// - [`status`](crate::operation::get_subscription::builders::GetSubscriptionOutputBuilder::status)
286    /// - [`created_at`](crate::operation::get_subscription::builders::GetSubscriptionOutputBuilder::created_at)
287    /// - [`updated_at`](crate::operation::get_subscription::builders::GetSubscriptionOutputBuilder::updated_at)
288    pub fn build(
289        self,
290    ) -> ::std::result::Result<crate::operation::get_subscription::GetSubscriptionOutput, ::aws_smithy_types::error::operation::BuildError> {
291        ::std::result::Result::Ok(crate::operation::get_subscription::GetSubscriptionOutput {
292            id: self.id.ok_or_else(|| {
293                ::aws_smithy_types::error::operation::BuildError::missing_field(
294                    "id",
295                    "id was not specified but it is required when building GetSubscriptionOutput",
296                )
297            })?,
298            created_by: self.created_by.ok_or_else(|| {
299                ::aws_smithy_types::error::operation::BuildError::missing_field(
300                    "created_by",
301                    "created_by was not specified but it is required when building GetSubscriptionOutput",
302                )
303            })?,
304            updated_by: self.updated_by,
305            domain_id: self.domain_id.ok_or_else(|| {
306                ::aws_smithy_types::error::operation::BuildError::missing_field(
307                    "domain_id",
308                    "domain_id was not specified but it is required when building GetSubscriptionOutput",
309                )
310            })?,
311            status: self.status.ok_or_else(|| {
312                ::aws_smithy_types::error::operation::BuildError::missing_field(
313                    "status",
314                    "status was not specified but it is required when building GetSubscriptionOutput",
315                )
316            })?,
317            created_at: self.created_at.ok_or_else(|| {
318                ::aws_smithy_types::error::operation::BuildError::missing_field(
319                    "created_at",
320                    "created_at was not specified but it is required when building GetSubscriptionOutput",
321                )
322            })?,
323            updated_at: self.updated_at.ok_or_else(|| {
324                ::aws_smithy_types::error::operation::BuildError::missing_field(
325                    "updated_at",
326                    "updated_at was not specified but it is required when building GetSubscriptionOutput",
327                )
328            })?,
329            subscribed_principal: self.subscribed_principal,
330            subscribed_listing: self.subscribed_listing,
331            subscription_request_id: self.subscription_request_id,
332            retain_permissions: self.retain_permissions,
333            _request_id: self._request_id,
334        })
335    }
336}