Struct rusoto_apigateway::GatewayResponse
source · [−]pub struct GatewayResponse {
pub default_response: Option<bool>,
pub response_parameters: Option<HashMap<String, String>>,
pub response_templates: Option<HashMap<String, String>>,
pub response_type: Option<String>,
pub status_code: Option<String>,
}
Expand description
A gateway response of a given response type and status code, with optional response parameters and mapping templates.
Example: Get a Gateway Response of a given response type
Request
This example shows how to get a gateway response of the MISSINGAUTHENTICATIONTOKEN
type.
GET /restapis/o81lxisefl/gatewayresponses/MISSINGAUTHENTICATIONTOKEN HTTP/1.1 Host: beta-apigateway.us-east-1.amazonaws.com Content-Type: application/json X-Amz-Date: 20170503T202516Z Authorization: AWS4-HMAC-SHA256 Credential={access-key-id}/20170503/us-east-1/apigateway/aws4request, SignedHeaders=content-type;host;x-amz-date, Signature=1b52460e3159c1a26cff29093855d50ea141c1c5b937528fecaf60f51129697a Cache-Control: no-cache Postman-Token: 3b2a1ce9-c848-2e26-2e2f-9c2caefbed45
The response type is specified as a URL path.
Response
The successful operation returns the 200 OK
status code and a payload similar to the following:
{ "links": { "curies": { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-gatewayresponse-{rel}.html", "name": "gatewayresponse", "templated": true }, "self": { "href": "/restapis/o81lxisefl/gatewayresponses/MISSINGAUTHENTICATIONTOKEN" }, "gatewayresponse:delete": { "href": "/restapis/o81lxisefl/gatewayresponses/MISSINGAUTHENTICATIONTOKEN" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{responsetype}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/MISSINGAUTHENTICATIONTOKEN" } }, "defaultResponse": false, "responseParameters": { "gatewayresponse.header.x-request-path": "method.request.path.petId", "gatewayresponse.header.Access-Control-Allow-Origin": "'a.b.c'", "gatewayresponse.header.x-request-query": "method.request.querystring.q", "gatewayresponse.header.x-request-header": "method.request.header.Accept" }, "responseTemplates": { "application/json": "{\n "message": $context.error.messageString,\n "type": "$context.error.responseType",\n "stage": "$context.stage",\n "resourcePath": "$context.resourcePath",\n "stageVariables.a": "$stageVariables.a",\n "statusCode": "'404'"\n}" }, "responseType": "MISSINGAUTHENTICATION_TOKEN", "statusCode": "404" }
Fields
default_response: Option<bool>
A Boolean flag to indicate whether this GatewayResponse is the default gateway response (true
) or not (false
). A default gateway response is one generated by API Gateway without any customization by an API developer.
response_parameters: Option<HashMap<String, String>>
Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
response_templates: Option<HashMap<String, String>>
Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
response_type: Option<String>
The response type of the associated GatewayResponse. Valid values are
- ACCESS_DENIED
- API_CONFIGURATION_ERROR
- AUTHORIZER_FAILURE
- AUTHORIZER_CONFIGURATION_ERROR
- BAD_REQUEST_PARAMETERS
- BAD_REQUEST_BODY
- DEFAULT_4XX
- DEFAULT_5XX
- EXPIRED_TOKEN
- INVALID_SIGNATURE
- INTEGRATION_FAILURE
- INTEGRATION_TIMEOUT
- INVALID_API_KEY
- MISSING_AUTHENTICATION_TOKEN
- QUOTA_EXCEEDED
- REQUEST_TOO_LARGE
- RESOURCE_NOT_FOUND
- THROTTLED
- UNAUTHORIZED
- UNSUPPORTED_MEDIA_TYPE
status_code: Option<String>
The HTTP status code for this GatewayResponse.
Trait Implementations
sourceimpl Clone for GatewayResponse
impl Clone for GatewayResponse
sourcefn clone(&self) -> GatewayResponse
fn clone(&self) -> GatewayResponse
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for GatewayResponse
impl Debug for GatewayResponse
sourceimpl Default for GatewayResponse
impl Default for GatewayResponse
sourcefn default() -> GatewayResponse
fn default() -> GatewayResponse
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for GatewayResponse
impl<'de> Deserialize<'de> for GatewayResponse
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<GatewayResponse> for GatewayResponse
impl PartialEq<GatewayResponse> for GatewayResponse
sourcefn eq(&self, other: &GatewayResponse) -> bool
fn eq(&self, other: &GatewayResponse) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &GatewayResponse) -> bool
fn ne(&self, other: &GatewayResponse) -> bool
This method tests for !=
.
impl StructuralPartialEq for GatewayResponse
Auto Trait Implementations
impl RefUnwindSafe for GatewayResponse
impl Send for GatewayResponse
impl Sync for GatewayResponse
impl Unpin for GatewayResponse
impl UnwindSafe for GatewayResponse
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more