aws_sdk_transfer/operation/update_user/
_update_user_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p><code>UpdateUserResponse</code> returns the user name and identifier for the request to update a user's properties.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateUserOutput {
7    /// <p>A system-assigned unique identifier for a Transfer Family server instance that the account is assigned to.</p>
8    pub server_id: ::std::string::String,
9    /// <p>The unique identifier for a user that is assigned to a server instance that was specified in the request.</p>
10    pub user_name: ::std::string::String,
11    _request_id: Option<String>,
12}
13impl UpdateUserOutput {
14    /// <p>A system-assigned unique identifier for a Transfer Family server instance that the account is assigned to.</p>
15    pub fn server_id(&self) -> &str {
16        use std::ops::Deref;
17        self.server_id.deref()
18    }
19    /// <p>The unique identifier for a user that is assigned to a server instance that was specified in the request.</p>
20    pub fn user_name(&self) -> &str {
21        use std::ops::Deref;
22        self.user_name.deref()
23    }
24}
25impl ::aws_types::request_id::RequestId for UpdateUserOutput {
26    fn request_id(&self) -> Option<&str> {
27        self._request_id.as_deref()
28    }
29}
30impl UpdateUserOutput {
31    /// Creates a new builder-style object to manufacture [`UpdateUserOutput`](crate::operation::update_user::UpdateUserOutput).
32    pub fn builder() -> crate::operation::update_user::builders::UpdateUserOutputBuilder {
33        crate::operation::update_user::builders::UpdateUserOutputBuilder::default()
34    }
35}
36
37/// A builder for [`UpdateUserOutput`](crate::operation::update_user::UpdateUserOutput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct UpdateUserOutputBuilder {
41    pub(crate) server_id: ::std::option::Option<::std::string::String>,
42    pub(crate) user_name: ::std::option::Option<::std::string::String>,
43    _request_id: Option<String>,
44}
45impl UpdateUserOutputBuilder {
46    /// <p>A system-assigned unique identifier for a Transfer Family server instance that the account is assigned to.</p>
47    /// This field is required.
48    pub fn server_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49        self.server_id = ::std::option::Option::Some(input.into());
50        self
51    }
52    /// <p>A system-assigned unique identifier for a Transfer Family server instance that the account is assigned to.</p>
53    pub fn set_server_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54        self.server_id = input;
55        self
56    }
57    /// <p>A system-assigned unique identifier for a Transfer Family server instance that the account is assigned to.</p>
58    pub fn get_server_id(&self) -> &::std::option::Option<::std::string::String> {
59        &self.server_id
60    }
61    /// <p>The unique identifier for a user that is assigned to a server instance that was specified in the request.</p>
62    /// This field is required.
63    pub fn user_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64        self.user_name = ::std::option::Option::Some(input.into());
65        self
66    }
67    /// <p>The unique identifier for a user that is assigned to a server instance that was specified in the request.</p>
68    pub fn set_user_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69        self.user_name = input;
70        self
71    }
72    /// <p>The unique identifier for a user that is assigned to a server instance that was specified in the request.</p>
73    pub fn get_user_name(&self) -> &::std::option::Option<::std::string::String> {
74        &self.user_name
75    }
76    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
77        self._request_id = Some(request_id.into());
78        self
79    }
80
81    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
82        self._request_id = request_id;
83        self
84    }
85    /// Consumes the builder and constructs a [`UpdateUserOutput`](crate::operation::update_user::UpdateUserOutput).
86    /// This method will fail if any of the following fields are not set:
87    /// - [`server_id`](crate::operation::update_user::builders::UpdateUserOutputBuilder::server_id)
88    /// - [`user_name`](crate::operation::update_user::builders::UpdateUserOutputBuilder::user_name)
89    pub fn build(self) -> ::std::result::Result<crate::operation::update_user::UpdateUserOutput, ::aws_smithy_types::error::operation::BuildError> {
90        ::std::result::Result::Ok(crate::operation::update_user::UpdateUserOutput {
91            server_id: self.server_id.ok_or_else(|| {
92                ::aws_smithy_types::error::operation::BuildError::missing_field(
93                    "server_id",
94                    "server_id was not specified but it is required when building UpdateUserOutput",
95                )
96            })?,
97            user_name: self.user_name.ok_or_else(|| {
98                ::aws_smithy_types::error::operation::BuildError::missing_field(
99                    "user_name",
100                    "user_name was not specified but it is required when building UpdateUserOutput",
101                )
102            })?,
103            _request_id: self._request_id,
104        })
105    }
106}