Struct aws_sdk_apigateway::types::builders::MethodResponseBuilder
source · #[non_exhaustive]pub struct MethodResponseBuilder { /* private fields */ }
Expand description
A builder for MethodResponse
.
Implementations§
source§impl MethodResponseBuilder
impl MethodResponseBuilder
sourcepub fn status_code(self, input: impl Into<String>) -> Self
pub fn status_code(self, input: impl Into<String>) -> Self
The method response's status code.
sourcepub fn set_status_code(self, input: Option<String>) -> Self
pub fn set_status_code(self, input: Option<String>) -> Self
The method response's status code.
sourcepub fn get_status_code(&self) -> &Option<String>
pub fn get_status_code(&self) -> &Option<String>
The method response's status code.
sourcepub fn response_parameters(self, k: impl Into<String>, v: bool) -> Self
pub fn response_parameters(self, k: impl Into<String>, v: bool) -> Self
Adds a key-value pair to response_parameters
.
To override the contents of this collection use set_response_parameters
.
A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern method.response.header.{name}
, where name
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed in integration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g., 'application/json'
), or a JSON expression from the back-end response payload in the form of integration.response.body.{JSON-expression}
, where JSON-expression
is a valid JSON expression without the $
prefix.)
sourcepub fn set_response_parameters(
self,
input: Option<HashMap<String, bool>>
) -> Self
pub fn set_response_parameters( self, input: Option<HashMap<String, bool>> ) -> Self
A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern method.response.header.{name}
, where name
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed in integration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g., 'application/json'
), or a JSON expression from the back-end response payload in the form of integration.response.body.{JSON-expression}
, where JSON-expression
is a valid JSON expression without the $
prefix.)
sourcepub fn get_response_parameters(&self) -> &Option<HashMap<String, bool>>
pub fn get_response_parameters(&self) -> &Option<HashMap<String, bool>>
A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern method.response.header.{name}
, where name
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed in integration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g., 'application/json'
), or a JSON expression from the back-end response payload in the form of integration.response.body.{JSON-expression}
, where JSON-expression
is a valid JSON expression without the $
prefix.)
sourcepub fn response_models(self, k: impl Into<String>, v: impl Into<String>) -> Self
pub fn response_models(self, k: impl Into<String>, v: impl Into<String>) -> Self
Adds a key-value pair to response_models
.
To override the contents of this collection use set_response_models
.
Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
sourcepub fn set_response_models(self, input: Option<HashMap<String, String>>) -> Self
pub fn set_response_models(self, input: Option<HashMap<String, String>>) -> Self
Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
sourcepub fn get_response_models(&self) -> &Option<HashMap<String, String>>
pub fn get_response_models(&self) -> &Option<HashMap<String, String>>
Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
sourcepub fn build(self) -> MethodResponse
pub fn build(self) -> MethodResponse
Consumes the builder and constructs a MethodResponse
.
Trait Implementations§
source§impl Clone for MethodResponseBuilder
impl Clone for MethodResponseBuilder
source§fn clone(&self) -> MethodResponseBuilder
fn clone(&self) -> MethodResponseBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MethodResponseBuilder
impl Debug for MethodResponseBuilder
source§impl Default for MethodResponseBuilder
impl Default for MethodResponseBuilder
source§fn default() -> MethodResponseBuilder
fn default() -> MethodResponseBuilder
source§impl PartialEq<MethodResponseBuilder> for MethodResponseBuilder
impl PartialEq<MethodResponseBuilder> for MethodResponseBuilder
source§fn eq(&self, other: &MethodResponseBuilder) -> bool
fn eq(&self, other: &MethodResponseBuilder) -> bool
self
and other
values to be equal, and is used
by ==
.