aws_sdk_iotsitewise/operation/create_project/
_create_project_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 CreateProjectInput {
6    /// <p>The ID of the portal in which to create the project.</p>
7    pub portal_id: ::std::option::Option<::std::string::String>,
8    /// <p>A friendly name for the project.</p>
9    pub project_name: ::std::option::Option<::std::string::String>,
10    /// <p>A description for the project.</p>
11    pub project_description: ::std::option::Option<::std::string::String>,
12    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
13    pub client_token: ::std::option::Option<::std::string::String>,
14    /// <p>A list of key-value pairs that contain metadata for the project. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
15    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16}
17impl CreateProjectInput {
18    /// <p>The ID of the portal in which to create the project.</p>
19    pub fn portal_id(&self) -> ::std::option::Option<&str> {
20        self.portal_id.as_deref()
21    }
22    /// <p>A friendly name for the project.</p>
23    pub fn project_name(&self) -> ::std::option::Option<&str> {
24        self.project_name.as_deref()
25    }
26    /// <p>A description for the project.</p>
27    pub fn project_description(&self) -> ::std::option::Option<&str> {
28        self.project_description.as_deref()
29    }
30    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
31    pub fn client_token(&self) -> ::std::option::Option<&str> {
32        self.client_token.as_deref()
33    }
34    /// <p>A list of key-value pairs that contain metadata for the project. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
35    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
36        self.tags.as_ref()
37    }
38}
39impl CreateProjectInput {
40    /// Creates a new builder-style object to manufacture [`CreateProjectInput`](crate::operation::create_project::CreateProjectInput).
41    pub fn builder() -> crate::operation::create_project::builders::CreateProjectInputBuilder {
42        crate::operation::create_project::builders::CreateProjectInputBuilder::default()
43    }
44}
45
46/// A builder for [`CreateProjectInput`](crate::operation::create_project::CreateProjectInput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct CreateProjectInputBuilder {
50    pub(crate) portal_id: ::std::option::Option<::std::string::String>,
51    pub(crate) project_name: ::std::option::Option<::std::string::String>,
52    pub(crate) project_description: ::std::option::Option<::std::string::String>,
53    pub(crate) client_token: ::std::option::Option<::std::string::String>,
54    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
55}
56impl CreateProjectInputBuilder {
57    /// <p>The ID of the portal in which to create the project.</p>
58    /// This field is required.
59    pub fn portal_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.portal_id = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The ID of the portal in which to create the project.</p>
64    pub fn set_portal_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.portal_id = input;
66        self
67    }
68    /// <p>The ID of the portal in which to create the project.</p>
69    pub fn get_portal_id(&self) -> &::std::option::Option<::std::string::String> {
70        &self.portal_id
71    }
72    /// <p>A friendly name for the project.</p>
73    /// This field is required.
74    pub fn project_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.project_name = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>A friendly name for the project.</p>
79    pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.project_name = input;
81        self
82    }
83    /// <p>A friendly name for the project.</p>
84    pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
85        &self.project_name
86    }
87    /// <p>A description for the project.</p>
88    pub fn project_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.project_description = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>A description for the project.</p>
93    pub fn set_project_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.project_description = input;
95        self
96    }
97    /// <p>A description for the project.</p>
98    pub fn get_project_description(&self) -> &::std::option::Option<::std::string::String> {
99        &self.project_description
100    }
101    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
102    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.client_token = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
107    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.client_token = input;
109        self
110    }
111    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
112    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
113        &self.client_token
114    }
115    /// Adds a key-value pair to `tags`.
116    ///
117    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
118    ///
119    /// <p>A list of key-value pairs that contain metadata for the project. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
120    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
121        let mut hash_map = self.tags.unwrap_or_default();
122        hash_map.insert(k.into(), v.into());
123        self.tags = ::std::option::Option::Some(hash_map);
124        self
125    }
126    /// <p>A list of key-value pairs that contain metadata for the project. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
127    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
128        self.tags = input;
129        self
130    }
131    /// <p>A list of key-value pairs that contain metadata for the project. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
132    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
133        &self.tags
134    }
135    /// Consumes the builder and constructs a [`CreateProjectInput`](crate::operation::create_project::CreateProjectInput).
136    pub fn build(
137        self,
138    ) -> ::std::result::Result<crate::operation::create_project::CreateProjectInput, ::aws_smithy_types::error::operation::BuildError> {
139        ::std::result::Result::Ok(crate::operation::create_project::CreateProjectInput {
140            portal_id: self.portal_id,
141            project_name: self.project_name,
142            project_description: self.project_description,
143            client_token: self.client_token,
144            tags: self.tags,
145        })
146    }
147}