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}
25impl PublishVersionInput {
26 /// <p>The name or ARN of the Lambda function.</p>
27 /// <p class="title"><b>Name formats</b></p>
28 /// <ul>
29 /// <li>
30 /// <p><b>Function name</b> - <code>MyFunction</code>.</p></li>
31 /// <li>
32 /// <p><b>Function ARN</b> - <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p></li>
33 /// <li>
34 /// <p><b>Partial ARN</b> - <code>123456789012:function:MyFunction</code>.</p></li>
35 /// </ul>
36 /// <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>
37 pub fn function_name(&self) -> ::std::option::Option<&str> {
38 self.function_name.as_deref()
39 }
40 /// <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>
41 pub fn code_sha256(&self) -> ::std::option::Option<&str> {
42 self.code_sha256.as_deref()
43 }
44 /// <p>A description for the version to override the description in the function configuration.</p>
45 pub fn description(&self) -> ::std::option::Option<&str> {
46 self.description.as_deref()
47 }
48 /// <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>
49 pub fn revision_id(&self) -> ::std::option::Option<&str> {
50 self.revision_id.as_deref()
51 }
52}
53impl PublishVersionInput {
54 /// Creates a new builder-style object to manufacture [`PublishVersionInput`](crate::operation::publish_version::PublishVersionInput).
55 pub fn builder() -> crate::operation::publish_version::builders::PublishVersionInputBuilder {
56 crate::operation::publish_version::builders::PublishVersionInputBuilder::default()
57 }
58}
59
60/// A builder for [`PublishVersionInput`](crate::operation::publish_version::PublishVersionInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct PublishVersionInputBuilder {
64 pub(crate) function_name: ::std::option::Option<::std::string::String>,
65 pub(crate) code_sha256: ::std::option::Option<::std::string::String>,
66 pub(crate) description: ::std::option::Option<::std::string::String>,
67 pub(crate) revision_id: ::std::option::Option<::std::string::String>,
68}
69impl PublishVersionInputBuilder {
70 /// <p>The name or ARN of the Lambda function.</p>
71 /// <p class="title"><b>Name formats</b></p>
72 /// <ul>
73 /// <li>
74 /// <p><b>Function name</b> - <code>MyFunction</code>.</p></li>
75 /// <li>
76 /// <p><b>Function ARN</b> - <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p></li>
77 /// <li>
78 /// <p><b>Partial ARN</b> - <code>123456789012:function:MyFunction</code>.</p></li>
79 /// </ul>
80 /// <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>
81 /// This field is required.
82 pub fn function_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83 self.function_name = ::std::option::Option::Some(input.into());
84 self
85 }
86 /// <p>The name or ARN of the Lambda function.</p>
87 /// <p class="title"><b>Name formats</b></p>
88 /// <ul>
89 /// <li>
90 /// <p><b>Function name</b> - <code>MyFunction</code>.</p></li>
91 /// <li>
92 /// <p><b>Function ARN</b> - <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p></li>
93 /// <li>
94 /// <p><b>Partial ARN</b> - <code>123456789012:function:MyFunction</code>.</p></li>
95 /// </ul>
96 /// <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>
97 pub fn set_function_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
98 self.function_name = input;
99 self
100 }
101 /// <p>The name or ARN of the Lambda function.</p>
102 /// <p class="title"><b>Name formats</b></p>
103 /// <ul>
104 /// <li>
105 /// <p><b>Function name</b> - <code>MyFunction</code>.</p></li>
106 /// <li>
107 /// <p><b>Function ARN</b> - <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p></li>
108 /// <li>
109 /// <p><b>Partial ARN</b> - <code>123456789012:function:MyFunction</code>.</p></li>
110 /// </ul>
111 /// <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>
112 pub fn get_function_name(&self) -> &::std::option::Option<::std::string::String> {
113 &self.function_name
114 }
115 /// <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>
116 pub fn code_sha256(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117 self.code_sha256 = ::std::option::Option::Some(input.into());
118 self
119 }
120 /// <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>
121 pub fn set_code_sha256(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.code_sha256 = input;
123 self
124 }
125 /// <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>
126 pub fn get_code_sha256(&self) -> &::std::option::Option<::std::string::String> {
127 &self.code_sha256
128 }
129 /// <p>A description for the version to override the description in the function configuration.</p>
130 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131 self.description = ::std::option::Option::Some(input.into());
132 self
133 }
134 /// <p>A description for the version to override the description in the function configuration.</p>
135 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.description = input;
137 self
138 }
139 /// <p>A description for the version to override the description in the function configuration.</p>
140 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
141 &self.description
142 }
143 /// <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>
144 pub fn revision_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145 self.revision_id = ::std::option::Option::Some(input.into());
146 self
147 }
148 /// <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>
149 pub fn set_revision_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150 self.revision_id = input;
151 self
152 }
153 /// <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>
154 pub fn get_revision_id(&self) -> &::std::option::Option<::std::string::String> {
155 &self.revision_id
156 }
157 /// Consumes the builder and constructs a [`PublishVersionInput`](crate::operation::publish_version::PublishVersionInput).
158 pub fn build(
159 self,
160 ) -> ::std::result::Result<crate::operation::publish_version::PublishVersionInput, ::aws_smithy_types::error::operation::BuildError> {
161 ::std::result::Result::Ok(crate::operation::publish_version::PublishVersionInput {
162 function_name: self.function_name,
163 code_sha256: self.code_sha256,
164 description: self.description,
165 revision_id: self.revision_id,
166 })
167 }
168}