Struct aws_sdk_apigatewayv2::model::cors::Builder
source · pub struct Builder { /* private fields */ }Expand description
A builder for Cors.
Implementations§
source§impl Builder
impl Builder
sourcepub fn allow_credentials(self, input: bool) -> Self
pub fn allow_credentials(self, input: bool) -> Self
Specifies whether credentials are included in the CORS request. Supported only for HTTP APIs.
sourcepub fn set_allow_credentials(self, input: Option<bool>) -> Self
pub fn set_allow_credentials(self, input: Option<bool>) -> Self
Specifies whether credentials are included in the CORS request. Supported only for HTTP APIs.
Examples found in repository?
5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677
pub(crate) fn deser_structure_crate_model_cors<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::Cors>, aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::cors::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"allowCredentials" => {
builder = builder.set_allow_credentials(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"allowHeaders" => {
builder = builder.set_allow_headers(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_header_list(tokens)?
);
}
"allowMethods" => {
builder = builder.set_allow_methods(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_method_list(tokens)?
);
}
"allowOrigins" => {
builder = builder.set_allow_origins(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_origin_list(tokens)?
);
}
"exposeHeaders" => {
builder = builder.set_expose_headers(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_header_list(tokens)?
);
}
"maxAge" => {
builder = builder.set_max_age(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}sourcepub fn allow_headers(self, input: impl Into<String>) -> Self
pub fn allow_headers(self, input: impl Into<String>) -> Self
Appends an item to allow_headers.
To override the contents of this collection use set_allow_headers.
Represents a collection of allowed headers. Supported only for HTTP APIs.
sourcepub fn set_allow_headers(self, input: Option<Vec<String>>) -> Self
pub fn set_allow_headers(self, input: Option<Vec<String>>) -> Self
Represents a collection of allowed headers. Supported only for HTTP APIs.
Examples found in repository?
5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677
pub(crate) fn deser_structure_crate_model_cors<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::Cors>, aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::cors::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"allowCredentials" => {
builder = builder.set_allow_credentials(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"allowHeaders" => {
builder = builder.set_allow_headers(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_header_list(tokens)?
);
}
"allowMethods" => {
builder = builder.set_allow_methods(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_method_list(tokens)?
);
}
"allowOrigins" => {
builder = builder.set_allow_origins(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_origin_list(tokens)?
);
}
"exposeHeaders" => {
builder = builder.set_expose_headers(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_header_list(tokens)?
);
}
"maxAge" => {
builder = builder.set_max_age(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}sourcepub fn allow_methods(self, input: impl Into<String>) -> Self
pub fn allow_methods(self, input: impl Into<String>) -> Self
Appends an item to allow_methods.
To override the contents of this collection use set_allow_methods.
Represents a collection of allowed HTTP methods. Supported only for HTTP APIs.
sourcepub fn set_allow_methods(self, input: Option<Vec<String>>) -> Self
pub fn set_allow_methods(self, input: Option<Vec<String>>) -> Self
Represents a collection of allowed HTTP methods. Supported only for HTTP APIs.
Examples found in repository?
5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677
pub(crate) fn deser_structure_crate_model_cors<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::Cors>, aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::cors::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"allowCredentials" => {
builder = builder.set_allow_credentials(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"allowHeaders" => {
builder = builder.set_allow_headers(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_header_list(tokens)?
);
}
"allowMethods" => {
builder = builder.set_allow_methods(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_method_list(tokens)?
);
}
"allowOrigins" => {
builder = builder.set_allow_origins(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_origin_list(tokens)?
);
}
"exposeHeaders" => {
builder = builder.set_expose_headers(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_header_list(tokens)?
);
}
"maxAge" => {
builder = builder.set_max_age(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}sourcepub fn allow_origins(self, input: impl Into<String>) -> Self
pub fn allow_origins(self, input: impl Into<String>) -> Self
Appends an item to allow_origins.
To override the contents of this collection use set_allow_origins.
Represents a collection of allowed origins. Supported only for HTTP APIs.
sourcepub fn set_allow_origins(self, input: Option<Vec<String>>) -> Self
pub fn set_allow_origins(self, input: Option<Vec<String>>) -> Self
Represents a collection of allowed origins. Supported only for HTTP APIs.
Examples found in repository?
5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677
pub(crate) fn deser_structure_crate_model_cors<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::Cors>, aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::cors::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"allowCredentials" => {
builder = builder.set_allow_credentials(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"allowHeaders" => {
builder = builder.set_allow_headers(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_header_list(tokens)?
);
}
"allowMethods" => {
builder = builder.set_allow_methods(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_method_list(tokens)?
);
}
"allowOrigins" => {
builder = builder.set_allow_origins(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_origin_list(tokens)?
);
}
"exposeHeaders" => {
builder = builder.set_expose_headers(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_header_list(tokens)?
);
}
"maxAge" => {
builder = builder.set_max_age(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}sourcepub fn expose_headers(self, input: impl Into<String>) -> Self
pub fn expose_headers(self, input: impl Into<String>) -> Self
Appends an item to expose_headers.
To override the contents of this collection use set_expose_headers.
Represents a collection of exposed headers. Supported only for HTTP APIs.
sourcepub fn set_expose_headers(self, input: Option<Vec<String>>) -> Self
pub fn set_expose_headers(self, input: Option<Vec<String>>) -> Self
Represents a collection of exposed headers. Supported only for HTTP APIs.
Examples found in repository?
5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677
pub(crate) fn deser_structure_crate_model_cors<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::Cors>, aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::cors::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"allowCredentials" => {
builder = builder.set_allow_credentials(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"allowHeaders" => {
builder = builder.set_allow_headers(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_header_list(tokens)?
);
}
"allowMethods" => {
builder = builder.set_allow_methods(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_method_list(tokens)?
);
}
"allowOrigins" => {
builder = builder.set_allow_origins(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_origin_list(tokens)?
);
}
"exposeHeaders" => {
builder = builder.set_expose_headers(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_header_list(tokens)?
);
}
"maxAge" => {
builder = builder.set_max_age(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}sourcepub fn max_age(self, input: i32) -> Self
pub fn max_age(self, input: i32) -> Self
The number of seconds that the browser should cache preflight request results. Supported only for HTTP APIs.
sourcepub fn set_max_age(self, input: Option<i32>) -> Self
pub fn set_max_age(self, input: Option<i32>) -> Self
The number of seconds that the browser should cache preflight request results. Supported only for HTTP APIs.
Examples found in repository?
5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677
pub(crate) fn deser_structure_crate_model_cors<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::Cors>, aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::cors::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"allowCredentials" => {
builder = builder.set_allow_credentials(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"allowHeaders" => {
builder = builder.set_allow_headers(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_header_list(tokens)?
);
}
"allowMethods" => {
builder = builder.set_allow_methods(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_method_list(tokens)?
);
}
"allowOrigins" => {
builder = builder.set_allow_origins(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_origin_list(tokens)?
);
}
"exposeHeaders" => {
builder = builder.set_expose_headers(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_header_list(tokens)?
);
}
"maxAge" => {
builder = builder.set_max_age(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}sourcepub fn build(self) -> Cors
pub fn build(self) -> Cors
Consumes the builder and constructs a Cors.
Examples found in repository?
5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677
pub(crate) fn deser_structure_crate_model_cors<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::Cors>, aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::cors::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"allowCredentials" => {
builder = builder.set_allow_credentials(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"allowHeaders" => {
builder = builder.set_allow_headers(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_header_list(tokens)?
);
}
"allowMethods" => {
builder = builder.set_allow_methods(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_method_list(tokens)?
);
}
"allowOrigins" => {
builder = builder.set_allow_origins(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_origin_list(tokens)?
);
}
"exposeHeaders" => {
builder = builder.set_expose_headers(
crate::json_deser::deser_list_com_amazonaws_apigatewayv2_cors_header_list(tokens)?
);
}
"maxAge" => {
builder = builder.set_max_age(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}