Skip to main content

aws_sdk_datazone/operation/delete_subscription_grant/
_delete_subscription_grant_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 DeleteSubscriptionGrantOutput {
6    /// <p>The ID of the subscription grant that is deleted.</p>
7    pub id: ::std::string::String,
8    /// <p>The Amazon DataZone user who created the subscription grant that is deleted.</p>
9    pub created_by: ::std::string::String,
10    /// <p>The Amazon DataZone user who updated the subscription grant that is deleted.</p>
11    pub updated_by: ::std::option::Option<::std::string::String>,
12    /// <p>The ID of the Amazon DataZone domain in which the subscription grant is deleted.</p>
13    pub domain_id: ::std::string::String,
14    /// <p>The timestamp of when the subscription grant that is deleted was created.</p>
15    pub created_at: ::aws_smithy_types::DateTime,
16    /// <p>The timestamp of when the subscription grant that is deleted was updated.</p>
17    pub updated_at: ::aws_smithy_types::DateTime,
18    /// <p>The ID of the environment in which the subscription grant is deleted.</p>
19    pub environment_id: ::std::option::Option<::std::string::String>,
20    /// <p>The ID of the subscription target associated with the subscription grant that is deleted.</p>
21    pub subscription_target_id: ::std::string::String,
22    /// <p>The entity to which the subscription is deleted.</p>
23    pub granted_entity: ::std::option::Option<crate::types::GrantedEntity>,
24    /// <p>The status of the subscription grant that is deleted.</p>
25    pub status: crate::types::SubscriptionGrantOverallStatus,
26    /// <p>The assets for which the subsctiption grant that is deleted gave access.</p>
27    pub assets: ::std::option::Option<::std::vec::Vec<crate::types::SubscribedAsset>>,
28    /// <p>The identifier of the subsctiption whose subscription grant is to be deleted.</p>
29    #[deprecated(note = "Multiple subscriptions can exist for a single grant")]
30    pub subscription_id: ::std::option::Option<::std::string::String>,
31    _request_id: Option<String>,
32}
33impl DeleteSubscriptionGrantOutput {
34    /// <p>The ID of the subscription grant that is deleted.</p>
35    pub fn id(&self) -> &str {
36        use std::ops::Deref;
37        self.id.deref()
38    }
39    /// <p>The Amazon DataZone user who created the subscription grant that is deleted.</p>
40    pub fn created_by(&self) -> &str {
41        use std::ops::Deref;
42        self.created_by.deref()
43    }
44    /// <p>The Amazon DataZone user who updated the subscription grant that is deleted.</p>
45    pub fn updated_by(&self) -> ::std::option::Option<&str> {
46        self.updated_by.as_deref()
47    }
48    /// <p>The ID of the Amazon DataZone domain in which the subscription grant is deleted.</p>
49    pub fn domain_id(&self) -> &str {
50        use std::ops::Deref;
51        self.domain_id.deref()
52    }
53    /// <p>The timestamp of when the subscription grant that is deleted was created.</p>
54    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
55        &self.created_at
56    }
57    /// <p>The timestamp of when the subscription grant that is deleted was updated.</p>
58    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
59        &self.updated_at
60    }
61    /// <p>The ID of the environment in which the subscription grant is deleted.</p>
62    pub fn environment_id(&self) -> ::std::option::Option<&str> {
63        self.environment_id.as_deref()
64    }
65    /// <p>The ID of the subscription target associated with the subscription grant that is deleted.</p>
66    pub fn subscription_target_id(&self) -> &str {
67        use std::ops::Deref;
68        self.subscription_target_id.deref()
69    }
70    /// <p>The entity to which the subscription is deleted.</p>
71    pub fn granted_entity(&self) -> ::std::option::Option<&crate::types::GrantedEntity> {
72        self.granted_entity.as_ref()
73    }
74    /// <p>The status of the subscription grant that is deleted.</p>
75    pub fn status(&self) -> &crate::types::SubscriptionGrantOverallStatus {
76        &self.status
77    }
78    /// <p>The assets for which the subsctiption grant that is deleted gave access.</p>
79    ///
80    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.assets.is_none()`.
81    pub fn assets(&self) -> &[crate::types::SubscribedAsset] {
82        self.assets.as_deref().unwrap_or_default()
83    }
84    /// <p>The identifier of the subsctiption whose subscription grant is to be deleted.</p>
85    #[deprecated(note = "Multiple subscriptions can exist for a single grant")]
86    pub fn subscription_id(&self) -> ::std::option::Option<&str> {
87        self.subscription_id.as_deref()
88    }
89}
90impl ::aws_types::request_id::RequestId for DeleteSubscriptionGrantOutput {
91    fn request_id(&self) -> Option<&str> {
92        self._request_id.as_deref()
93    }
94}
95impl DeleteSubscriptionGrantOutput {
96    /// Creates a new builder-style object to manufacture [`DeleteSubscriptionGrantOutput`](crate::operation::delete_subscription_grant::DeleteSubscriptionGrantOutput).
97    pub fn builder() -> crate::operation::delete_subscription_grant::builders::DeleteSubscriptionGrantOutputBuilder {
98        crate::operation::delete_subscription_grant::builders::DeleteSubscriptionGrantOutputBuilder::default()
99    }
100}
101
102/// A builder for [`DeleteSubscriptionGrantOutput`](crate::operation::delete_subscription_grant::DeleteSubscriptionGrantOutput).
103#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
104#[non_exhaustive]
105pub struct DeleteSubscriptionGrantOutputBuilder {
106    pub(crate) id: ::std::option::Option<::std::string::String>,
107    pub(crate) created_by: ::std::option::Option<::std::string::String>,
108    pub(crate) updated_by: ::std::option::Option<::std::string::String>,
109    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
110    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
111    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
112    pub(crate) environment_id: ::std::option::Option<::std::string::String>,
113    pub(crate) subscription_target_id: ::std::option::Option<::std::string::String>,
114    pub(crate) granted_entity: ::std::option::Option<crate::types::GrantedEntity>,
115    pub(crate) status: ::std::option::Option<crate::types::SubscriptionGrantOverallStatus>,
116    pub(crate) assets: ::std::option::Option<::std::vec::Vec<crate::types::SubscribedAsset>>,
117    pub(crate) subscription_id: ::std::option::Option<::std::string::String>,
118    _request_id: Option<String>,
119}
120impl DeleteSubscriptionGrantOutputBuilder {
121    /// <p>The ID of the subscription grant that is deleted.</p>
122    /// This field is required.
123    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.id = ::std::option::Option::Some(input.into());
125        self
126    }
127    /// <p>The ID of the subscription grant that is deleted.</p>
128    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.id = input;
130        self
131    }
132    /// <p>The ID of the subscription grant that is deleted.</p>
133    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
134        &self.id
135    }
136    /// <p>The Amazon DataZone user who created the subscription grant that is deleted.</p>
137    /// This field is required.
138    pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.created_by = ::std::option::Option::Some(input.into());
140        self
141    }
142    /// <p>The Amazon DataZone user who created the subscription grant that is deleted.</p>
143    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.created_by = input;
145        self
146    }
147    /// <p>The Amazon DataZone user who created the subscription grant that is deleted.</p>
148    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
149        &self.created_by
150    }
151    /// <p>The Amazon DataZone user who updated the subscription grant that is deleted.</p>
152    pub fn updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.updated_by = ::std::option::Option::Some(input.into());
154        self
155    }
156    /// <p>The Amazon DataZone user who updated the subscription grant that is deleted.</p>
157    pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.updated_by = input;
159        self
160    }
161    /// <p>The Amazon DataZone user who updated the subscription grant that is deleted.</p>
162    pub fn get_updated_by(&self) -> &::std::option::Option<::std::string::String> {
163        &self.updated_by
164    }
165    /// <p>The ID of the Amazon DataZone domain in which the subscription grant is deleted.</p>
166    /// This field is required.
167    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168        self.domain_id = ::std::option::Option::Some(input.into());
169        self
170    }
171    /// <p>The ID of the Amazon DataZone domain in which the subscription grant is deleted.</p>
172    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173        self.domain_id = input;
174        self
175    }
176    /// <p>The ID of the Amazon DataZone domain in which the subscription grant is deleted.</p>
177    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
178        &self.domain_id
179    }
180    /// <p>The timestamp of when the subscription grant that is deleted was created.</p>
181    /// This field is required.
182    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
183        self.created_at = ::std::option::Option::Some(input);
184        self
185    }
186    /// <p>The timestamp of when the subscription grant that is deleted was created.</p>
187    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
188        self.created_at = input;
189        self
190    }
191    /// <p>The timestamp of when the subscription grant that is deleted was created.</p>
192    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
193        &self.created_at
194    }
195    /// <p>The timestamp of when the subscription grant that is deleted was updated.</p>
196    /// This field is required.
197    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
198        self.updated_at = ::std::option::Option::Some(input);
199        self
200    }
201    /// <p>The timestamp of when the subscription grant that is deleted was updated.</p>
202    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
203        self.updated_at = input;
204        self
205    }
206    /// <p>The timestamp of when the subscription grant that is deleted was updated.</p>
207    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
208        &self.updated_at
209    }
210    /// <p>The ID of the environment in which the subscription grant is deleted.</p>
211    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
212        self.environment_id = ::std::option::Option::Some(input.into());
213        self
214    }
215    /// <p>The ID of the environment in which the subscription grant is deleted.</p>
216    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
217        self.environment_id = input;
218        self
219    }
220    /// <p>The ID of the environment in which the subscription grant is deleted.</p>
221    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
222        &self.environment_id
223    }
224    /// <p>The ID of the subscription target associated with the subscription grant that is deleted.</p>
225    /// This field is required.
226    pub fn subscription_target_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
227        self.subscription_target_id = ::std::option::Option::Some(input.into());
228        self
229    }
230    /// <p>The ID of the subscription target associated with the subscription grant that is deleted.</p>
231    pub fn set_subscription_target_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
232        self.subscription_target_id = input;
233        self
234    }
235    /// <p>The ID of the subscription target associated with the subscription grant that is deleted.</p>
236    pub fn get_subscription_target_id(&self) -> &::std::option::Option<::std::string::String> {
237        &self.subscription_target_id
238    }
239    /// <p>The entity to which the subscription is deleted.</p>
240    /// This field is required.
241    pub fn granted_entity(mut self, input: crate::types::GrantedEntity) -> Self {
242        self.granted_entity = ::std::option::Option::Some(input);
243        self
244    }
245    /// <p>The entity to which the subscription is deleted.</p>
246    pub fn set_granted_entity(mut self, input: ::std::option::Option<crate::types::GrantedEntity>) -> Self {
247        self.granted_entity = input;
248        self
249    }
250    /// <p>The entity to which the subscription is deleted.</p>
251    pub fn get_granted_entity(&self) -> &::std::option::Option<crate::types::GrantedEntity> {
252        &self.granted_entity
253    }
254    /// <p>The status of the subscription grant that is deleted.</p>
255    /// This field is required.
256    pub fn status(mut self, input: crate::types::SubscriptionGrantOverallStatus) -> Self {
257        self.status = ::std::option::Option::Some(input);
258        self
259    }
260    /// <p>The status of the subscription grant that is deleted.</p>
261    pub fn set_status(mut self, input: ::std::option::Option<crate::types::SubscriptionGrantOverallStatus>) -> Self {
262        self.status = input;
263        self
264    }
265    /// <p>The status of the subscription grant that is deleted.</p>
266    pub fn get_status(&self) -> &::std::option::Option<crate::types::SubscriptionGrantOverallStatus> {
267        &self.status
268    }
269    /// Appends an item to `assets`.
270    ///
271    /// To override the contents of this collection use [`set_assets`](Self::set_assets).
272    ///
273    /// <p>The assets for which the subsctiption grant that is deleted gave access.</p>
274    pub fn assets(mut self, input: crate::types::SubscribedAsset) -> Self {
275        let mut v = self.assets.unwrap_or_default();
276        v.push(input);
277        self.assets = ::std::option::Option::Some(v);
278        self
279    }
280    /// <p>The assets for which the subsctiption grant that is deleted gave access.</p>
281    pub fn set_assets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SubscribedAsset>>) -> Self {
282        self.assets = input;
283        self
284    }
285    /// <p>The assets for which the subsctiption grant that is deleted gave access.</p>
286    pub fn get_assets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SubscribedAsset>> {
287        &self.assets
288    }
289    /// <p>The identifier of the subsctiption whose subscription grant is to be deleted.</p>
290    #[deprecated(note = "Multiple subscriptions can exist for a single grant")]
291    pub fn subscription_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
292        self.subscription_id = ::std::option::Option::Some(input.into());
293        self
294    }
295    /// <p>The identifier of the subsctiption whose subscription grant is to be deleted.</p>
296    #[deprecated(note = "Multiple subscriptions can exist for a single grant")]
297    pub fn set_subscription_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
298        self.subscription_id = input;
299        self
300    }
301    /// <p>The identifier of the subsctiption whose subscription grant is to be deleted.</p>
302    #[deprecated(note = "Multiple subscriptions can exist for a single grant")]
303    pub fn get_subscription_id(&self) -> &::std::option::Option<::std::string::String> {
304        &self.subscription_id
305    }
306    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
307        self._request_id = Some(request_id.into());
308        self
309    }
310
311    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
312        self._request_id = request_id;
313        self
314    }
315    /// Consumes the builder and constructs a [`DeleteSubscriptionGrantOutput`](crate::operation::delete_subscription_grant::DeleteSubscriptionGrantOutput).
316    /// This method will fail if any of the following fields are not set:
317    /// - [`id`](crate::operation::delete_subscription_grant::builders::DeleteSubscriptionGrantOutputBuilder::id)
318    /// - [`created_by`](crate::operation::delete_subscription_grant::builders::DeleteSubscriptionGrantOutputBuilder::created_by)
319    /// - [`domain_id`](crate::operation::delete_subscription_grant::builders::DeleteSubscriptionGrantOutputBuilder::domain_id)
320    /// - [`created_at`](crate::operation::delete_subscription_grant::builders::DeleteSubscriptionGrantOutputBuilder::created_at)
321    /// - [`updated_at`](crate::operation::delete_subscription_grant::builders::DeleteSubscriptionGrantOutputBuilder::updated_at)
322    /// - [`subscription_target_id`](crate::operation::delete_subscription_grant::builders::DeleteSubscriptionGrantOutputBuilder::subscription_target_id)
323    /// - [`status`](crate::operation::delete_subscription_grant::builders::DeleteSubscriptionGrantOutputBuilder::status)
324    pub fn build(
325        self,
326    ) -> ::std::result::Result<
327        crate::operation::delete_subscription_grant::DeleteSubscriptionGrantOutput,
328        ::aws_smithy_types::error::operation::BuildError,
329    > {
330        ::std::result::Result::Ok(crate::operation::delete_subscription_grant::DeleteSubscriptionGrantOutput {
331            id: self.id.ok_or_else(|| {
332                ::aws_smithy_types::error::operation::BuildError::missing_field(
333                    "id",
334                    "id was not specified but it is required when building DeleteSubscriptionGrantOutput",
335                )
336            })?,
337            created_by: self.created_by.ok_or_else(|| {
338                ::aws_smithy_types::error::operation::BuildError::missing_field(
339                    "created_by",
340                    "created_by was not specified but it is required when building DeleteSubscriptionGrantOutput",
341                )
342            })?,
343            updated_by: self.updated_by,
344            domain_id: self.domain_id.ok_or_else(|| {
345                ::aws_smithy_types::error::operation::BuildError::missing_field(
346                    "domain_id",
347                    "domain_id was not specified but it is required when building DeleteSubscriptionGrantOutput",
348                )
349            })?,
350            created_at: self.created_at.ok_or_else(|| {
351                ::aws_smithy_types::error::operation::BuildError::missing_field(
352                    "created_at",
353                    "created_at was not specified but it is required when building DeleteSubscriptionGrantOutput",
354                )
355            })?,
356            updated_at: self.updated_at.ok_or_else(|| {
357                ::aws_smithy_types::error::operation::BuildError::missing_field(
358                    "updated_at",
359                    "updated_at was not specified but it is required when building DeleteSubscriptionGrantOutput",
360                )
361            })?,
362            environment_id: self.environment_id,
363            subscription_target_id: self.subscription_target_id.ok_or_else(|| {
364                ::aws_smithy_types::error::operation::BuildError::missing_field(
365                    "subscription_target_id",
366                    "subscription_target_id was not specified but it is required when building DeleteSubscriptionGrantOutput",
367                )
368            })?,
369            granted_entity: self.granted_entity,
370            status: self.status.ok_or_else(|| {
371                ::aws_smithy_types::error::operation::BuildError::missing_field(
372                    "status",
373                    "status was not specified but it is required when building DeleteSubscriptionGrantOutput",
374                )
375            })?,
376            assets: self.assets,
377            subscription_id: self.subscription_id,
378            _request_id: self._request_id,
379        })
380    }
381}