aws_sdk_cloudhsm/operation/delete_hsm/
_delete_hsm_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the output of the <code>DeleteHsm</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DeleteHsmOutput {
7    /// <p>The status of the operation.</p>
8    pub status: ::std::string::String,
9    _request_id: Option<String>,
10}
11impl DeleteHsmOutput {
12    /// <p>The status of the operation.</p>
13    pub fn status(&self) -> &str {
14        use std::ops::Deref;
15        self.status.deref()
16    }
17}
18impl ::aws_types::request_id::RequestId for DeleteHsmOutput {
19    fn request_id(&self) -> Option<&str> {
20        self._request_id.as_deref()
21    }
22}
23impl DeleteHsmOutput {
24    /// Creates a new builder-style object to manufacture [`DeleteHsmOutput`](crate::operation::delete_hsm::DeleteHsmOutput).
25    pub fn builder() -> crate::operation::delete_hsm::builders::DeleteHsmOutputBuilder {
26        crate::operation::delete_hsm::builders::DeleteHsmOutputBuilder::default()
27    }
28}
29
30/// A builder for [`DeleteHsmOutput`](crate::operation::delete_hsm::DeleteHsmOutput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct DeleteHsmOutputBuilder {
34    pub(crate) status: ::std::option::Option<::std::string::String>,
35    _request_id: Option<String>,
36}
37impl DeleteHsmOutputBuilder {
38    /// <p>The status of the operation.</p>
39    /// This field is required.
40    pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.status = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>The status of the operation.</p>
45    pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.status = input;
47        self
48    }
49    /// <p>The status of the operation.</p>
50    pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
51        &self.status
52    }
53    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
54        self._request_id = Some(request_id.into());
55        self
56    }
57
58    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
59        self._request_id = request_id;
60        self
61    }
62    /// Consumes the builder and constructs a [`DeleteHsmOutput`](crate::operation::delete_hsm::DeleteHsmOutput).
63    /// This method will fail if any of the following fields are not set:
64    /// - [`status`](crate::operation::delete_hsm::builders::DeleteHsmOutputBuilder::status)
65    pub fn build(self) -> ::std::result::Result<crate::operation::delete_hsm::DeleteHsmOutput, ::aws_smithy_types::error::operation::BuildError> {
66        ::std::result::Result::Ok(crate::operation::delete_hsm::DeleteHsmOutput {
67            status: self.status.ok_or_else(|| {
68                ::aws_smithy_types::error::operation::BuildError::missing_field(
69                    "status",
70                    "status was not specified but it is required when building DeleteHsmOutput",
71                )
72            })?,
73            _request_id: self._request_id,
74        })
75    }
76}