aws_sdk_iot1clickprojects/operation/update_project/
_update_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 UpdateProjectInput {
6    /// <p>The name of the project to be updated.</p>
7    pub project_name: ::std::option::Option<::std::string::String>,
8    /// <p>An optional user-defined description for the project.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>An object defining the project update. Once a project has been created, you cannot add device template names to the project. However, for a given <code>placementTemplate</code>, you can update the associated <code>callbackOverrides</code> for the device definition using this API.</p>
11    pub placement_template: ::std::option::Option<crate::types::PlacementTemplate>,
12}
13impl UpdateProjectInput {
14    /// <p>The name of the project to be updated.</p>
15    pub fn project_name(&self) -> ::std::option::Option<&str> {
16        self.project_name.as_deref()
17    }
18    /// <p>An optional user-defined description for the project.</p>
19    pub fn description(&self) -> ::std::option::Option<&str> {
20        self.description.as_deref()
21    }
22    /// <p>An object defining the project update. Once a project has been created, you cannot add device template names to the project. However, for a given <code>placementTemplate</code>, you can update the associated <code>callbackOverrides</code> for the device definition using this API.</p>
23    pub fn placement_template(&self) -> ::std::option::Option<&crate::types::PlacementTemplate> {
24        self.placement_template.as_ref()
25    }
26}
27impl UpdateProjectInput {
28    /// Creates a new builder-style object to manufacture [`UpdateProjectInput`](crate::operation::update_project::UpdateProjectInput).
29    pub fn builder() -> crate::operation::update_project::builders::UpdateProjectInputBuilder {
30        crate::operation::update_project::builders::UpdateProjectInputBuilder::default()
31    }
32}
33
34/// A builder for [`UpdateProjectInput`](crate::operation::update_project::UpdateProjectInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct UpdateProjectInputBuilder {
38    pub(crate) project_name: ::std::option::Option<::std::string::String>,
39    pub(crate) description: ::std::option::Option<::std::string::String>,
40    pub(crate) placement_template: ::std::option::Option<crate::types::PlacementTemplate>,
41}
42impl UpdateProjectInputBuilder {
43    /// <p>The name of the project to be updated.</p>
44    /// This field is required.
45    pub fn project_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.project_name = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <p>The name of the project to be updated.</p>
50    pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.project_name = input;
52        self
53    }
54    /// <p>The name of the project to be updated.</p>
55    pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
56        &self.project_name
57    }
58    /// <p>An optional user-defined description for the project.</p>
59    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.description = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>An optional user-defined description for the project.</p>
64    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.description = input;
66        self
67    }
68    /// <p>An optional user-defined description for the project.</p>
69    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
70        &self.description
71    }
72    /// <p>An object defining the project update. Once a project has been created, you cannot add device template names to the project. However, for a given <code>placementTemplate</code>, you can update the associated <code>callbackOverrides</code> for the device definition using this API.</p>
73    pub fn placement_template(mut self, input: crate::types::PlacementTemplate) -> Self {
74        self.placement_template = ::std::option::Option::Some(input);
75        self
76    }
77    /// <p>An object defining the project update. Once a project has been created, you cannot add device template names to the project. However, for a given <code>placementTemplate</code>, you can update the associated <code>callbackOverrides</code> for the device definition using this API.</p>
78    pub fn set_placement_template(mut self, input: ::std::option::Option<crate::types::PlacementTemplate>) -> Self {
79        self.placement_template = input;
80        self
81    }
82    /// <p>An object defining the project update. Once a project has been created, you cannot add device template names to the project. However, for a given <code>placementTemplate</code>, you can update the associated <code>callbackOverrides</code> for the device definition using this API.</p>
83    pub fn get_placement_template(&self) -> &::std::option::Option<crate::types::PlacementTemplate> {
84        &self.placement_template
85    }
86    /// Consumes the builder and constructs a [`UpdateProjectInput`](crate::operation::update_project::UpdateProjectInput).
87    pub fn build(
88        self,
89    ) -> ::std::result::Result<crate::operation::update_project::UpdateProjectInput, ::aws_smithy_types::error::operation::BuildError> {
90        ::std::result::Result::Ok(crate::operation::update_project::UpdateProjectInput {
91            project_name: self.project_name,
92            description: self.description,
93            placement_template: self.placement_template,
94        })
95    }
96}