aws_sdk_lambda/operation/publish_version/_publish_version_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 PublishVersionInput {
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>Only publish a version if the hash value matches the value that's specified. Use this option to avoid publishing a version if the function code has changed since you last updated it. You can get the hash for the version that you uploaded from the output of <code>UpdateFunctionCode</code>.</p>
19 pub code_sha256: ::std::option::Option<::std::string::String>,
20 /// <p>A description for the version to override the description in the function configuration.</p>
21 pub description: ::std::option::Option<::std::string::String>,
22 /// <p>Only update the function if the revision ID matches the ID that's specified. Use this option to avoid publishing a version if the function configuration has changed since you last updated it.</p>
23 pub revision_id: ::std::option::Option<::std::string::String>,
24 /// <p>Specifies where to publish the function version or configuration.</p>
25 pub publish_to: ::std::option::Option<crate::types::FunctionVersionLatestPublished>,
26}
27impl PublishVersionInput {
28 /// <p>The name or ARN of the Lambda function.</p>
29 /// <p class="title"><b>Name formats</b></p>
30 /// <ul>
31 /// <li>
32 /// <p><b>Function name</b> - <code>MyFunction</code>.</p></li>
33 /// <li>
34 /// <p><b>Function ARN</b> - <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p></li>
35 /// <li>
36 /// <p><b>Partial ARN</b> - <code>123456789012:function:MyFunction</code>.</p></li>
37 /// </ul>
38 /// <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>
39 pub fn function_name(&self) -> ::std::option::Option<&str> {
40 self.function_name.as_deref()
41 }
42 /// <p>Only publish a version if the hash value matches the value that's specified. Use this option to avoid publishing a version if the function code has changed since you last updated it. You can get the hash for the version that you uploaded from the output of <code>UpdateFunctionCode</code>.</p>
43 pub fn code_sha256(&self) -> ::std::option::Option<&str> {
44 self.code_sha256.as_deref()
45 }
46 /// <p>A description for the version to override the description in the function configuration.</p>
47 pub fn description(&self) -> ::std::option::Option<&str> {
48 self.description.as_deref()
49 }
50 /// <p>Only update the function if the revision ID matches the ID that's specified. Use this option to avoid publishing a version if the function configuration has changed since you last updated it.</p>
51 pub fn revision_id(&self) -> ::std::option::Option<&str> {
52 self.revision_id.as_deref()
53 }
54 /// <p>Specifies where to publish the function version or configuration.</p>
55 pub fn publish_to(&self) -> ::std::option::Option<&crate::types::FunctionVersionLatestPublished> {
56 self.publish_to.as_ref()
57 }
58}
59impl PublishVersionInput {
60 /// Creates a new builder-style object to manufacture [`PublishVersionInput`](crate::operation::publish_version::PublishVersionInput).
61 pub fn builder() -> crate::operation::publish_version::builders::PublishVersionInputBuilder {
62 crate::operation::publish_version::builders::PublishVersionInputBuilder::default()
63 }
64}
65
66/// A builder for [`PublishVersionInput`](crate::operation::publish_version::PublishVersionInput).
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
68#[non_exhaustive]
69pub struct PublishVersionInputBuilder {
70 pub(crate) function_name: ::std::option::Option<::std::string::String>,
71 pub(crate) code_sha256: ::std::option::Option<::std::string::String>,
72 pub(crate) description: ::std::option::Option<::std::string::String>,
73 pub(crate) revision_id: ::std::option::Option<::std::string::String>,
74 pub(crate) publish_to: ::std::option::Option<crate::types::FunctionVersionLatestPublished>,
75}
76impl PublishVersionInputBuilder {
77 /// <p>The name or ARN of the Lambda function.</p>
78 /// <p class="title"><b>Name formats</b></p>
79 /// <ul>
80 /// <li>
81 /// <p><b>Function name</b> - <code>MyFunction</code>.</p></li>
82 /// <li>
83 /// <p><b>Function ARN</b> - <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p></li>
84 /// <li>
85 /// <p><b>Partial ARN</b> - <code>123456789012:function:MyFunction</code>.</p></li>
86 /// </ul>
87 /// <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>
88 /// This field is required.
89 pub fn function_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90 self.function_name = ::std::option::Option::Some(input.into());
91 self
92 }
93 /// <p>The name or ARN of the Lambda function.</p>
94 /// <p class="title"><b>Name formats</b></p>
95 /// <ul>
96 /// <li>
97 /// <p><b>Function name</b> - <code>MyFunction</code>.</p></li>
98 /// <li>
99 /// <p><b>Function ARN</b> - <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p></li>
100 /// <li>
101 /// <p><b>Partial ARN</b> - <code>123456789012:function:MyFunction</code>.</p></li>
102 /// </ul>
103 /// <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>
104 pub fn set_function_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105 self.function_name = input;
106 self
107 }
108 /// <p>The name or ARN of the Lambda function.</p>
109 /// <p class="title"><b>Name formats</b></p>
110 /// <ul>
111 /// <li>
112 /// <p><b>Function name</b> - <code>MyFunction</code>.</p></li>
113 /// <li>
114 /// <p><b>Function ARN</b> - <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p></li>
115 /// <li>
116 /// <p><b>Partial ARN</b> - <code>123456789012:function:MyFunction</code>.</p></li>
117 /// </ul>
118 /// <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>
119 pub fn get_function_name(&self) -> &::std::option::Option<::std::string::String> {
120 &self.function_name
121 }
122 /// <p>Only publish a version if the hash value matches the value that's specified. Use this option to avoid publishing a version if the function code has changed since you last updated it. You can get the hash for the version that you uploaded from the output of <code>UpdateFunctionCode</code>.</p>
123 pub fn code_sha256(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124 self.code_sha256 = ::std::option::Option::Some(input.into());
125 self
126 }
127 /// <p>Only publish a version if the hash value matches the value that's specified. Use this option to avoid publishing a version if the function code has changed since you last updated it. You can get the hash for the version that you uploaded from the output of <code>UpdateFunctionCode</code>.</p>
128 pub fn set_code_sha256(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129 self.code_sha256 = input;
130 self
131 }
132 /// <p>Only publish a version if the hash value matches the value that's specified. Use this option to avoid publishing a version if the function code has changed since you last updated it. You can get the hash for the version that you uploaded from the output of <code>UpdateFunctionCode</code>.</p>
133 pub fn get_code_sha256(&self) -> &::std::option::Option<::std::string::String> {
134 &self.code_sha256
135 }
136 /// <p>A description for the version to override the description in the function configuration.</p>
137 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138 self.description = ::std::option::Option::Some(input.into());
139 self
140 }
141 /// <p>A description for the version to override the description in the function configuration.</p>
142 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143 self.description = input;
144 self
145 }
146 /// <p>A description for the version to override the description in the function configuration.</p>
147 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
148 &self.description
149 }
150 /// <p>Only update the function if the revision ID matches the ID that's specified. Use this option to avoid publishing a version if the function configuration has changed since you last updated it.</p>
151 pub fn revision_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152 self.revision_id = ::std::option::Option::Some(input.into());
153 self
154 }
155 /// <p>Only update the function if the revision ID matches the ID that's specified. Use this option to avoid publishing a version if the function configuration has changed since you last updated it.</p>
156 pub fn set_revision_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157 self.revision_id = input;
158 self
159 }
160 /// <p>Only update the function if the revision ID matches the ID that's specified. Use this option to avoid publishing a version if the function configuration has changed since you last updated it.</p>
161 pub fn get_revision_id(&self) -> &::std::option::Option<::std::string::String> {
162 &self.revision_id
163 }
164 /// <p>Specifies where to publish the function version or configuration.</p>
165 pub fn publish_to(mut self, input: crate::types::FunctionVersionLatestPublished) -> Self {
166 self.publish_to = ::std::option::Option::Some(input);
167 self
168 }
169 /// <p>Specifies where to publish the function version or configuration.</p>
170 pub fn set_publish_to(mut self, input: ::std::option::Option<crate::types::FunctionVersionLatestPublished>) -> Self {
171 self.publish_to = input;
172 self
173 }
174 /// <p>Specifies where to publish the function version or configuration.</p>
175 pub fn get_publish_to(&self) -> &::std::option::Option<crate::types::FunctionVersionLatestPublished> {
176 &self.publish_to
177 }
178 /// Consumes the builder and constructs a [`PublishVersionInput`](crate::operation::publish_version::PublishVersionInput).
179 pub fn build(
180 self,
181 ) -> ::std::result::Result<crate::operation::publish_version::PublishVersionInput, ::aws_smithy_types::error::operation::BuildError> {
182 ::std::result::Result::Ok(crate::operation::publish_version::PublishVersionInput {
183 function_name: self.function_name,
184 code_sha256: self.code_sha256,
185 description: self.description,
186 revision_id: self.revision_id,
187 publish_to: self.publish_to,
188 })
189 }
190}