aws_sdk_s3tables/operation/create_table/
_create_table_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 CreateTableOutput {
6    /// <p>The Amazon Resource Name (ARN) of the table.</p>
7    pub table_arn: ::std::string::String,
8    /// <p>The version token of the table.</p>
9    pub version_token: ::std::string::String,
10    _request_id: Option<String>,
11}
12impl CreateTableOutput {
13    /// <p>The Amazon Resource Name (ARN) of the table.</p>
14    pub fn table_arn(&self) -> &str {
15        use std::ops::Deref;
16        self.table_arn.deref()
17    }
18    /// <p>The version token of the table.</p>
19    pub fn version_token(&self) -> &str {
20        use std::ops::Deref;
21        self.version_token.deref()
22    }
23}
24impl ::aws_types::request_id::RequestId for CreateTableOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl CreateTableOutput {
30    /// Creates a new builder-style object to manufacture [`CreateTableOutput`](crate::operation::create_table::CreateTableOutput).
31    pub fn builder() -> crate::operation::create_table::builders::CreateTableOutputBuilder {
32        crate::operation::create_table::builders::CreateTableOutputBuilder::default()
33    }
34}
35
36/// A builder for [`CreateTableOutput`](crate::operation::create_table::CreateTableOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct CreateTableOutputBuilder {
40    pub(crate) table_arn: ::std::option::Option<::std::string::String>,
41    pub(crate) version_token: ::std::option::Option<::std::string::String>,
42    _request_id: Option<String>,
43}
44impl CreateTableOutputBuilder {
45    /// <p>The Amazon Resource Name (ARN) of the table.</p>
46    /// This field is required.
47    pub fn table_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.table_arn = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>The Amazon Resource Name (ARN) of the table.</p>
52    pub fn set_table_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.table_arn = input;
54        self
55    }
56    /// <p>The Amazon Resource Name (ARN) of the table.</p>
57    pub fn get_table_arn(&self) -> &::std::option::Option<::std::string::String> {
58        &self.table_arn
59    }
60    /// <p>The version token of the table.</p>
61    /// This field is required.
62    pub fn version_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.version_token = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// <p>The version token of the table.</p>
67    pub fn set_version_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.version_token = input;
69        self
70    }
71    /// <p>The version token of the table.</p>
72    pub fn get_version_token(&self) -> &::std::option::Option<::std::string::String> {
73        &self.version_token
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 [`CreateTableOutput`](crate::operation::create_table::CreateTableOutput).
85    /// This method will fail if any of the following fields are not set:
86    /// - [`table_arn`](crate::operation::create_table::builders::CreateTableOutputBuilder::table_arn)
87    /// - [`version_token`](crate::operation::create_table::builders::CreateTableOutputBuilder::version_token)
88    pub fn build(self) -> ::std::result::Result<crate::operation::create_table::CreateTableOutput, ::aws_smithy_types::error::operation::BuildError> {
89        ::std::result::Result::Ok(crate::operation::create_table::CreateTableOutput {
90            table_arn: self.table_arn.ok_or_else(|| {
91                ::aws_smithy_types::error::operation::BuildError::missing_field(
92                    "table_arn",
93                    "table_arn was not specified but it is required when building CreateTableOutput",
94                )
95            })?,
96            version_token: self.version_token.ok_or_else(|| {
97                ::aws_smithy_types::error::operation::BuildError::missing_field(
98                    "version_token",
99                    "version_token was not specified but it is required when building CreateTableOutput",
100                )
101            })?,
102            _request_id: self._request_id,
103        })
104    }
105}