aws_sdk_lambda/operation/update_alias/
_update_alias_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 UpdateAliasInput {
6    /// <p>The name or ARN of the Lambda function.</p>
7    /// <p class="title"><b>Name formats</b></p>
8    /// <ul>
9    /// <li>
10    /// <p><b>Function name</b> - <code>MyFunction</code>.</p></li>
11    /// <li>
12    /// <p><b>Function ARN</b> - <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p></li>
13    /// <li>
14    /// <p><b>Partial ARN</b> - <code>123456789012:function:MyFunction</code>.</p></li>
15    /// </ul>
16    /// <p>The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
17    pub function_name: ::std::option::Option<::std::string::String>,
18    /// <p>The name of the alias.</p>
19    pub name: ::std::option::Option<::std::string::String>,
20    /// <p>The function version that the alias invokes.</p>
21    pub function_version: ::std::option::Option<::std::string::String>,
22    /// <p>A description of the alias.</p>
23    pub description: ::std::option::Option<::std::string::String>,
24    /// <p>The <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing">routing configuration</a> of the alias.</p>
25    pub routing_config: ::std::option::Option<crate::types::AliasRoutingConfiguration>,
26    /// <p>Only update the alias if the revision ID matches the ID that's specified. Use this option to avoid modifying an alias that has changed since you last read it.</p>
27    pub revision_id: ::std::option::Option<::std::string::String>,
28}
29impl UpdateAliasInput {
30    /// <p>The name or ARN of the Lambda function.</p>
31    /// <p class="title"><b>Name formats</b></p>
32    /// <ul>
33    /// <li>
34    /// <p><b>Function name</b> - <code>MyFunction</code>.</p></li>
35    /// <li>
36    /// <p><b>Function ARN</b> - <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p></li>
37    /// <li>
38    /// <p><b>Partial ARN</b> - <code>123456789012:function:MyFunction</code>.</p></li>
39    /// </ul>
40    /// <p>The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
41    pub fn function_name(&self) -> ::std::option::Option<&str> {
42        self.function_name.as_deref()
43    }
44    /// <p>The name of the alias.</p>
45    pub fn name(&self) -> ::std::option::Option<&str> {
46        self.name.as_deref()
47    }
48    /// <p>The function version that the alias invokes.</p>
49    pub fn function_version(&self) -> ::std::option::Option<&str> {
50        self.function_version.as_deref()
51    }
52    /// <p>A description of the alias.</p>
53    pub fn description(&self) -> ::std::option::Option<&str> {
54        self.description.as_deref()
55    }
56    /// <p>The <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing">routing configuration</a> of the alias.</p>
57    pub fn routing_config(&self) -> ::std::option::Option<&crate::types::AliasRoutingConfiguration> {
58        self.routing_config.as_ref()
59    }
60    /// <p>Only update the alias if the revision ID matches the ID that's specified. Use this option to avoid modifying an alias that has changed since you last read it.</p>
61    pub fn revision_id(&self) -> ::std::option::Option<&str> {
62        self.revision_id.as_deref()
63    }
64}
65impl UpdateAliasInput {
66    /// Creates a new builder-style object to manufacture [`UpdateAliasInput`](crate::operation::update_alias::UpdateAliasInput).
67    pub fn builder() -> crate::operation::update_alias::builders::UpdateAliasInputBuilder {
68        crate::operation::update_alias::builders::UpdateAliasInputBuilder::default()
69    }
70}
71
72/// A builder for [`UpdateAliasInput`](crate::operation::update_alias::UpdateAliasInput).
73#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
74#[non_exhaustive]
75pub struct UpdateAliasInputBuilder {
76    pub(crate) function_name: ::std::option::Option<::std::string::String>,
77    pub(crate) name: ::std::option::Option<::std::string::String>,
78    pub(crate) function_version: ::std::option::Option<::std::string::String>,
79    pub(crate) description: ::std::option::Option<::std::string::String>,
80    pub(crate) routing_config: ::std::option::Option<crate::types::AliasRoutingConfiguration>,
81    pub(crate) revision_id: ::std::option::Option<::std::string::String>,
82}
83impl UpdateAliasInputBuilder {
84    /// <p>The name or ARN of the Lambda function.</p>
85    /// <p class="title"><b>Name formats</b></p>
86    /// <ul>
87    /// <li>
88    /// <p><b>Function name</b> - <code>MyFunction</code>.</p></li>
89    /// <li>
90    /// <p><b>Function ARN</b> - <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p></li>
91    /// <li>
92    /// <p><b>Partial ARN</b> - <code>123456789012:function:MyFunction</code>.</p></li>
93    /// </ul>
94    /// <p>The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
95    /// This field is required.
96    pub fn function_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.function_name = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>The name or ARN of the Lambda function.</p>
101    /// <p class="title"><b>Name formats</b></p>
102    /// <ul>
103    /// <li>
104    /// <p><b>Function name</b> - <code>MyFunction</code>.</p></li>
105    /// <li>
106    /// <p><b>Function ARN</b> - <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p></li>
107    /// <li>
108    /// <p><b>Partial ARN</b> - <code>123456789012:function:MyFunction</code>.</p></li>
109    /// </ul>
110    /// <p>The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
111    pub fn set_function_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
112        self.function_name = input;
113        self
114    }
115    /// <p>The name or ARN of the Lambda function.</p>
116    /// <p class="title"><b>Name formats</b></p>
117    /// <ul>
118    /// <li>
119    /// <p><b>Function name</b> - <code>MyFunction</code>.</p></li>
120    /// <li>
121    /// <p><b>Function ARN</b> - <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p></li>
122    /// <li>
123    /// <p><b>Partial ARN</b> - <code>123456789012:function:MyFunction</code>.</p></li>
124    /// </ul>
125    /// <p>The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
126    pub fn get_function_name(&self) -> &::std::option::Option<::std::string::String> {
127        &self.function_name
128    }
129    /// <p>The name of the alias.</p>
130    /// This field is required.
131    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.name = ::std::option::Option::Some(input.into());
133        self
134    }
135    /// <p>The name of the alias.</p>
136    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.name = input;
138        self
139    }
140    /// <p>The name of the alias.</p>
141    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
142        &self.name
143    }
144    /// <p>The function version that the alias invokes.</p>
145    pub fn function_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.function_version = ::std::option::Option::Some(input.into());
147        self
148    }
149    /// <p>The function version that the alias invokes.</p>
150    pub fn set_function_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.function_version = input;
152        self
153    }
154    /// <p>The function version that the alias invokes.</p>
155    pub fn get_function_version(&self) -> &::std::option::Option<::std::string::String> {
156        &self.function_version
157    }
158    /// <p>A description of the alias.</p>
159    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.description = ::std::option::Option::Some(input.into());
161        self
162    }
163    /// <p>A description of the alias.</p>
164    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.description = input;
166        self
167    }
168    /// <p>A description of the alias.</p>
169    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
170        &self.description
171    }
172    /// <p>The <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing">routing configuration</a> of the alias.</p>
173    pub fn routing_config(mut self, input: crate::types::AliasRoutingConfiguration) -> Self {
174        self.routing_config = ::std::option::Option::Some(input);
175        self
176    }
177    /// <p>The <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing">routing configuration</a> of the alias.</p>
178    pub fn set_routing_config(mut self, input: ::std::option::Option<crate::types::AliasRoutingConfiguration>) -> Self {
179        self.routing_config = input;
180        self
181    }
182    /// <p>The <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing">routing configuration</a> of the alias.</p>
183    pub fn get_routing_config(&self) -> &::std::option::Option<crate::types::AliasRoutingConfiguration> {
184        &self.routing_config
185    }
186    /// <p>Only update the alias if the revision ID matches the ID that's specified. Use this option to avoid modifying an alias that has changed since you last read it.</p>
187    pub fn revision_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188        self.revision_id = ::std::option::Option::Some(input.into());
189        self
190    }
191    /// <p>Only update the alias if the revision ID matches the ID that's specified. Use this option to avoid modifying an alias that has changed since you last read it.</p>
192    pub fn set_revision_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193        self.revision_id = input;
194        self
195    }
196    /// <p>Only update the alias if the revision ID matches the ID that's specified. Use this option to avoid modifying an alias that has changed since you last read it.</p>
197    pub fn get_revision_id(&self) -> &::std::option::Option<::std::string::String> {
198        &self.revision_id
199    }
200    /// Consumes the builder and constructs a [`UpdateAliasInput`](crate::operation::update_alias::UpdateAliasInput).
201    pub fn build(self) -> ::std::result::Result<crate::operation::update_alias::UpdateAliasInput, ::aws_smithy_types::error::operation::BuildError> {
202        ::std::result::Result::Ok(crate::operation::update_alias::UpdateAliasInput {
203            function_name: self.function_name,
204            name: self.name,
205            function_version: self.function_version,
206            description: self.description,
207            routing_config: self.routing_config,
208            revision_id: self.revision_id,
209        })
210    }
211}