#[non_exhaustive]pub struct CustomErrorResponsePolicyCustomErrorResponseRule {
pub match_response_codes: Vec<String>,
pub override_response_code: Option<i32>,
pub path: Option<String>,
/* private fields */
}region-url-maps or url-maps only.Expand description
Specifies the mapping between the response code that will be returned along with the custom error content and the response code returned by the backend service.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.match_response_codes: Vec<String>Valid values include:
- A number between 400 and 599: For example
401 or 503, in which case the load balancer
applies the policy if the error code exactly matches this value.
- 5xx: Load Balancer will apply the policy if the
backend service responds with any response code in the range of
500 to 599.- 4xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 400 to 499.
Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy.
override_response_code: Option<i32>The HTTP status code returned with the response containing the custom error content. If overrideResponseCode is not supplied, the same response code returned by the original backend bucket or backend service is returned to the client.
path: Option<String>The full path to a file within backendBucket . For example:/errors/defaultError.html
path must start with a leading slash. path cannot have trailing slashes.
If the file is not available in backendBucket or the load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client.
The value must be from 1 to 1024 characters
Implementations§
Source§impl CustomErrorResponsePolicyCustomErrorResponseRule
impl CustomErrorResponsePolicyCustomErrorResponseRule
pub fn new() -> Self
Sourcepub fn set_match_response_codes<T, V>(self, v: T) -> Self
pub fn set_match_response_codes<T, V>(self, v: T) -> Self
Sets the value of match_response_codes.
§Example
let x = CustomErrorResponsePolicyCustomErrorResponseRule::new().set_match_response_codes(["a", "b", "c"]);Sourcepub fn set_override_response_code<T>(self, v: T) -> Self
pub fn set_override_response_code<T>(self, v: T) -> Self
Sets the value of override_response_code.
§Example
let x = CustomErrorResponsePolicyCustomErrorResponseRule::new().set_override_response_code(42);Sourcepub fn set_or_clear_override_response_code<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_override_response_code<T>(self, v: Option<T>) -> Self
Sets or clears the value of override_response_code.
§Example
let x = CustomErrorResponsePolicyCustomErrorResponseRule::new().set_or_clear_override_response_code(Some(42));
let x = CustomErrorResponsePolicyCustomErrorResponseRule::new().set_or_clear_override_response_code(None::<i32>);Sourcepub fn set_or_clear_path<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_path<T>(self, v: Option<T>) -> Self
Trait Implementations§
Source§impl Clone for CustomErrorResponsePolicyCustomErrorResponseRule
impl Clone for CustomErrorResponsePolicyCustomErrorResponseRule
Source§fn clone(&self) -> CustomErrorResponsePolicyCustomErrorResponseRule
fn clone(&self) -> CustomErrorResponsePolicyCustomErrorResponseRule
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for CustomErrorResponsePolicyCustomErrorResponseRule
impl Default for CustomErrorResponsePolicyCustomErrorResponseRule
Source§fn default() -> CustomErrorResponsePolicyCustomErrorResponseRule
fn default() -> CustomErrorResponsePolicyCustomErrorResponseRule
Source§impl PartialEq for CustomErrorResponsePolicyCustomErrorResponseRule
impl PartialEq for CustomErrorResponsePolicyCustomErrorResponseRule
Source§fn eq(&self, other: &CustomErrorResponsePolicyCustomErrorResponseRule) -> bool
fn eq(&self, other: &CustomErrorResponsePolicyCustomErrorResponseRule) -> bool
self and other values to be equal, and is used by ==.