aws_sdk_cloudfront/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)]
5pub struct UpdateFunctionInput {
6    /// <p>The name of the function that you are updating.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The current version (<code>ETag</code> value) of the function that you are updating, which you can get using <code>DescribeFunction</code>.</p>
9    pub if_match: ::std::option::Option<::std::string::String>,
10    /// <p>Configuration information about the function.</p>
11    pub function_config: ::std::option::Option<crate::types::FunctionConfig>,
12    /// <p>The function code. For more information about writing a CloudFront function, see <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/writing-function-code.html">Writing function code for CloudFront Functions</a> in the <i>Amazon CloudFront Developer Guide</i>.</p>
13    pub function_code: ::std::option::Option<::aws_smithy_types::Blob>,
14}
15impl UpdateFunctionInput {
16    /// <p>The name of the function that you are updating.</p>
17    pub fn name(&self) -> ::std::option::Option<&str> {
18        self.name.as_deref()
19    }
20    /// <p>The current version (<code>ETag</code> value) of the function that you are updating, which you can get using <code>DescribeFunction</code>.</p>
21    pub fn if_match(&self) -> ::std::option::Option<&str> {
22        self.if_match.as_deref()
23    }
24    /// <p>Configuration information about the function.</p>
25    pub fn function_config(&self) -> ::std::option::Option<&crate::types::FunctionConfig> {
26        self.function_config.as_ref()
27    }
28    /// <p>The function code. For more information about writing a CloudFront function, see <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/writing-function-code.html">Writing function code for CloudFront Functions</a> in the <i>Amazon CloudFront Developer Guide</i>.</p>
29    pub fn function_code(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
30        self.function_code.as_ref()
31    }
32}
33impl ::std::fmt::Debug for UpdateFunctionInput {
34    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
35        let mut formatter = f.debug_struct("UpdateFunctionInput");
36        formatter.field("name", &self.name);
37        formatter.field("if_match", &self.if_match);
38        formatter.field("function_config", &self.function_config);
39        formatter.field("function_code", &"*** Sensitive Data Redacted ***");
40        formatter.finish()
41    }
42}
43impl UpdateFunctionInput {
44    /// Creates a new builder-style object to manufacture [`UpdateFunctionInput`](crate::operation::update_function::UpdateFunctionInput).
45    pub fn builder() -> crate::operation::update_function::builders::UpdateFunctionInputBuilder {
46        crate::operation::update_function::builders::UpdateFunctionInputBuilder::default()
47    }
48}
49
50/// A builder for [`UpdateFunctionInput`](crate::operation::update_function::UpdateFunctionInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
52#[non_exhaustive]
53pub struct UpdateFunctionInputBuilder {
54    pub(crate) name: ::std::option::Option<::std::string::String>,
55    pub(crate) if_match: ::std::option::Option<::std::string::String>,
56    pub(crate) function_config: ::std::option::Option<crate::types::FunctionConfig>,
57    pub(crate) function_code: ::std::option::Option<::aws_smithy_types::Blob>,
58}
59impl UpdateFunctionInputBuilder {
60    /// <p>The name of the function that you are updating.</p>
61    /// This field is required.
62    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.name = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// <p>The name of the function that you are updating.</p>
67    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.name = input;
69        self
70    }
71    /// <p>The name of the function that you are updating.</p>
72    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
73        &self.name
74    }
75    /// <p>The current version (<code>ETag</code> value) of the function that you are updating, which you can get using <code>DescribeFunction</code>.</p>
76    /// This field is required.
77    pub fn if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.if_match = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>The current version (<code>ETag</code> value) of the function that you are updating, which you can get using <code>DescribeFunction</code>.</p>
82    pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.if_match = input;
84        self
85    }
86    /// <p>The current version (<code>ETag</code> value) of the function that you are updating, which you can get using <code>DescribeFunction</code>.</p>
87    pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> {
88        &self.if_match
89    }
90    /// <p>Configuration information about the function.</p>
91    /// This field is required.
92    pub fn function_config(mut self, input: crate::types::FunctionConfig) -> Self {
93        self.function_config = ::std::option::Option::Some(input);
94        self
95    }
96    /// <p>Configuration information about the function.</p>
97    pub fn set_function_config(mut self, input: ::std::option::Option<crate::types::FunctionConfig>) -> Self {
98        self.function_config = input;
99        self
100    }
101    /// <p>Configuration information about the function.</p>
102    pub fn get_function_config(&self) -> &::std::option::Option<crate::types::FunctionConfig> {
103        &self.function_config
104    }
105    /// <p>The function code. For more information about writing a CloudFront function, see <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/writing-function-code.html">Writing function code for CloudFront Functions</a> in the <i>Amazon CloudFront Developer Guide</i>.</p>
106    /// This field is required.
107    pub fn function_code(mut self, input: ::aws_smithy_types::Blob) -> Self {
108        self.function_code = ::std::option::Option::Some(input);
109        self
110    }
111    /// <p>The function code. For more information about writing a CloudFront function, see <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/writing-function-code.html">Writing function code for CloudFront Functions</a> in the <i>Amazon CloudFront Developer Guide</i>.</p>
112    pub fn set_function_code(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
113        self.function_code = input;
114        self
115    }
116    /// <p>The function code. For more information about writing a CloudFront function, see <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/writing-function-code.html">Writing function code for CloudFront Functions</a> in the <i>Amazon CloudFront Developer Guide</i>.</p>
117    pub fn get_function_code(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
118        &self.function_code
119    }
120    /// Consumes the builder and constructs a [`UpdateFunctionInput`](crate::operation::update_function::UpdateFunctionInput).
121    pub fn build(
122        self,
123    ) -> ::std::result::Result<crate::operation::update_function::UpdateFunctionInput, ::aws_smithy_types::error::operation::BuildError> {
124        ::std::result::Result::Ok(crate::operation::update_function::UpdateFunctionInput {
125            name: self.name,
126            if_match: self.if_match,
127            function_config: self.function_config,
128            function_code: self.function_code,
129        })
130    }
131}
132impl ::std::fmt::Debug for UpdateFunctionInputBuilder {
133    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
134        let mut formatter = f.debug_struct("UpdateFunctionInputBuilder");
135        formatter.field("name", &self.name);
136        formatter.field("if_match", &self.if_match);
137        formatter.field("function_config", &self.function_config);
138        formatter.field("function_code", &"*** Sensitive Data Redacted ***");
139        formatter.finish()
140    }
141}