aws_sdk_controltower/operation/enable_control/
_enable_control_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 EnableControlOutput {
6    /// <p>The ID of the asynchronous operation, which is used to track status. The operation is available for 90 days.</p>
7    pub operation_identifier: ::std::string::String,
8    /// <p>The ARN of the <code>EnabledControl</code> resource.</p>
9    pub arn: ::std::option::Option<::std::string::String>,
10    _request_id: Option<String>,
11}
12impl EnableControlOutput {
13    /// <p>The ID of the asynchronous operation, which is used to track status. The operation is available for 90 days.</p>
14    pub fn operation_identifier(&self) -> &str {
15        use std::ops::Deref;
16        self.operation_identifier.deref()
17    }
18    /// <p>The ARN of the <code>EnabledControl</code> resource.</p>
19    pub fn arn(&self) -> ::std::option::Option<&str> {
20        self.arn.as_deref()
21    }
22}
23impl ::aws_types::request_id::RequestId for EnableControlOutput {
24    fn request_id(&self) -> Option<&str> {
25        self._request_id.as_deref()
26    }
27}
28impl EnableControlOutput {
29    /// Creates a new builder-style object to manufacture [`EnableControlOutput`](crate::operation::enable_control::EnableControlOutput).
30    pub fn builder() -> crate::operation::enable_control::builders::EnableControlOutputBuilder {
31        crate::operation::enable_control::builders::EnableControlOutputBuilder::default()
32    }
33}
34
35/// A builder for [`EnableControlOutput`](crate::operation::enable_control::EnableControlOutput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct EnableControlOutputBuilder {
39    pub(crate) operation_identifier: ::std::option::Option<::std::string::String>,
40    pub(crate) arn: ::std::option::Option<::std::string::String>,
41    _request_id: Option<String>,
42}
43impl EnableControlOutputBuilder {
44    /// <p>The ID of the asynchronous operation, which is used to track status. The operation is available for 90 days.</p>
45    /// This field is required.
46    pub fn operation_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.operation_identifier = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>The ID of the asynchronous operation, which is used to track status. The operation is available for 90 days.</p>
51    pub fn set_operation_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.operation_identifier = input;
53        self
54    }
55    /// <p>The ID of the asynchronous operation, which is used to track status. The operation is available for 90 days.</p>
56    pub fn get_operation_identifier(&self) -> &::std::option::Option<::std::string::String> {
57        &self.operation_identifier
58    }
59    /// <p>The ARN of the <code>EnabledControl</code> resource.</p>
60    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.arn = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The ARN of the <code>EnabledControl</code> resource.</p>
65    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.arn = input;
67        self
68    }
69    /// <p>The ARN of the <code>EnabledControl</code> resource.</p>
70    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
71        &self.arn
72    }
73    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
74        self._request_id = Some(request_id.into());
75        self
76    }
77
78    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
79        self._request_id = request_id;
80        self
81    }
82    /// Consumes the builder and constructs a [`EnableControlOutput`](crate::operation::enable_control::EnableControlOutput).
83    /// This method will fail if any of the following fields are not set:
84    /// - [`operation_identifier`](crate::operation::enable_control::builders::EnableControlOutputBuilder::operation_identifier)
85    pub fn build(
86        self,
87    ) -> ::std::result::Result<crate::operation::enable_control::EnableControlOutput, ::aws_smithy_types::error::operation::BuildError> {
88        ::std::result::Result::Ok(crate::operation::enable_control::EnableControlOutput {
89            operation_identifier: self.operation_identifier.ok_or_else(|| {
90                ::aws_smithy_types::error::operation::BuildError::missing_field(
91                    "operation_identifier",
92                    "operation_identifier was not specified but it is required when building EnableControlOutput",
93                )
94            })?,
95            arn: self.arn,
96            _request_id: self._request_id,
97        })
98    }
99}