aws_sdk_mailmanager/operation/create_archive/
_create_archive_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateArchiveOutput {
7 pub archive_id: ::std::string::String,
9 _request_id: Option<String>,
10}
11impl CreateArchiveOutput {
12 pub fn archive_id(&self) -> &str {
14 use std::ops::Deref;
15 self.archive_id.deref()
16 }
17}
18impl ::aws_types::request_id::RequestId for CreateArchiveOutput {
19 fn request_id(&self) -> Option<&str> {
20 self._request_id.as_deref()
21 }
22}
23impl CreateArchiveOutput {
24 pub fn builder() -> crate::operation::create_archive::builders::CreateArchiveOutputBuilder {
26 crate::operation::create_archive::builders::CreateArchiveOutputBuilder::default()
27 }
28}
29
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct CreateArchiveOutputBuilder {
34 pub(crate) archive_id: ::std::option::Option<::std::string::String>,
35 _request_id: Option<String>,
36}
37impl CreateArchiveOutputBuilder {
38 pub fn archive_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41 self.archive_id = ::std::option::Option::Some(input.into());
42 self
43 }
44 pub fn set_archive_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46 self.archive_id = input;
47 self
48 }
49 pub fn get_archive_id(&self) -> &::std::option::Option<::std::string::String> {
51 &self.archive_id
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 pub fn build(
66 self,
67 ) -> ::std::result::Result<crate::operation::create_archive::CreateArchiveOutput, ::aws_smithy_types::error::operation::BuildError> {
68 ::std::result::Result::Ok(crate::operation::create_archive::CreateArchiveOutput {
69 archive_id: self.archive_id.ok_or_else(|| {
70 ::aws_smithy_types::error::operation::BuildError::missing_field(
71 "archive_id",
72 "archive_id was not specified but it is required when building CreateArchiveOutput",
73 )
74 })?,
75 _request_id: self._request_id,
76 })
77 }
78}