aws_sdk_datazone/operation/delete_subscription_grant/
_delete_subscription_grant_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DeleteSubscriptionGrantOutput {
6 pub id: ::std::string::String,
8 pub created_by: ::std::string::String,
10 pub updated_by: ::std::option::Option<::std::string::String>,
12 pub domain_id: ::std::string::String,
14 pub created_at: ::aws_smithy_types::DateTime,
16 pub updated_at: ::aws_smithy_types::DateTime,
18 pub environment_id: ::std::option::Option<::std::string::String>,
20 pub subscription_target_id: ::std::string::String,
22 pub granted_entity: ::std::option::Option<crate::types::GrantedEntity>,
24 pub status: crate::types::SubscriptionGrantOverallStatus,
26 pub assets: ::std::option::Option<::std::vec::Vec<crate::types::SubscribedAsset>>,
28 #[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 pub fn id(&self) -> &str {
36 use std::ops::Deref;
37 self.id.deref()
38 }
39 pub fn created_by(&self) -> &str {
41 use std::ops::Deref;
42 self.created_by.deref()
43 }
44 pub fn updated_by(&self) -> ::std::option::Option<&str> {
46 self.updated_by.as_deref()
47 }
48 pub fn domain_id(&self) -> &str {
50 use std::ops::Deref;
51 self.domain_id.deref()
52 }
53 pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
55 &self.created_at
56 }
57 pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
59 &self.updated_at
60 }
61 pub fn environment_id(&self) -> ::std::option::Option<&str> {
63 self.environment_id.as_deref()
64 }
65 pub fn subscription_target_id(&self) -> &str {
67 use std::ops::Deref;
68 self.subscription_target_id.deref()
69 }
70 pub fn granted_entity(&self) -> ::std::option::Option<&crate::types::GrantedEntity> {
72 self.granted_entity.as_ref()
73 }
74 pub fn status(&self) -> &crate::types::SubscriptionGrantOverallStatus {
76 &self.status
77 }
78 pub fn assets(&self) -> &[crate::types::SubscribedAsset] {
82 self.assets.as_deref().unwrap_or_default()
83 }
84 #[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 pub fn builder() -> crate::operation::delete_subscription_grant::builders::DeleteSubscriptionGrantOutputBuilder {
98 crate::operation::delete_subscription_grant::builders::DeleteSubscriptionGrantOutputBuilder::default()
99 }
100}
101
102#[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 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 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129 self.id = input;
130 self
131 }
132 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
134 &self.id
135 }
136 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 pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144 self.created_by = input;
145 self
146 }
147 pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
149 &self.created_by
150 }
151 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 pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158 self.updated_by = input;
159 self
160 }
161 pub fn get_updated_by(&self) -> &::std::option::Option<::std::string::String> {
163 &self.updated_by
164 }
165 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 pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173 self.domain_id = input;
174 self
175 }
176 pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
178 &self.domain_id
179 }
180 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 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 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
193 &self.created_at
194 }
195 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 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 pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
208 &self.updated_at
209 }
210 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 pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
217 self.environment_id = input;
218 self
219 }
220 pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
222 &self.environment_id
223 }
224 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 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 pub fn get_subscription_target_id(&self) -> &::std::option::Option<::std::string::String> {
237 &self.subscription_target_id
238 }
239 pub fn granted_entity(mut self, input: crate::types::GrantedEntity) -> Self {
242 self.granted_entity = ::std::option::Option::Some(input);
243 self
244 }
245 pub fn set_granted_entity(mut self, input: ::std::option::Option<crate::types::GrantedEntity>) -> Self {
247 self.granted_entity = input;
248 self
249 }
250 pub fn get_granted_entity(&self) -> &::std::option::Option<crate::types::GrantedEntity> {
252 &self.granted_entity
253 }
254 pub fn status(mut self, input: crate::types::SubscriptionGrantOverallStatus) -> Self {
257 self.status = ::std::option::Option::Some(input);
258 self
259 }
260 pub fn set_status(mut self, input: ::std::option::Option<crate::types::SubscriptionGrantOverallStatus>) -> Self {
262 self.status = input;
263 self
264 }
265 pub fn get_status(&self) -> &::std::option::Option<crate::types::SubscriptionGrantOverallStatus> {
267 &self.status
268 }
269 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 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 pub fn get_assets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SubscribedAsset>> {
287 &self.assets
288 }
289 #[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 #[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 #[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 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}