aws_sdk_lightsail/operation/create_bucket/
_create_bucket_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 CreateBucketOutput {
6    /// <p>An object that describes the bucket that is created.</p>
7    pub bucket: ::std::option::Option<crate::types::Bucket>,
8    /// <p>An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.</p>
9    pub operations: ::std::option::Option<::std::vec::Vec<crate::types::Operation>>,
10    _request_id: Option<String>,
11}
12impl CreateBucketOutput {
13    /// <p>An object that describes the bucket that is created.</p>
14    pub fn bucket(&self) -> ::std::option::Option<&crate::types::Bucket> {
15        self.bucket.as_ref()
16    }
17    /// <p>An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.operations.is_none()`.
20    pub fn operations(&self) -> &[crate::types::Operation] {
21        self.operations.as_deref().unwrap_or_default()
22    }
23}
24impl ::aws_types::request_id::RequestId for CreateBucketOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl CreateBucketOutput {
30    /// Creates a new builder-style object to manufacture [`CreateBucketOutput`](crate::operation::create_bucket::CreateBucketOutput).
31    pub fn builder() -> crate::operation::create_bucket::builders::CreateBucketOutputBuilder {
32        crate::operation::create_bucket::builders::CreateBucketOutputBuilder::default()
33    }
34}
35
36/// A builder for [`CreateBucketOutput`](crate::operation::create_bucket::CreateBucketOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct CreateBucketOutputBuilder {
40    pub(crate) bucket: ::std::option::Option<crate::types::Bucket>,
41    pub(crate) operations: ::std::option::Option<::std::vec::Vec<crate::types::Operation>>,
42    _request_id: Option<String>,
43}
44impl CreateBucketOutputBuilder {
45    /// <p>An object that describes the bucket that is created.</p>
46    pub fn bucket(mut self, input: crate::types::Bucket) -> Self {
47        self.bucket = ::std::option::Option::Some(input);
48        self
49    }
50    /// <p>An object that describes the bucket that is created.</p>
51    pub fn set_bucket(mut self, input: ::std::option::Option<crate::types::Bucket>) -> Self {
52        self.bucket = input;
53        self
54    }
55    /// <p>An object that describes the bucket that is created.</p>
56    pub fn get_bucket(&self) -> &::std::option::Option<crate::types::Bucket> {
57        &self.bucket
58    }
59    /// Appends an item to `operations`.
60    ///
61    /// To override the contents of this collection use [`set_operations`](Self::set_operations).
62    ///
63    /// <p>An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.</p>
64    pub fn operations(mut self, input: crate::types::Operation) -> Self {
65        let mut v = self.operations.unwrap_or_default();
66        v.push(input);
67        self.operations = ::std::option::Option::Some(v);
68        self
69    }
70    /// <p>An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.</p>
71    pub fn set_operations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Operation>>) -> Self {
72        self.operations = input;
73        self
74    }
75    /// <p>An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.</p>
76    pub fn get_operations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Operation>> {
77        &self.operations
78    }
79    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
80        self._request_id = Some(request_id.into());
81        self
82    }
83
84    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
85        self._request_id = request_id;
86        self
87    }
88    /// Consumes the builder and constructs a [`CreateBucketOutput`](crate::operation::create_bucket::CreateBucketOutput).
89    pub fn build(self) -> crate::operation::create_bucket::CreateBucketOutput {
90        crate::operation::create_bucket::CreateBucketOutput {
91            bucket: self.bucket,
92            operations: self.operations,
93            _request_id: self._request_id,
94        }
95    }
96}