aws_sdk_apigatewayv2/operation/create_deployment/
_create_deployment_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Creates a new Deployment resource to represent a deployment.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateDeploymentInput {
7    /// <p>The API identifier.</p>
8    pub api_id: ::std::option::Option<::std::string::String>,
9    /// <p>The description for the deployment resource.</p>
10    pub description: ::std::option::Option<::std::string::String>,
11    /// <p>The name of the Stage resource for the Deployment resource to create.</p>
12    pub stage_name: ::std::option::Option<::std::string::String>,
13}
14impl CreateDeploymentInput {
15    /// <p>The API identifier.</p>
16    pub fn api_id(&self) -> ::std::option::Option<&str> {
17        self.api_id.as_deref()
18    }
19    /// <p>The description for the deployment resource.</p>
20    pub fn description(&self) -> ::std::option::Option<&str> {
21        self.description.as_deref()
22    }
23    /// <p>The name of the Stage resource for the Deployment resource to create.</p>
24    pub fn stage_name(&self) -> ::std::option::Option<&str> {
25        self.stage_name.as_deref()
26    }
27}
28impl CreateDeploymentInput {
29    /// Creates a new builder-style object to manufacture [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
30    pub fn builder() -> crate::operation::create_deployment::builders::CreateDeploymentInputBuilder {
31        crate::operation::create_deployment::builders::CreateDeploymentInputBuilder::default()
32    }
33}
34
35/// A builder for [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct CreateDeploymentInputBuilder {
39    pub(crate) api_id: ::std::option::Option<::std::string::String>,
40    pub(crate) description: ::std::option::Option<::std::string::String>,
41    pub(crate) stage_name: ::std::option::Option<::std::string::String>,
42}
43impl CreateDeploymentInputBuilder {
44    /// <p>The API identifier.</p>
45    /// This field is required.
46    pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.api_id = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>The API identifier.</p>
51    pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.api_id = input;
53        self
54    }
55    /// <p>The API identifier.</p>
56    pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
57        &self.api_id
58    }
59    /// <p>The description for the deployment resource.</p>
60    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.description = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The description for the deployment resource.</p>
65    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.description = input;
67        self
68    }
69    /// <p>The description for the deployment resource.</p>
70    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
71        &self.description
72    }
73    /// <p>The name of the Stage resource for the Deployment resource to create.</p>
74    pub fn stage_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.stage_name = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>The name of the Stage resource for the Deployment resource to create.</p>
79    pub fn set_stage_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.stage_name = input;
81        self
82    }
83    /// <p>The name of the Stage resource for the Deployment resource to create.</p>
84    pub fn get_stage_name(&self) -> &::std::option::Option<::std::string::String> {
85        &self.stage_name
86    }
87    /// Consumes the builder and constructs a [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
88    pub fn build(
89        self,
90    ) -> ::std::result::Result<crate::operation::create_deployment::CreateDeploymentInput, ::aws_smithy_types::error::operation::BuildError> {
91        ::std::result::Result::Ok(crate::operation::create_deployment::CreateDeploymentInput {
92            api_id: self.api_id,
93            description: self.description,
94            stage_name: self.stage_name,
95        })
96    }
97}