aws_sdk_m2/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 /// <p>The identifier of the runtime environment where you want to deploy this application.</p>
7 pub environment_id: ::std::option::Option<::std::string::String>,
8 /// <p>The application identifier.</p>
9 pub application_id: ::std::option::Option<::std::string::String>,
10 /// <p>The version of the application to deploy.</p>
11 pub application_version: ::std::option::Option<i32>,
12 /// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create a deployment. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires.</p>
13 pub client_token: ::std::option::Option<::std::string::String>,
14}
15impl CreateDeploymentInput {
16 /// <p>The identifier of the runtime environment where you want to deploy this application.</p>
17 pub fn environment_id(&self) -> ::std::option::Option<&str> {
18 self.environment_id.as_deref()
19 }
20 /// <p>The application identifier.</p>
21 pub fn application_id(&self) -> ::std::option::Option<&str> {
22 self.application_id.as_deref()
23 }
24 /// <p>The version of the application to deploy.</p>
25 pub fn application_version(&self) -> ::std::option::Option<i32> {
26 self.application_version
27 }
28 /// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create a deployment. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires.</p>
29 pub fn client_token(&self) -> ::std::option::Option<&str> {
30 self.client_token.as_deref()
31 }
32}
33impl CreateDeploymentInput {
34 /// Creates a new builder-style object to manufacture [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
35 pub fn builder() -> crate::operation::create_deployment::builders::CreateDeploymentInputBuilder {
36 crate::operation::create_deployment::builders::CreateDeploymentInputBuilder::default()
37 }
38}
39
40/// A builder for [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct CreateDeploymentInputBuilder {
44 pub(crate) environment_id: ::std::option::Option<::std::string::String>,
45 pub(crate) application_id: ::std::option::Option<::std::string::String>,
46 pub(crate) application_version: ::std::option::Option<i32>,
47 pub(crate) client_token: ::std::option::Option<::std::string::String>,
48}
49impl CreateDeploymentInputBuilder {
50 /// <p>The identifier of the runtime environment where you want to deploy this application.</p>
51 /// This field is required.
52 pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53 self.environment_id = ::std::option::Option::Some(input.into());
54 self
55 }
56 /// <p>The identifier of the runtime environment where you want to deploy this application.</p>
57 pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58 self.environment_id = input;
59 self
60 }
61 /// <p>The identifier of the runtime environment where you want to deploy this application.</p>
62 pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
63 &self.environment_id
64 }
65 /// <p>The application identifier.</p>
66 /// This field is required.
67 pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68 self.application_id = ::std::option::Option::Some(input.into());
69 self
70 }
71 /// <p>The application identifier.</p>
72 pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73 self.application_id = input;
74 self
75 }
76 /// <p>The application identifier.</p>
77 pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
78 &self.application_id
79 }
80 /// <p>The version of the application to deploy.</p>
81 /// This field is required.
82 pub fn application_version(mut self, input: i32) -> Self {
83 self.application_version = ::std::option::Option::Some(input);
84 self
85 }
86 /// <p>The version of the application to deploy.</p>
87 pub fn set_application_version(mut self, input: ::std::option::Option<i32>) -> Self {
88 self.application_version = input;
89 self
90 }
91 /// <p>The version of the application to deploy.</p>
92 pub fn get_application_version(&self) -> &::std::option::Option<i32> {
93 &self.application_version
94 }
95 /// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create a deployment. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires.</p>
96 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97 self.client_token = ::std::option::Option::Some(input.into());
98 self
99 }
100 /// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create a deployment. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires.</p>
101 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102 self.client_token = input;
103 self
104 }
105 /// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create a deployment. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires.</p>
106 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
107 &self.client_token
108 }
109 /// Consumes the builder and constructs a [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
110 pub fn build(
111 self,
112 ) -> ::std::result::Result<crate::operation::create_deployment::CreateDeploymentInput, ::aws_smithy_types::error::operation::BuildError> {
113 ::std::result::Result::Ok(crate::operation::create_deployment::CreateDeploymentInput {
114 environment_id: self.environment_id,
115 application_id: self.application_id,
116 application_version: self.application_version,
117 client_token: self.client_token,
118 })
119 }
120}