aws_sdk_transfer/operation/create_access/
_create_access_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 CreateAccessOutput {
6    /// <p>The identifier of the server that the user is attached to.</p>
7    pub server_id: ::std::string::String,
8    /// <p>The external identifier of the group whose users have access to your Amazon S3 or Amazon EFS resources over the enabled protocols using Transfer Family.</p>
9    pub external_id: ::std::string::String,
10    _request_id: Option<String>,
11}
12impl CreateAccessOutput {
13    /// <p>The identifier of the server that the user is attached to.</p>
14    pub fn server_id(&self) -> &str {
15        use std::ops::Deref;
16        self.server_id.deref()
17    }
18    /// <p>The external identifier of the group whose users have access to your Amazon S3 or Amazon EFS resources over the enabled protocols using Transfer Family.</p>
19    pub fn external_id(&self) -> &str {
20        use std::ops::Deref;
21        self.external_id.deref()
22    }
23}
24impl ::aws_types::request_id::RequestId for CreateAccessOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl CreateAccessOutput {
30    /// Creates a new builder-style object to manufacture [`CreateAccessOutput`](crate::operation::create_access::CreateAccessOutput).
31    pub fn builder() -> crate::operation::create_access::builders::CreateAccessOutputBuilder {
32        crate::operation::create_access::builders::CreateAccessOutputBuilder::default()
33    }
34}
35
36/// A builder for [`CreateAccessOutput`](crate::operation::create_access::CreateAccessOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct CreateAccessOutputBuilder {
40    pub(crate) server_id: ::std::option::Option<::std::string::String>,
41    pub(crate) external_id: ::std::option::Option<::std::string::String>,
42    _request_id: Option<String>,
43}
44impl CreateAccessOutputBuilder {
45    /// <p>The identifier of the server that the user is attached to.</p>
46    /// This field is required.
47    pub fn server_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.server_id = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>The identifier of the server that the user is attached to.</p>
52    pub fn set_server_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.server_id = input;
54        self
55    }
56    /// <p>The identifier of the server that the user is attached to.</p>
57    pub fn get_server_id(&self) -> &::std::option::Option<::std::string::String> {
58        &self.server_id
59    }
60    /// <p>The external identifier of the group whose users have access to your Amazon S3 or Amazon EFS resources over the enabled protocols using Transfer Family.</p>
61    /// This field is required.
62    pub fn external_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.external_id = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// <p>The external identifier of the group whose users have access to your Amazon S3 or Amazon EFS resources over the enabled protocols using Transfer Family.</p>
67    pub fn set_external_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.external_id = input;
69        self
70    }
71    /// <p>The external identifier of the group whose users have access to your Amazon S3 or Amazon EFS resources over the enabled protocols using Transfer Family.</p>
72    pub fn get_external_id(&self) -> &::std::option::Option<::std::string::String> {
73        &self.external_id
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 [`CreateAccessOutput`](crate::operation::create_access::CreateAccessOutput).
85    /// This method will fail if any of the following fields are not set:
86    /// - [`server_id`](crate::operation::create_access::builders::CreateAccessOutputBuilder::server_id)
87    /// - [`external_id`](crate::operation::create_access::builders::CreateAccessOutputBuilder::external_id)
88    pub fn build(
89        self,
90    ) -> ::std::result::Result<crate::operation::create_access::CreateAccessOutput, ::aws_smithy_types::error::operation::BuildError> {
91        ::std::result::Result::Ok(crate::operation::create_access::CreateAccessOutput {
92            server_id: self.server_id.ok_or_else(|| {
93                ::aws_smithy_types::error::operation::BuildError::missing_field(
94                    "server_id",
95                    "server_id was not specified but it is required when building CreateAccessOutput",
96                )
97            })?,
98            external_id: self.external_id.ok_or_else(|| {
99                ::aws_smithy_types::error::operation::BuildError::missing_field(
100                    "external_id",
101                    "external_id was not specified but it is required when building CreateAccessOutput",
102                )
103            })?,
104            _request_id: self._request_id,
105        })
106    }
107}