aws_sdk_robomaker/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#[deprecated(
4    note = "AWS RoboMaker is unable to process this request as the support for the AWS RoboMaker application deployment feature has ended. For additional information, see https://docs.aws.amazon.com/robomaker/latest/dg/fleets.html."
5)]
6#[non_exhaustive]
7#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
8pub struct CreateFleetInput {
9    /// <p>The name of the fleet.</p>
10    pub name: ::std::option::Option<::std::string::String>,
11    /// <p>A map that contains tag keys and tag values that are attached to the fleet.</p>
12    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
13}
14impl CreateFleetInput {
15    /// <p>The name of the fleet.</p>
16    pub fn name(&self) -> ::std::option::Option<&str> {
17        self.name.as_deref()
18    }
19    /// <p>A map that contains tag keys and tag values that are attached to the fleet.</p>
20    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
21        self.tags.as_ref()
22    }
23}
24impl CreateFleetInput {
25    /// Creates a new builder-style object to manufacture [`CreateFleetInput`](crate::operation::create_fleet::CreateFleetInput).
26    pub fn builder() -> crate::operation::create_fleet::builders::CreateFleetInputBuilder {
27        crate::operation::create_fleet::builders::CreateFleetInputBuilder::default()
28    }
29}
30
31/// A builder for [`CreateFleetInput`](crate::operation::create_fleet::CreateFleetInput).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct CreateFleetInputBuilder {
35    pub(crate) name: ::std::option::Option<::std::string::String>,
36    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
37}
38impl CreateFleetInputBuilder {
39    /// <p>The name of the fleet.</p>
40    /// This field is required.
41    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
42        self.name = ::std::option::Option::Some(input.into());
43        self
44    }
45    /// <p>The name of the fleet.</p>
46    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
47        self.name = input;
48        self
49    }
50    /// <p>The name of the fleet.</p>
51    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
52        &self.name
53    }
54    /// Adds a key-value pair to `tags`.
55    ///
56    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
57    ///
58    /// <p>A map that contains tag keys and tag values that are attached to the fleet.</p>
59    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
60        let mut hash_map = self.tags.unwrap_or_default();
61        hash_map.insert(k.into(), v.into());
62        self.tags = ::std::option::Option::Some(hash_map);
63        self
64    }
65    /// <p>A map that contains tag keys and tag values that are attached to the fleet.</p>
66    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
67        self.tags = input;
68        self
69    }
70    /// <p>A map that contains tag keys and tag values that are attached to the fleet.</p>
71    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
72        &self.tags
73    }
74    /// Consumes the builder and constructs a [`CreateFleetInput`](crate::operation::create_fleet::CreateFleetInput).
75    pub fn build(self) -> ::std::result::Result<crate::operation::create_fleet::CreateFleetInput, ::aws_smithy_types::error::operation::BuildError> {
76        ::std::result::Result::Ok(crate::operation::create_fleet::CreateFleetInput {
77            name: self.name,
78            tags: self.tags,
79        })
80    }
81}