aws_sdk_appsync/operation/update_function/
_update_function_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 UpdateFunctionInput {
6    /// <p>The GraphQL API ID.</p>
7    pub api_id: ::std::option::Option<::std::string::String>,
8    /// <p>The <code>Function</code> name.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>The <code>Function</code> description.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>The function ID.</p>
13    pub function_id: ::std::option::Option<::std::string::String>,
14    /// <p>The <code>Function</code> <code>DataSource</code> name.</p>
15    pub data_source_name: ::std::option::Option<::std::string::String>,
16    /// <p>The <code>Function</code> request mapping template. Functions support only the 2018-05-29 version of the request mapping template.</p>
17    pub request_mapping_template: ::std::option::Option<::std::string::String>,
18    /// <p>The <code>Function</code> request mapping template.</p>
19    pub response_mapping_template: ::std::option::Option<::std::string::String>,
20    /// <p>The <code>version</code> of the request mapping template. Currently, the supported value is 2018-05-29. Note that when using VTL and mapping templates, the <code>functionVersion</code> is required.</p>
21    pub function_version: ::std::option::Option<::std::string::String>,
22    /// <p>Describes a Sync configuration for a resolver.</p>
23    /// <p>Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.</p>
24    pub sync_config: ::std::option::Option<crate::types::SyncConfig>,
25    /// <p>The maximum batching size for a resolver.</p>
26    pub max_batch_size: ::std::option::Option<i32>,
27    /// <p>Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.</p>
28    pub runtime: ::std::option::Option<crate::types::AppSyncRuntime>,
29    /// <p>The <code>function</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>
30    pub code: ::std::option::Option<::std::string::String>,
31}
32impl UpdateFunctionInput {
33    /// <p>The GraphQL API ID.</p>
34    pub fn api_id(&self) -> ::std::option::Option<&str> {
35        self.api_id.as_deref()
36    }
37    /// <p>The <code>Function</code> name.</p>
38    pub fn name(&self) -> ::std::option::Option<&str> {
39        self.name.as_deref()
40    }
41    /// <p>The <code>Function</code> description.</p>
42    pub fn description(&self) -> ::std::option::Option<&str> {
43        self.description.as_deref()
44    }
45    /// <p>The function ID.</p>
46    pub fn function_id(&self) -> ::std::option::Option<&str> {
47        self.function_id.as_deref()
48    }
49    /// <p>The <code>Function</code> <code>DataSource</code> name.</p>
50    pub fn data_source_name(&self) -> ::std::option::Option<&str> {
51        self.data_source_name.as_deref()
52    }
53    /// <p>The <code>Function</code> request mapping template. Functions support only the 2018-05-29 version of the request mapping template.</p>
54    pub fn request_mapping_template(&self) -> ::std::option::Option<&str> {
55        self.request_mapping_template.as_deref()
56    }
57    /// <p>The <code>Function</code> request mapping template.</p>
58    pub fn response_mapping_template(&self) -> ::std::option::Option<&str> {
59        self.response_mapping_template.as_deref()
60    }
61    /// <p>The <code>version</code> of the request mapping template. Currently, the supported value is 2018-05-29. Note that when using VTL and mapping templates, the <code>functionVersion</code> is required.</p>
62    pub fn function_version(&self) -> ::std::option::Option<&str> {
63        self.function_version.as_deref()
64    }
65    /// <p>Describes a Sync configuration for a resolver.</p>
66    /// <p>Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.</p>
67    pub fn sync_config(&self) -> ::std::option::Option<&crate::types::SyncConfig> {
68        self.sync_config.as_ref()
69    }
70    /// <p>The maximum batching size for a resolver.</p>
71    pub fn max_batch_size(&self) -> ::std::option::Option<i32> {
72        self.max_batch_size
73    }
74    /// <p>Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.</p>
75    pub fn runtime(&self) -> ::std::option::Option<&crate::types::AppSyncRuntime> {
76        self.runtime.as_ref()
77    }
78    /// <p>The <code>function</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>
79    pub fn code(&self) -> ::std::option::Option<&str> {
80        self.code.as_deref()
81    }
82}
83impl UpdateFunctionInput {
84    /// Creates a new builder-style object to manufacture [`UpdateFunctionInput`](crate::operation::update_function::UpdateFunctionInput).
85    pub fn builder() -> crate::operation::update_function::builders::UpdateFunctionInputBuilder {
86        crate::operation::update_function::builders::UpdateFunctionInputBuilder::default()
87    }
88}
89
90/// A builder for [`UpdateFunctionInput`](crate::operation::update_function::UpdateFunctionInput).
91#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
92#[non_exhaustive]
93pub struct UpdateFunctionInputBuilder {
94    pub(crate) api_id: ::std::option::Option<::std::string::String>,
95    pub(crate) name: ::std::option::Option<::std::string::String>,
96    pub(crate) description: ::std::option::Option<::std::string::String>,
97    pub(crate) function_id: ::std::option::Option<::std::string::String>,
98    pub(crate) data_source_name: ::std::option::Option<::std::string::String>,
99    pub(crate) request_mapping_template: ::std::option::Option<::std::string::String>,
100    pub(crate) response_mapping_template: ::std::option::Option<::std::string::String>,
101    pub(crate) function_version: ::std::option::Option<::std::string::String>,
102    pub(crate) sync_config: ::std::option::Option<crate::types::SyncConfig>,
103    pub(crate) max_batch_size: ::std::option::Option<i32>,
104    pub(crate) runtime: ::std::option::Option<crate::types::AppSyncRuntime>,
105    pub(crate) code: ::std::option::Option<::std::string::String>,
106}
107impl UpdateFunctionInputBuilder {
108    /// <p>The GraphQL API ID.</p>
109    /// This field is required.
110    pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.api_id = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>The GraphQL API ID.</p>
115    pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.api_id = input;
117        self
118    }
119    /// <p>The GraphQL API ID.</p>
120    pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
121        &self.api_id
122    }
123    /// <p>The <code>Function</code> name.</p>
124    /// This field is required.
125    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.name = ::std::option::Option::Some(input.into());
127        self
128    }
129    /// <p>The <code>Function</code> name.</p>
130    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.name = input;
132        self
133    }
134    /// <p>The <code>Function</code> name.</p>
135    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
136        &self.name
137    }
138    /// <p>The <code>Function</code> description.</p>
139    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.description = ::std::option::Option::Some(input.into());
141        self
142    }
143    /// <p>The <code>Function</code> description.</p>
144    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.description = input;
146        self
147    }
148    /// <p>The <code>Function</code> description.</p>
149    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
150        &self.description
151    }
152    /// <p>The function ID.</p>
153    /// This field is required.
154    pub fn function_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.function_id = ::std::option::Option::Some(input.into());
156        self
157    }
158    /// <p>The function ID.</p>
159    pub fn set_function_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.function_id = input;
161        self
162    }
163    /// <p>The function ID.</p>
164    pub fn get_function_id(&self) -> &::std::option::Option<::std::string::String> {
165        &self.function_id
166    }
167    /// <p>The <code>Function</code> <code>DataSource</code> name.</p>
168    /// This field is required.
169    pub fn data_source_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170        self.data_source_name = ::std::option::Option::Some(input.into());
171        self
172    }
173    /// <p>The <code>Function</code> <code>DataSource</code> name.</p>
174    pub fn set_data_source_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
175        self.data_source_name = input;
176        self
177    }
178    /// <p>The <code>Function</code> <code>DataSource</code> name.</p>
179    pub fn get_data_source_name(&self) -> &::std::option::Option<::std::string::String> {
180        &self.data_source_name
181    }
182    /// <p>The <code>Function</code> request mapping template. Functions support only the 2018-05-29 version of the request mapping template.</p>
183    pub fn request_mapping_template(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184        self.request_mapping_template = ::std::option::Option::Some(input.into());
185        self
186    }
187    /// <p>The <code>Function</code> request mapping template. Functions support only the 2018-05-29 version of the request mapping template.</p>
188    pub fn set_request_mapping_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189        self.request_mapping_template = input;
190        self
191    }
192    /// <p>The <code>Function</code> request mapping template. Functions support only the 2018-05-29 version of the request mapping template.</p>
193    pub fn get_request_mapping_template(&self) -> &::std::option::Option<::std::string::String> {
194        &self.request_mapping_template
195    }
196    /// <p>The <code>Function</code> request mapping template.</p>
197    pub fn response_mapping_template(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198        self.response_mapping_template = ::std::option::Option::Some(input.into());
199        self
200    }
201    /// <p>The <code>Function</code> request mapping template.</p>
202    pub fn set_response_mapping_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203        self.response_mapping_template = input;
204        self
205    }
206    /// <p>The <code>Function</code> request mapping template.</p>
207    pub fn get_response_mapping_template(&self) -> &::std::option::Option<::std::string::String> {
208        &self.response_mapping_template
209    }
210    /// <p>The <code>version</code> of the request mapping template. Currently, the supported value is 2018-05-29. Note that when using VTL and mapping templates, the <code>functionVersion</code> is required.</p>
211    pub fn function_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
212        self.function_version = ::std::option::Option::Some(input.into());
213        self
214    }
215    /// <p>The <code>version</code> of the request mapping template. Currently, the supported value is 2018-05-29. Note that when using VTL and mapping templates, the <code>functionVersion</code> is required.</p>
216    pub fn set_function_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
217        self.function_version = input;
218        self
219    }
220    /// <p>The <code>version</code> of the request mapping template. Currently, the supported value is 2018-05-29. Note that when using VTL and mapping templates, the <code>functionVersion</code> is required.</p>
221    pub fn get_function_version(&self) -> &::std::option::Option<::std::string::String> {
222        &self.function_version
223    }
224    /// <p>Describes a Sync configuration for a resolver.</p>
225    /// <p>Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.</p>
226    pub fn sync_config(mut self, input: crate::types::SyncConfig) -> Self {
227        self.sync_config = ::std::option::Option::Some(input);
228        self
229    }
230    /// <p>Describes a Sync configuration for a resolver.</p>
231    /// <p>Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.</p>
232    pub fn set_sync_config(mut self, input: ::std::option::Option<crate::types::SyncConfig>) -> Self {
233        self.sync_config = input;
234        self
235    }
236    /// <p>Describes a Sync configuration for a resolver.</p>
237    /// <p>Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.</p>
238    pub fn get_sync_config(&self) -> &::std::option::Option<crate::types::SyncConfig> {
239        &self.sync_config
240    }
241    /// <p>The maximum batching size for a resolver.</p>
242    pub fn max_batch_size(mut self, input: i32) -> Self {
243        self.max_batch_size = ::std::option::Option::Some(input);
244        self
245    }
246    /// <p>The maximum batching size for a resolver.</p>
247    pub fn set_max_batch_size(mut self, input: ::std::option::Option<i32>) -> Self {
248        self.max_batch_size = input;
249        self
250    }
251    /// <p>The maximum batching size for a resolver.</p>
252    pub fn get_max_batch_size(&self) -> &::std::option::Option<i32> {
253        &self.max_batch_size
254    }
255    /// <p>Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.</p>
256    pub fn runtime(mut self, input: crate::types::AppSyncRuntime) -> Self {
257        self.runtime = ::std::option::Option::Some(input);
258        self
259    }
260    /// <p>Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.</p>
261    pub fn set_runtime(mut self, input: ::std::option::Option<crate::types::AppSyncRuntime>) -> Self {
262        self.runtime = input;
263        self
264    }
265    /// <p>Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.</p>
266    pub fn get_runtime(&self) -> &::std::option::Option<crate::types::AppSyncRuntime> {
267        &self.runtime
268    }
269    /// <p>The <code>function</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>
270    pub fn code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
271        self.code = ::std::option::Option::Some(input.into());
272        self
273    }
274    /// <p>The <code>function</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>
275    pub fn set_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
276        self.code = input;
277        self
278    }
279    /// <p>The <code>function</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>
280    pub fn get_code(&self) -> &::std::option::Option<::std::string::String> {
281        &self.code
282    }
283    /// Consumes the builder and constructs a [`UpdateFunctionInput`](crate::operation::update_function::UpdateFunctionInput).
284    pub fn build(
285        self,
286    ) -> ::std::result::Result<crate::operation::update_function::UpdateFunctionInput, ::aws_smithy_types::error::operation::BuildError> {
287        ::std::result::Result::Ok(crate::operation::update_function::UpdateFunctionInput {
288            api_id: self.api_id,
289            name: self.name,
290            description: self.description,
291            function_id: self.function_id,
292            data_source_name: self.data_source_name,
293            request_mapping_template: self.request_mapping_template,
294            response_mapping_template: self.response_mapping_template,
295            function_version: self.function_version,
296            sync_config: self.sync_config,
297            max_batch_size: self.max_batch_size,
298            runtime: self.runtime,
299            code: self.code,
300        })
301    }
302}