aws_sdk_transfer/operation/describe_access/
_describe_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 DescribeAccessOutput {
6    /// <p>A system-assigned unique identifier for a server that has this access assigned.</p>
7    pub server_id: ::std::string::String,
8    /// <p>The external identifier of the server that the access is attached to.</p>
9    pub access: ::std::option::Option<crate::types::DescribedAccess>,
10    _request_id: Option<String>,
11}
12impl DescribeAccessOutput {
13    /// <p>A system-assigned unique identifier for a server that has this access assigned.</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 server that the access is attached to.</p>
19    pub fn access(&self) -> ::std::option::Option<&crate::types::DescribedAccess> {
20        self.access.as_ref()
21    }
22}
23impl ::aws_types::request_id::RequestId for DescribeAccessOutput {
24    fn request_id(&self) -> Option<&str> {
25        self._request_id.as_deref()
26    }
27}
28impl DescribeAccessOutput {
29    /// Creates a new builder-style object to manufacture [`DescribeAccessOutput`](crate::operation::describe_access::DescribeAccessOutput).
30    pub fn builder() -> crate::operation::describe_access::builders::DescribeAccessOutputBuilder {
31        crate::operation::describe_access::builders::DescribeAccessOutputBuilder::default()
32    }
33}
34
35/// A builder for [`DescribeAccessOutput`](crate::operation::describe_access::DescribeAccessOutput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct DescribeAccessOutputBuilder {
39    pub(crate) server_id: ::std::option::Option<::std::string::String>,
40    pub(crate) access: ::std::option::Option<crate::types::DescribedAccess>,
41    _request_id: Option<String>,
42}
43impl DescribeAccessOutputBuilder {
44    /// <p>A system-assigned unique identifier for a server that has this access assigned.</p>
45    /// This field is required.
46    pub fn server_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.server_id = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>A system-assigned unique identifier for a server that has this access assigned.</p>
51    pub fn set_server_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.server_id = input;
53        self
54    }
55    /// <p>A system-assigned unique identifier for a server that has this access assigned.</p>
56    pub fn get_server_id(&self) -> &::std::option::Option<::std::string::String> {
57        &self.server_id
58    }
59    /// <p>The external identifier of the server that the access is attached to.</p>
60    /// This field is required.
61    pub fn access(mut self, input: crate::types::DescribedAccess) -> Self {
62        self.access = ::std::option::Option::Some(input);
63        self
64    }
65    /// <p>The external identifier of the server that the access is attached to.</p>
66    pub fn set_access(mut self, input: ::std::option::Option<crate::types::DescribedAccess>) -> Self {
67        self.access = input;
68        self
69    }
70    /// <p>The external identifier of the server that the access is attached to.</p>
71    pub fn get_access(&self) -> &::std::option::Option<crate::types::DescribedAccess> {
72        &self.access
73    }
74    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
75        self._request_id = Some(request_id.into());
76        self
77    }
78
79    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
80        self._request_id = request_id;
81        self
82    }
83    /// Consumes the builder and constructs a [`DescribeAccessOutput`](crate::operation::describe_access::DescribeAccessOutput).
84    /// This method will fail if any of the following fields are not set:
85    /// - [`server_id`](crate::operation::describe_access::builders::DescribeAccessOutputBuilder::server_id)
86    pub fn build(
87        self,
88    ) -> ::std::result::Result<crate::operation::describe_access::DescribeAccessOutput, ::aws_smithy_types::error::operation::BuildError> {
89        ::std::result::Result::Ok(crate::operation::describe_access::DescribeAccessOutput {
90            server_id: self.server_id.ok_or_else(|| {
91                ::aws_smithy_types::error::operation::BuildError::missing_field(
92                    "server_id",
93                    "server_id was not specified but it is required when building DescribeAccessOutput",
94                )
95            })?,
96            access: self.access,
97            _request_id: self._request_id,
98        })
99    }
100}