aws_sdk_cloudfront/operation/test_function/
_test_function_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct TestFunctionInput {
6 pub name: ::std::option::Option<::std::string::String>,
8 pub if_match: ::std::option::Option<::std::string::String>,
10 pub stage: ::std::option::Option<crate::types::FunctionStage>,
12 pub event_object: ::std::option::Option<::aws_smithy_types::Blob>,
14}
15impl TestFunctionInput {
16 pub fn name(&self) -> ::std::option::Option<&str> {
18 self.name.as_deref()
19 }
20 pub fn if_match(&self) -> ::std::option::Option<&str> {
22 self.if_match.as_deref()
23 }
24 pub fn stage(&self) -> ::std::option::Option<&crate::types::FunctionStage> {
26 self.stage.as_ref()
27 }
28 pub fn event_object(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
30 self.event_object.as_ref()
31 }
32}
33impl ::std::fmt::Debug for TestFunctionInput {
34 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
35 let 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 pub fn builder() -> crate::operation::test_function::builders::TestFunctionInputBuilder {
46 crate::operation::test_function::builders::TestFunctionInputBuilder::default()
47 }
48}
49
50#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
52#[non_exhaustive]
53pub struct TestFunctionInputBuilder {
54 pub(crate) name: ::std::option::Option<::std::string::String>,
55 pub(crate) if_match: ::std::option::Option<::std::string::String>,
56 pub(crate) stage: ::std::option::Option<crate::types::FunctionStage>,
57 pub(crate) event_object: ::std::option::Option<::aws_smithy_types::Blob>,
58}
59impl TestFunctionInputBuilder {
60 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68 self.name = input;
69 self
70 }
71 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
73 &self.name
74 }
75 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 pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83 self.if_match = input;
84 self
85 }
86 pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> {
88 &self.if_match
89 }
90 pub fn stage(mut self, input: crate::types::FunctionStage) -> Self {
92 self.stage = ::std::option::Option::Some(input);
93 self
94 }
95 pub fn set_stage(mut self, input: ::std::option::Option<crate::types::FunctionStage>) -> Self {
97 self.stage = input;
98 self
99 }
100 pub fn get_stage(&self) -> &::std::option::Option<crate::types::FunctionStage> {
102 &self.stage
103 }
104 pub fn event_object(mut self, input: ::aws_smithy_types::Blob) -> Self {
107 self.event_object = ::std::option::Option::Some(input);
108 self
109 }
110 pub fn set_event_object(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
112 self.event_object = input;
113 self
114 }
115 pub fn get_event_object(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
117 &self.event_object
118 }
119 pub fn build(
121 self,
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 {
132 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
133 let 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}