Struct aws_sdk_wafv2::types::builders::CustomResponseBuilder
source · #[non_exhaustive]pub struct CustomResponseBuilder { /* private fields */ }
Expand description
A builder for CustomResponse
.
Implementations§
source§impl CustomResponseBuilder
impl CustomResponseBuilder
sourcepub fn response_code(self, input: i32) -> Self
pub fn response_code(self, input: i32) -> Self
The HTTP status code to return to the client.
For a list of status codes that you can use in your custom responses, see Supported status codes for custom response in the WAF Developer Guide.
This field is required.sourcepub fn set_response_code(self, input: Option<i32>) -> Self
pub fn set_response_code(self, input: Option<i32>) -> Self
The HTTP status code to return to the client.
For a list of status codes that you can use in your custom responses, see Supported status codes for custom response in the WAF Developer Guide.
sourcepub fn get_response_code(&self) -> &Option<i32>
pub fn get_response_code(&self) -> &Option<i32>
The HTTP status code to return to the client.
For a list of status codes that you can use in your custom responses, see Supported status codes for custom response in the WAF Developer Guide.
sourcepub fn custom_response_body_key(self, input: impl Into<String>) -> Self
pub fn custom_response_body_key(self, input: impl Into<String>) -> Self
References the response body that you want WAF to return to the web request client. You can define a custom response for a rule action or a default web ACL action that is set to block. To do this, you first define the response body key and value in the CustomResponseBodies
setting for the WebACL
or RuleGroup
where you want to use it. Then, in the rule action or web ACL default action BlockAction
setting, you reference the response body using this key.
sourcepub fn set_custom_response_body_key(self, input: Option<String>) -> Self
pub fn set_custom_response_body_key(self, input: Option<String>) -> Self
References the response body that you want WAF to return to the web request client. You can define a custom response for a rule action or a default web ACL action that is set to block. To do this, you first define the response body key and value in the CustomResponseBodies
setting for the WebACL
or RuleGroup
where you want to use it. Then, in the rule action or web ACL default action BlockAction
setting, you reference the response body using this key.
sourcepub fn get_custom_response_body_key(&self) -> &Option<String>
pub fn get_custom_response_body_key(&self) -> &Option<String>
References the response body that you want WAF to return to the web request client. You can define a custom response for a rule action or a default web ACL action that is set to block. To do this, you first define the response body key and value in the CustomResponseBodies
setting for the WebACL
or RuleGroup
where you want to use it. Then, in the rule action or web ACL default action BlockAction
setting, you reference the response body using this key.
sourcepub fn response_headers(self, input: CustomHttpHeader) -> Self
pub fn response_headers(self, input: CustomHttpHeader) -> Self
Appends an item to response_headers
.
To override the contents of this collection use set_response_headers
.
The HTTP headers to use in the response. You can specify any header name except for content-type
. Duplicate header names are not allowed.
For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.
sourcepub fn set_response_headers(self, input: Option<Vec<CustomHttpHeader>>) -> Self
pub fn set_response_headers(self, input: Option<Vec<CustomHttpHeader>>) -> Self
The HTTP headers to use in the response. You can specify any header name except for content-type
. Duplicate header names are not allowed.
For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.
sourcepub fn get_response_headers(&self) -> &Option<Vec<CustomHttpHeader>>
pub fn get_response_headers(&self) -> &Option<Vec<CustomHttpHeader>>
The HTTP headers to use in the response. You can specify any header name except for content-type
. Duplicate header names are not allowed.
For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.
sourcepub fn build(self) -> Result<CustomResponse, BuildError>
pub fn build(self) -> Result<CustomResponse, BuildError>
Consumes the builder and constructs a CustomResponse
.
This method will fail if any of the following fields are not set:
Trait Implementations§
source§impl Clone for CustomResponseBuilder
impl Clone for CustomResponseBuilder
source§fn clone(&self) -> CustomResponseBuilder
fn clone(&self) -> CustomResponseBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CustomResponseBuilder
impl Debug for CustomResponseBuilder
source§impl Default for CustomResponseBuilder
impl Default for CustomResponseBuilder
source§fn default() -> CustomResponseBuilder
fn default() -> CustomResponseBuilder
source§impl PartialEq for CustomResponseBuilder
impl PartialEq for CustomResponseBuilder
source§fn eq(&self, other: &CustomResponseBuilder) -> bool
fn eq(&self, other: &CustomResponseBuilder) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for CustomResponseBuilder
Auto Trait Implementations§
impl Freeze for CustomResponseBuilder
impl RefUnwindSafe for CustomResponseBuilder
impl Send for CustomResponseBuilder
impl Sync for CustomResponseBuilder
impl Unpin for CustomResponseBuilder
impl UnwindSafe for CustomResponseBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more