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