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