aws-sdk-snowdevicemanagement 0.26.0

AWS SDK for AWS Snow Device Management
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 ListDevicesOutput {
    /// <p>A list of device structures that contain information about the device.</p>
    #[doc(hidden)]
    pub devices: std::option::Option<std::vec::Vec<crate::types::DeviceSummary>>,
    /// <p>A pagination token to continue to the next page of devices.</p>
    #[doc(hidden)]
    pub next_token: std::option::Option<std::string::String>,
    _request_id: Option<String>,
}
impl ListDevicesOutput {
    /// <p>A list of device structures that contain information about the device.</p>
    pub fn devices(&self) -> std::option::Option<&[crate::types::DeviceSummary]> {
        self.devices.as_deref()
    }
    /// <p>A pagination token to continue to the next page of devices.</p>
    pub fn next_token(&self) -> std::option::Option<&str> {
        self.next_token.as_deref()
    }
}
impl aws_http::request_id::RequestId for ListDevicesOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl ListDevicesOutput {
    /// Creates a new builder-style object to manufacture [`ListDevicesOutput`](crate::operation::list_devices::ListDevicesOutput).
    pub fn builder() -> crate::operation::list_devices::builders::ListDevicesOutputBuilder {
        crate::operation::list_devices::builders::ListDevicesOutputBuilder::default()
    }
}

/// A builder for [`ListDevicesOutput`](crate::operation::list_devices::ListDevicesOutput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct ListDevicesOutputBuilder {
    pub(crate) devices: std::option::Option<std::vec::Vec<crate::types::DeviceSummary>>,
    pub(crate) next_token: std::option::Option<std::string::String>,
    _request_id: Option<String>,
}
impl ListDevicesOutputBuilder {
    /// Appends an item to `devices`.
    ///
    /// To override the contents of this collection use [`set_devices`](Self::set_devices).
    ///
    /// <p>A list of device structures that contain information about the device.</p>
    pub fn devices(mut self, input: crate::types::DeviceSummary) -> Self {
        let mut v = self.devices.unwrap_or_default();
        v.push(input);
        self.devices = Some(v);
        self
    }
    /// <p>A list of device structures that contain information about the device.</p>
    pub fn set_devices(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::DeviceSummary>>,
    ) -> Self {
        self.devices = input;
        self
    }
    /// <p>A pagination token to continue to the next page of devices.</p>
    pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
        self.next_token = Some(input.into());
        self
    }
    /// <p>A pagination token to continue to the next page of devices.</p>
    pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    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 [`ListDevicesOutput`](crate::operation::list_devices::ListDevicesOutput).
    pub fn build(self) -> crate::operation::list_devices::ListDevicesOutput {
        crate::operation::list_devices::ListDevicesOutput {
            devices: self.devices,
            next_token: self.next_token,
            _request_id: self._request_id,
        }
    }
}