aws_sdk_transfer/operation/update_server/
_update_server_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 UpdateServerOutput {
6    /// <p>A system-assigned unique identifier for a server that the Transfer Family user is assigned to.</p>
7    pub server_id: ::std::string::String,
8    _request_id: Option<String>,
9}
10impl UpdateServerOutput {
11    /// <p>A system-assigned unique identifier for a server that the Transfer Family user is assigned to.</p>
12    pub fn server_id(&self) -> &str {
13        use std::ops::Deref;
14        self.server_id.deref()
15    }
16}
17impl ::aws_types::request_id::RequestId for UpdateServerOutput {
18    fn request_id(&self) -> Option<&str> {
19        self._request_id.as_deref()
20    }
21}
22impl UpdateServerOutput {
23    /// Creates a new builder-style object to manufacture [`UpdateServerOutput`](crate::operation::update_server::UpdateServerOutput).
24    pub fn builder() -> crate::operation::update_server::builders::UpdateServerOutputBuilder {
25        crate::operation::update_server::builders::UpdateServerOutputBuilder::default()
26    }
27}
28
29/// A builder for [`UpdateServerOutput`](crate::operation::update_server::UpdateServerOutput).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct UpdateServerOutputBuilder {
33    pub(crate) server_id: ::std::option::Option<::std::string::String>,
34    _request_id: Option<String>,
35}
36impl UpdateServerOutputBuilder {
37    /// <p>A system-assigned unique identifier for a server that the Transfer Family user is assigned to.</p>
38    /// This field is required.
39    pub fn server_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
40        self.server_id = ::std::option::Option::Some(input.into());
41        self
42    }
43    /// <p>A system-assigned unique identifier for a server that the Transfer Family user is assigned to.</p>
44    pub fn set_server_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
45        self.server_id = input;
46        self
47    }
48    /// <p>A system-assigned unique identifier for a server that the Transfer Family user is assigned to.</p>
49    pub fn get_server_id(&self) -> &::std::option::Option<::std::string::String> {
50        &self.server_id
51    }
52    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
53        self._request_id = Some(request_id.into());
54        self
55    }
56
57    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
58        self._request_id = request_id;
59        self
60    }
61    /// Consumes the builder and constructs a [`UpdateServerOutput`](crate::operation::update_server::UpdateServerOutput).
62    /// This method will fail if any of the following fields are not set:
63    /// - [`server_id`](crate::operation::update_server::builders::UpdateServerOutputBuilder::server_id)
64    pub fn build(
65        self,
66    ) -> ::std::result::Result<crate::operation::update_server::UpdateServerOutput, ::aws_smithy_types::error::operation::BuildError> {
67        ::std::result::Result::Ok(crate::operation::update_server::UpdateServerOutput {
68            server_id: self.server_id.ok_or_else(|| {
69                ::aws_smithy_types::error::operation::BuildError::missing_field(
70                    "server_id",
71                    "server_id was not specified but it is required when building UpdateServerOutput",
72                )
73            })?,
74            _request_id: self._request_id,
75        })
76    }
77}