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