aws_sdk_greengrass/operation/create_deployment/
_create_deployment_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 CreateDeploymentInput {
6    /// A client token used to correlate requests and responses.
7    pub amzn_client_token: ::std::option::Option<::std::string::String>,
8    /// The ID of the deployment if you wish to redeploy a previous deployment.
9    pub deployment_id: ::std::option::Option<::std::string::String>,
10    /// The type of deployment. When used for ''CreateDeployment'', only ''NewDeployment'' and ''Redeployment'' are valid.
11    pub deployment_type: ::std::option::Option<crate::types::DeploymentType>,
12    /// The ID of the Greengrass group.
13    pub group_id: ::std::option::Option<::std::string::String>,
14    /// The ID of the group version to be deployed.
15    pub group_version_id: ::std::option::Option<::std::string::String>,
16}
17impl CreateDeploymentInput {
18    /// A client token used to correlate requests and responses.
19    pub fn amzn_client_token(&self) -> ::std::option::Option<&str> {
20        self.amzn_client_token.as_deref()
21    }
22    /// The ID of the deployment if you wish to redeploy a previous deployment.
23    pub fn deployment_id(&self) -> ::std::option::Option<&str> {
24        self.deployment_id.as_deref()
25    }
26    /// The type of deployment. When used for ''CreateDeployment'', only ''NewDeployment'' and ''Redeployment'' are valid.
27    pub fn deployment_type(&self) -> ::std::option::Option<&crate::types::DeploymentType> {
28        self.deployment_type.as_ref()
29    }
30    /// The ID of the Greengrass group.
31    pub fn group_id(&self) -> ::std::option::Option<&str> {
32        self.group_id.as_deref()
33    }
34    /// The ID of the group version to be deployed.
35    pub fn group_version_id(&self) -> ::std::option::Option<&str> {
36        self.group_version_id.as_deref()
37    }
38}
39impl CreateDeploymentInput {
40    /// Creates a new builder-style object to manufacture [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
41    pub fn builder() -> crate::operation::create_deployment::builders::CreateDeploymentInputBuilder {
42        crate::operation::create_deployment::builders::CreateDeploymentInputBuilder::default()
43    }
44}
45
46/// A builder for [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct CreateDeploymentInputBuilder {
50    pub(crate) amzn_client_token: ::std::option::Option<::std::string::String>,
51    pub(crate) deployment_id: ::std::option::Option<::std::string::String>,
52    pub(crate) deployment_type: ::std::option::Option<crate::types::DeploymentType>,
53    pub(crate) group_id: ::std::option::Option<::std::string::String>,
54    pub(crate) group_version_id: ::std::option::Option<::std::string::String>,
55}
56impl CreateDeploymentInputBuilder {
57    /// A client token used to correlate requests and responses.
58    pub fn amzn_client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        self.amzn_client_token = ::std::option::Option::Some(input.into());
60        self
61    }
62    /// A client token used to correlate requests and responses.
63    pub fn set_amzn_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64        self.amzn_client_token = input;
65        self
66    }
67    /// A client token used to correlate requests and responses.
68    pub fn get_amzn_client_token(&self) -> &::std::option::Option<::std::string::String> {
69        &self.amzn_client_token
70    }
71    /// The ID of the deployment if you wish to redeploy a previous deployment.
72    pub fn deployment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73        self.deployment_id = ::std::option::Option::Some(input.into());
74        self
75    }
76    /// The ID of the deployment if you wish to redeploy a previous deployment.
77    pub fn set_deployment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78        self.deployment_id = input;
79        self
80    }
81    /// The ID of the deployment if you wish to redeploy a previous deployment.
82    pub fn get_deployment_id(&self) -> &::std::option::Option<::std::string::String> {
83        &self.deployment_id
84    }
85    /// The type of deployment. When used for ''CreateDeployment'', only ''NewDeployment'' and ''Redeployment'' are valid.
86    /// This field is required.
87    pub fn deployment_type(mut self, input: crate::types::DeploymentType) -> Self {
88        self.deployment_type = ::std::option::Option::Some(input);
89        self
90    }
91    /// The type of deployment. When used for ''CreateDeployment'', only ''NewDeployment'' and ''Redeployment'' are valid.
92    pub fn set_deployment_type(mut self, input: ::std::option::Option<crate::types::DeploymentType>) -> Self {
93        self.deployment_type = input;
94        self
95    }
96    /// The type of deployment. When used for ''CreateDeployment'', only ''NewDeployment'' and ''Redeployment'' are valid.
97    pub fn get_deployment_type(&self) -> &::std::option::Option<crate::types::DeploymentType> {
98        &self.deployment_type
99    }
100    /// The ID of the Greengrass group.
101    /// This field is required.
102    pub fn group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.group_id = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// The ID of the Greengrass group.
107    pub fn set_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.group_id = input;
109        self
110    }
111    /// The ID of the Greengrass group.
112    pub fn get_group_id(&self) -> &::std::option::Option<::std::string::String> {
113        &self.group_id
114    }
115    /// The ID of the group version to be deployed.
116    pub fn group_version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.group_version_id = ::std::option::Option::Some(input.into());
118        self
119    }
120    /// The ID of the group version to be deployed.
121    pub fn set_group_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.group_version_id = input;
123        self
124    }
125    /// The ID of the group version to be deployed.
126    pub fn get_group_version_id(&self) -> &::std::option::Option<::std::string::String> {
127        &self.group_version_id
128    }
129    /// Consumes the builder and constructs a [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
130    pub fn build(
131        self,
132    ) -> ::std::result::Result<crate::operation::create_deployment::CreateDeploymentInput, ::aws_smithy_types::error::operation::BuildError> {
133        ::std::result::Result::Ok(crate::operation::create_deployment::CreateDeploymentInput {
134            amzn_client_token: self.amzn_client_token,
135            deployment_id: self.deployment_id,
136            deployment_type: self.deployment_type,
137            group_id: self.group_id,
138            group_version_id: self.group_version_id,
139        })
140    }
141}