aws-sdk-sms 1.79.0

AWS SDK for AWS Server Migration Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetServersOutput {
    /// <p>The time when the server was last modified.</p>
    pub last_modified_on: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The status of the server catalog.</p>
    pub server_catalog_status: ::std::option::Option<crate::types::ServerCatalogStatus>,
    /// <p>Information about the servers.</p>
    pub server_list: ::std::option::Option<::std::vec::Vec<crate::types::Server>>,
    /// <p>The token required to retrieve the next set of results. This value is null when there are no more results to return.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetServersOutput {
    /// <p>The time when the server was last modified.</p>
    pub fn last_modified_on(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_modified_on.as_ref()
    }
    /// <p>The status of the server catalog.</p>
    pub fn server_catalog_status(&self) -> ::std::option::Option<&crate::types::ServerCatalogStatus> {
        self.server_catalog_status.as_ref()
    }
    /// <p>Information about the servers.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.server_list.is_none()`.
    pub fn server_list(&self) -> &[crate::types::Server] {
        self.server_list.as_deref().unwrap_or_default()
    }
    /// <p>The token required to retrieve the next set of results. This value is null when there are no more results to return.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for GetServersOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetServersOutput {
    /// Creates a new builder-style object to manufacture [`GetServersOutput`](crate::operation::get_servers::GetServersOutput).
    pub fn builder() -> crate::operation::get_servers::builders::GetServersOutputBuilder {
        crate::operation::get_servers::builders::GetServersOutputBuilder::default()
    }
}

/// A builder for [`GetServersOutput`](crate::operation::get_servers::GetServersOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetServersOutputBuilder {
    pub(crate) last_modified_on: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) server_catalog_status: ::std::option::Option<crate::types::ServerCatalogStatus>,
    pub(crate) server_list: ::std::option::Option<::std::vec::Vec<crate::types::Server>>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetServersOutputBuilder {
    /// <p>The time when the server was last modified.</p>
    pub fn last_modified_on(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_modified_on = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when the server was last modified.</p>
    pub fn set_last_modified_on(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_modified_on = input;
        self
    }
    /// <p>The time when the server was last modified.</p>
    pub fn get_last_modified_on(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_modified_on
    }
    /// <p>The status of the server catalog.</p>
    pub fn server_catalog_status(mut self, input: crate::types::ServerCatalogStatus) -> Self {
        self.server_catalog_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the server catalog.</p>
    pub fn set_server_catalog_status(mut self, input: ::std::option::Option<crate::types::ServerCatalogStatus>) -> Self {
        self.server_catalog_status = input;
        self
    }
    /// <p>The status of the server catalog.</p>
    pub fn get_server_catalog_status(&self) -> &::std::option::Option<crate::types::ServerCatalogStatus> {
        &self.server_catalog_status
    }
    /// Appends an item to `server_list`.
    ///
    /// To override the contents of this collection use [`set_server_list`](Self::set_server_list).
    ///
    /// <p>Information about the servers.</p>
    pub fn server_list(mut self, input: crate::types::Server) -> Self {
        let mut v = self.server_list.unwrap_or_default();
        v.push(input);
        self.server_list = ::std::option::Option::Some(v);
        self
    }
    /// <p>Information about the servers.</p>
    pub fn set_server_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Server>>) -> Self {
        self.server_list = input;
        self
    }
    /// <p>Information about the servers.</p>
    pub fn get_server_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Server>> {
        &self.server_list
    }
    /// <p>The token required to retrieve the next set of results. This value is null when there are no more results to return.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The token required to retrieve the next set of results. This value is null when there are no more results to return.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>The token required to retrieve the next set of results. This value is null when there are no more results to return.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetServersOutput`](crate::operation::get_servers::GetServersOutput).
    pub fn build(self) -> crate::operation::get_servers::GetServersOutput {
        crate::operation::get_servers::GetServersOutput {
            last_modified_on: self.last_modified_on,
            server_catalog_status: self.server_catalog_status,
            server_list: self.server_list,
            next_token: self.next_token,
            _request_id: self._request_id,
        }
    }
}