aws_sdk_iotfleetwise/operation/create_fleet/
_create_fleet_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 CreateFleetInput {
6    /// <p>The unique ID of the fleet to create.</p>
7    pub fleet_id: ::std::option::Option<::std::string::String>,
8    /// <p>A brief description of the fleet to create.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The Amazon Resource Name (ARN) of a signal catalog.</p>
11    pub signal_catalog_arn: ::std::option::Option<::std::string::String>,
12    /// <p>Metadata that can be used to manage the fleet.</p>
13    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
14}
15impl CreateFleetInput {
16    /// <p>The unique ID of the fleet to create.</p>
17    pub fn fleet_id(&self) -> ::std::option::Option<&str> {
18        self.fleet_id.as_deref()
19    }
20    /// <p>A brief description of the fleet to create.</p>
21    pub fn description(&self) -> ::std::option::Option<&str> {
22        self.description.as_deref()
23    }
24    /// <p>The Amazon Resource Name (ARN) of a signal catalog.</p>
25    pub fn signal_catalog_arn(&self) -> ::std::option::Option<&str> {
26        self.signal_catalog_arn.as_deref()
27    }
28    /// <p>Metadata that can be used to manage the fleet.</p>
29    ///
30    /// 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()`.
31    pub fn tags(&self) -> &[crate::types::Tag] {
32        self.tags.as_deref().unwrap_or_default()
33    }
34}
35impl CreateFleetInput {
36    /// Creates a new builder-style object to manufacture [`CreateFleetInput`](crate::operation::create_fleet::CreateFleetInput).
37    pub fn builder() -> crate::operation::create_fleet::builders::CreateFleetInputBuilder {
38        crate::operation::create_fleet::builders::CreateFleetInputBuilder::default()
39    }
40}
41
42/// A builder for [`CreateFleetInput`](crate::operation::create_fleet::CreateFleetInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct CreateFleetInputBuilder {
46    pub(crate) fleet_id: ::std::option::Option<::std::string::String>,
47    pub(crate) description: ::std::option::Option<::std::string::String>,
48    pub(crate) signal_catalog_arn: ::std::option::Option<::std::string::String>,
49    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
50}
51impl CreateFleetInputBuilder {
52    /// <p>The unique ID of the fleet to create.</p>
53    /// This field is required.
54    pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.fleet_id = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The unique ID of the fleet to create.</p>
59    pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.fleet_id = input;
61        self
62    }
63    /// <p>The unique ID of the fleet to create.</p>
64    pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
65        &self.fleet_id
66    }
67    /// <p>A brief description of the fleet to create.</p>
68    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.description = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>A brief description of the fleet to create.</p>
73    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.description = input;
75        self
76    }
77    /// <p>A brief description of the fleet to create.</p>
78    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
79        &self.description
80    }
81    /// <p>The Amazon Resource Name (ARN) of a signal catalog.</p>
82    /// This field is required.
83    pub fn signal_catalog_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.signal_catalog_arn = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The Amazon Resource Name (ARN) of a signal catalog.</p>
88    pub fn set_signal_catalog_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.signal_catalog_arn = input;
90        self
91    }
92    /// <p>The Amazon Resource Name (ARN) of a signal catalog.</p>
93    pub fn get_signal_catalog_arn(&self) -> &::std::option::Option<::std::string::String> {
94        &self.signal_catalog_arn
95    }
96    /// Appends an item to `tags`.
97    ///
98    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
99    ///
100    /// <p>Metadata that can be used to manage the fleet.</p>
101    pub fn tags(mut self, input: crate::types::Tag) -> Self {
102        let mut v = self.tags.unwrap_or_default();
103        v.push(input);
104        self.tags = ::std::option::Option::Some(v);
105        self
106    }
107    /// <p>Metadata that can be used to manage the fleet.</p>
108    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
109        self.tags = input;
110        self
111    }
112    /// <p>Metadata that can be used to manage the fleet.</p>
113    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
114        &self.tags
115    }
116    /// Consumes the builder and constructs a [`CreateFleetInput`](crate::operation::create_fleet::CreateFleetInput).
117    pub fn build(self) -> ::std::result::Result<crate::operation::create_fleet::CreateFleetInput, ::aws_smithy_types::error::operation::BuildError> {
118        ::std::result::Result::Ok(crate::operation::create_fleet::CreateFleetInput {
119            fleet_id: self.fleet_id,
120            description: self.description,
121            signal_catalog_arn: self.signal_catalog_arn,
122            tags: self.tags,
123        })
124    }
125}