aws_sdk_s3/operation/get_bucket_versioning/
_get_bucket_versioning_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 GetBucketVersioningOutput {
6    /// <p>The versioning state of the bucket.</p>
7    pub status: ::std::option::Option<crate::types::BucketVersioningStatus>,
8    /// <p>Specifies whether MFA delete is enabled in the bucket versioning configuration. This element is only returned if the bucket has been configured with MFA delete. If the bucket has never been so configured, this element is not returned.</p>
9    pub mfa_delete: ::std::option::Option<crate::types::MfaDeleteStatus>,
10    _extended_request_id: Option<String>,
11    _request_id: Option<String>,
12}
13impl GetBucketVersioningOutput {
14    /// <p>The versioning state of the bucket.</p>
15    pub fn status(&self) -> ::std::option::Option<&crate::types::BucketVersioningStatus> {
16        self.status.as_ref()
17    }
18    /// <p>Specifies whether MFA delete is enabled in the bucket versioning configuration. This element is only returned if the bucket has been configured with MFA delete. If the bucket has never been so configured, this element is not returned.</p>
19    pub fn mfa_delete(&self) -> ::std::option::Option<&crate::types::MfaDeleteStatus> {
20        self.mfa_delete.as_ref()
21    }
22}
23impl crate::s3_request_id::RequestIdExt for GetBucketVersioningOutput {
24    fn extended_request_id(&self) -> Option<&str> {
25        self._extended_request_id.as_deref()
26    }
27}
28impl ::aws_types::request_id::RequestId for GetBucketVersioningOutput {
29    fn request_id(&self) -> Option<&str> {
30        self._request_id.as_deref()
31    }
32}
33impl GetBucketVersioningOutput {
34    /// Creates a new builder-style object to manufacture [`GetBucketVersioningOutput`](crate::operation::get_bucket_versioning::GetBucketVersioningOutput).
35    pub fn builder() -> crate::operation::get_bucket_versioning::builders::GetBucketVersioningOutputBuilder {
36        crate::operation::get_bucket_versioning::builders::GetBucketVersioningOutputBuilder::default()
37    }
38}
39
40/// A builder for [`GetBucketVersioningOutput`](crate::operation::get_bucket_versioning::GetBucketVersioningOutput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct GetBucketVersioningOutputBuilder {
44    pub(crate) status: ::std::option::Option<crate::types::BucketVersioningStatus>,
45    pub(crate) mfa_delete: ::std::option::Option<crate::types::MfaDeleteStatus>,
46    _extended_request_id: Option<String>,
47    _request_id: Option<String>,
48}
49impl GetBucketVersioningOutputBuilder {
50    /// <p>The versioning state of the bucket.</p>
51    pub fn status(mut self, input: crate::types::BucketVersioningStatus) -> Self {
52        self.status = ::std::option::Option::Some(input);
53        self
54    }
55    /// <p>The versioning state of the bucket.</p>
56    pub fn set_status(mut self, input: ::std::option::Option<crate::types::BucketVersioningStatus>) -> Self {
57        self.status = input;
58        self
59    }
60    /// <p>The versioning state of the bucket.</p>
61    pub fn get_status(&self) -> &::std::option::Option<crate::types::BucketVersioningStatus> {
62        &self.status
63    }
64    /// <p>Specifies whether MFA delete is enabled in the bucket versioning configuration. This element is only returned if the bucket has been configured with MFA delete. If the bucket has never been so configured, this element is not returned.</p>
65    pub fn mfa_delete(mut self, input: crate::types::MfaDeleteStatus) -> Self {
66        self.mfa_delete = ::std::option::Option::Some(input);
67        self
68    }
69    /// <p>Specifies whether MFA delete is enabled in the bucket versioning configuration. This element is only returned if the bucket has been configured with MFA delete. If the bucket has never been so configured, this element is not returned.</p>
70    pub fn set_mfa_delete(mut self, input: ::std::option::Option<crate::types::MfaDeleteStatus>) -> Self {
71        self.mfa_delete = input;
72        self
73    }
74    /// <p>Specifies whether MFA delete is enabled in the bucket versioning configuration. This element is only returned if the bucket has been configured with MFA delete. If the bucket has never been so configured, this element is not returned.</p>
75    pub fn get_mfa_delete(&self) -> &::std::option::Option<crate::types::MfaDeleteStatus> {
76        &self.mfa_delete
77    }
78    pub(crate) fn _extended_request_id(mut self, extended_request_id: impl Into<String>) -> Self {
79        self._extended_request_id = Some(extended_request_id.into());
80        self
81    }
82
83    pub(crate) fn _set_extended_request_id(&mut self, extended_request_id: Option<String>) -> &mut Self {
84        self._extended_request_id = extended_request_id;
85        self
86    }
87    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
88        self._request_id = Some(request_id.into());
89        self
90    }
91
92    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
93        self._request_id = request_id;
94        self
95    }
96    /// Consumes the builder and constructs a [`GetBucketVersioningOutput`](crate::operation::get_bucket_versioning::GetBucketVersioningOutput).
97    pub fn build(self) -> crate::operation::get_bucket_versioning::GetBucketVersioningOutput {
98        crate::operation::get_bucket_versioning::GetBucketVersioningOutput {
99            status: self.status,
100            mfa_delete: self.mfa_delete,
101            _extended_request_id: self._extended_request_id,
102            _request_id: self._request_id,
103        }
104    }
105}