aws_sdk_sagemaker/operation/update_devices/
_update_devices_input.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 UpdateDevicesInput {
6    /// <p>The name of the fleet the devices belong to.</p>
7    pub device_fleet_name: ::std::option::Option<::std::string::String>,
8    /// <p>List of devices to register with Edge Manager agent.</p>
9    pub devices: ::std::option::Option<::std::vec::Vec<crate::types::Device>>,
10}
11impl UpdateDevicesInput {
12    /// <p>The name of the fleet the devices belong to.</p>
13    pub fn device_fleet_name(&self) -> ::std::option::Option<&str> {
14        self.device_fleet_name.as_deref()
15    }
16    /// <p>List of devices to register with Edge Manager agent.</p>
17    ///
18    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.devices.is_none()`.
19    pub fn devices(&self) -> &[crate::types::Device] {
20        self.devices.as_deref().unwrap_or_default()
21    }
22}
23impl UpdateDevicesInput {
24    /// Creates a new builder-style object to manufacture [`UpdateDevicesInput`](crate::operation::update_devices::UpdateDevicesInput).
25    pub fn builder() -> crate::operation::update_devices::builders::UpdateDevicesInputBuilder {
26        crate::operation::update_devices::builders::UpdateDevicesInputBuilder::default()
27    }
28}
29
30/// A builder for [`UpdateDevicesInput`](crate::operation::update_devices::UpdateDevicesInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct UpdateDevicesInputBuilder {
34    pub(crate) device_fleet_name: ::std::option::Option<::std::string::String>,
35    pub(crate) devices: ::std::option::Option<::std::vec::Vec<crate::types::Device>>,
36}
37impl UpdateDevicesInputBuilder {
38    /// <p>The name of the fleet the devices belong to.</p>
39    /// This field is required.
40    pub fn device_fleet_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.device_fleet_name = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>The name of the fleet the devices belong to.</p>
45    pub fn set_device_fleet_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.device_fleet_name = input;
47        self
48    }
49    /// <p>The name of the fleet the devices belong to.</p>
50    pub fn get_device_fleet_name(&self) -> &::std::option::Option<::std::string::String> {
51        &self.device_fleet_name
52    }
53    /// Appends an item to `devices`.
54    ///
55    /// To override the contents of this collection use [`set_devices`](Self::set_devices).
56    ///
57    /// <p>List of devices to register with Edge Manager agent.</p>
58    pub fn devices(mut self, input: crate::types::Device) -> Self {
59        let mut v = self.devices.unwrap_or_default();
60        v.push(input);
61        self.devices = ::std::option::Option::Some(v);
62        self
63    }
64    /// <p>List of devices to register with Edge Manager agent.</p>
65    pub fn set_devices(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Device>>) -> Self {
66        self.devices = input;
67        self
68    }
69    /// <p>List of devices to register with Edge Manager agent.</p>
70    pub fn get_devices(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Device>> {
71        &self.devices
72    }
73    /// Consumes the builder and constructs a [`UpdateDevicesInput`](crate::operation::update_devices::UpdateDevicesInput).
74    pub fn build(
75        self,
76    ) -> ::std::result::Result<crate::operation::update_devices::UpdateDevicesInput, ::aws_smithy_types::error::operation::BuildError> {
77        ::std::result::Result::Ok(crate::operation::update_devices::UpdateDevicesInput {
78            device_fleet_name: self.device_fleet_name,
79            devices: self.devices,
80        })
81    }
82}