pub struct Builder { /* private fields */ }
Expand description
A builder for LambdaFunctionAssociation
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn lambda_function_arn(self, input: impl Into<String>) -> Self
pub fn lambda_function_arn(self, input: impl Into<String>) -> Self
The ARN of the Lambda@Edge function. You must specify the ARN of a function version; you can't specify an alias or $LATEST.
sourcepub fn set_lambda_function_arn(self, input: Option<String>) -> Self
pub fn set_lambda_function_arn(self, input: Option<String>) -> Self
The ARN of the Lambda@Edge function. You must specify the ARN of a function version; you can't specify an alias or $LATEST.
Examples found in repository?
15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231
pub fn deser_structure_crate_model_lambda_function_association(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::LambdaFunctionAssociation, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::LambdaFunctionAssociation::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("LambdaFunctionARN") /* LambdaFunctionARN com.amazonaws.cloudfront#LambdaFunctionAssociation$LambdaFunctionARN */ => {
let var_645 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_lambda_function_arn(var_645);
}
,
s if s.matches("EventType") /* EventType com.amazonaws.cloudfront#LambdaFunctionAssociation$EventType */ => {
let var_646 =
Some(
Result::<crate::model::EventType, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::EventType::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_event_type(var_646);
}
,
s if s.matches("IncludeBody") /* IncludeBody com.amazonaws.cloudfront#LambdaFunctionAssociation$IncludeBody */ => {
let var_647 =
Some(
{
<bool as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.cloudfront#boolean`)"))
}
?
)
;
builder = builder.set_include_body(var_647);
}
,
_ => {}
}
}
Ok(builder.build())
}
sourcepub fn event_type(self, input: EventType) -> Self
pub fn event_type(self, input: EventType) -> Self
Specifies the event type that triggers a Lambda@Edge function invocation. You can specify the following values:
-
viewer-request
: The function executes when CloudFront receives a request from a viewer and before it checks to see whether the requested object is in the edge cache. -
origin-request
: The function executes only when CloudFront sends a request to your origin. When the requested object is in the edge cache, the function doesn't execute. -
origin-response
: The function executes after CloudFront receives a response from the origin and before it caches the object in the response. When the requested object is in the edge cache, the function doesn't execute. -
viewer-response
: The function executes before CloudFront returns the requested object to the viewer. The function executes regardless of whether the object was already in the edge cache.If the origin returns an HTTP status code other than HTTP 200 (OK), the function doesn't execute.
sourcepub fn set_event_type(self, input: Option<EventType>) -> Self
pub fn set_event_type(self, input: Option<EventType>) -> Self
Specifies the event type that triggers a Lambda@Edge function invocation. You can specify the following values:
-
viewer-request
: The function executes when CloudFront receives a request from a viewer and before it checks to see whether the requested object is in the edge cache. -
origin-request
: The function executes only when CloudFront sends a request to your origin. When the requested object is in the edge cache, the function doesn't execute. -
origin-response
: The function executes after CloudFront receives a response from the origin and before it caches the object in the response. When the requested object is in the edge cache, the function doesn't execute. -
viewer-response
: The function executes before CloudFront returns the requested object to the viewer. The function executes regardless of whether the object was already in the edge cache.If the origin returns an HTTP status code other than HTTP 200 (OK), the function doesn't execute.
Examples found in repository?
15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231
pub fn deser_structure_crate_model_lambda_function_association(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::LambdaFunctionAssociation, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::LambdaFunctionAssociation::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("LambdaFunctionARN") /* LambdaFunctionARN com.amazonaws.cloudfront#LambdaFunctionAssociation$LambdaFunctionARN */ => {
let var_645 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_lambda_function_arn(var_645);
}
,
s if s.matches("EventType") /* EventType com.amazonaws.cloudfront#LambdaFunctionAssociation$EventType */ => {
let var_646 =
Some(
Result::<crate::model::EventType, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::EventType::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_event_type(var_646);
}
,
s if s.matches("IncludeBody") /* IncludeBody com.amazonaws.cloudfront#LambdaFunctionAssociation$IncludeBody */ => {
let var_647 =
Some(
{
<bool as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.cloudfront#boolean`)"))
}
?
)
;
builder = builder.set_include_body(var_647);
}
,
_ => {}
}
}
Ok(builder.build())
}
sourcepub fn include_body(self, input: bool) -> Self
pub fn include_body(self, input: bool) -> Self
A flag that allows a Lambda@Edge function to have read access to the body content. For more information, see Accessing the Request Body by Choosing the Include Body Option in the Amazon CloudFront Developer Guide.
sourcepub fn set_include_body(self, input: Option<bool>) -> Self
pub fn set_include_body(self, input: Option<bool>) -> Self
A flag that allows a Lambda@Edge function to have read access to the body content. For more information, see Accessing the Request Body by Choosing the Include Body Option in the Amazon CloudFront Developer Guide.
Examples found in repository?
15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231
pub fn deser_structure_crate_model_lambda_function_association(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::LambdaFunctionAssociation, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::LambdaFunctionAssociation::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("LambdaFunctionARN") /* LambdaFunctionARN com.amazonaws.cloudfront#LambdaFunctionAssociation$LambdaFunctionARN */ => {
let var_645 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_lambda_function_arn(var_645);
}
,
s if s.matches("EventType") /* EventType com.amazonaws.cloudfront#LambdaFunctionAssociation$EventType */ => {
let var_646 =
Some(
Result::<crate::model::EventType, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::EventType::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_event_type(var_646);
}
,
s if s.matches("IncludeBody") /* IncludeBody com.amazonaws.cloudfront#LambdaFunctionAssociation$IncludeBody */ => {
let var_647 =
Some(
{
<bool as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.cloudfront#boolean`)"))
}
?
)
;
builder = builder.set_include_body(var_647);
}
,
_ => {}
}
}
Ok(builder.build())
}
sourcepub fn build(self) -> LambdaFunctionAssociation
pub fn build(self) -> LambdaFunctionAssociation
Consumes the builder and constructs a LambdaFunctionAssociation
.
Examples found in repository?
15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231
pub fn deser_structure_crate_model_lambda_function_association(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::LambdaFunctionAssociation, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::LambdaFunctionAssociation::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("LambdaFunctionARN") /* LambdaFunctionARN com.amazonaws.cloudfront#LambdaFunctionAssociation$LambdaFunctionARN */ => {
let var_645 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_lambda_function_arn(var_645);
}
,
s if s.matches("EventType") /* EventType com.amazonaws.cloudfront#LambdaFunctionAssociation$EventType */ => {
let var_646 =
Some(
Result::<crate::model::EventType, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::EventType::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_event_type(var_646);
}
,
s if s.matches("IncludeBody") /* IncludeBody com.amazonaws.cloudfront#LambdaFunctionAssociation$IncludeBody */ => {
let var_647 =
Some(
{
<bool as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.cloudfront#boolean`)"))
}
?
)
;
builder = builder.set_include_body(var_647);
}
,
_ => {}
}
}
Ok(builder.build())
}