Struct aws_sdk_securityhub::model::aws_cors_configuration::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for AwsCorsConfiguration
.
Implementations§
source§impl Builder
impl Builder
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
.
The allowed origins for CORS requests.
sourcepub fn set_allow_origins(self, input: Option<Vec<String>>) -> Self
pub fn set_allow_origins(self, input: Option<Vec<String>>) -> Self
The allowed origins for CORS requests.
Examples found in repository?
24953 24954 24955 24956 24957 24958 24959 24960 24961 24962 24963 24964 24965 24966 24967 24968 24969 24970 24971 24972 24973 24974 24975 24976 24977 24978 24979 24980 24981 24982 24983 24984 24985 24986 24987 24988 24989 24990 24991 24992 24993 24994 24995 24996 24997 24998 24999 25000 25001 25002 25003 25004 25005 25006 25007 25008 25009 25010 25011 25012 25013 25014 25015 25016 25017 25018 25019 25020 25021 25022 25023 25024 25025 25026 25027 25028 25029 25030 25031 25032 25033 25034
pub(crate) fn deser_structure_crate_model_aws_cors_configuration<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AwsCorsConfiguration>,
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::aws_cors_configuration::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() {
"AllowOrigins" => {
builder = builder.set_allow_origins(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"AllowCredentials" => {
builder = builder.set_allow_credentials(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"ExposeHeaders" => {
builder = builder.set_expose_headers(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"MaxAge" => {
builder = builder.set_max_age(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"AllowMethods" => {
builder = builder.set_allow_methods(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"AllowHeaders" => {
builder = builder.set_allow_headers(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
_ => 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_credentials(self, input: bool) -> Self
pub fn allow_credentials(self, input: bool) -> Self
Indicates whether the CORS request includes credentials.
sourcepub fn set_allow_credentials(self, input: Option<bool>) -> Self
pub fn set_allow_credentials(self, input: Option<bool>) -> Self
Indicates whether the CORS request includes credentials.
Examples found in repository?
24953 24954 24955 24956 24957 24958 24959 24960 24961 24962 24963 24964 24965 24966 24967 24968 24969 24970 24971 24972 24973 24974 24975 24976 24977 24978 24979 24980 24981 24982 24983 24984 24985 24986 24987 24988 24989 24990 24991 24992 24993 24994 24995 24996 24997 24998 24999 25000 25001 25002 25003 25004 25005 25006 25007 25008 25009 25010 25011 25012 25013 25014 25015 25016 25017 25018 25019 25020 25021 25022 25023 25024 25025 25026 25027 25028 25029 25030 25031 25032 25033 25034
pub(crate) fn deser_structure_crate_model_aws_cors_configuration<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AwsCorsConfiguration>,
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::aws_cors_configuration::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() {
"AllowOrigins" => {
builder = builder.set_allow_origins(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"AllowCredentials" => {
builder = builder.set_allow_credentials(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"ExposeHeaders" => {
builder = builder.set_expose_headers(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"MaxAge" => {
builder = builder.set_max_age(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"AllowMethods" => {
builder = builder.set_allow_methods(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"AllowHeaders" => {
builder = builder.set_allow_headers(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
_ => 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
.
The exposed headers for CORS requests.
sourcepub fn set_expose_headers(self, input: Option<Vec<String>>) -> Self
pub fn set_expose_headers(self, input: Option<Vec<String>>) -> Self
The exposed headers for CORS requests.
Examples found in repository?
24953 24954 24955 24956 24957 24958 24959 24960 24961 24962 24963 24964 24965 24966 24967 24968 24969 24970 24971 24972 24973 24974 24975 24976 24977 24978 24979 24980 24981 24982 24983 24984 24985 24986 24987 24988 24989 24990 24991 24992 24993 24994 24995 24996 24997 24998 24999 25000 25001 25002 25003 25004 25005 25006 25007 25008 25009 25010 25011 25012 25013 25014 25015 25016 25017 25018 25019 25020 25021 25022 25023 25024 25025 25026 25027 25028 25029 25030 25031 25032 25033 25034
pub(crate) fn deser_structure_crate_model_aws_cors_configuration<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AwsCorsConfiguration>,
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::aws_cors_configuration::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() {
"AllowOrigins" => {
builder = builder.set_allow_origins(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"AllowCredentials" => {
builder = builder.set_allow_credentials(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"ExposeHeaders" => {
builder = builder.set_expose_headers(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"MaxAge" => {
builder = builder.set_max_age(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"AllowMethods" => {
builder = builder.set_allow_methods(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"AllowHeaders" => {
builder = builder.set_allow_headers(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
_ => 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 for which the browser caches preflight request results.
sourcepub fn set_max_age(self, input: Option<i32>) -> Self
pub fn set_max_age(self, input: Option<i32>) -> Self
The number of seconds for which the browser caches preflight request results.
Examples found in repository?
24953 24954 24955 24956 24957 24958 24959 24960 24961 24962 24963 24964 24965 24966 24967 24968 24969 24970 24971 24972 24973 24974 24975 24976 24977 24978 24979 24980 24981 24982 24983 24984 24985 24986 24987 24988 24989 24990 24991 24992 24993 24994 24995 24996 24997 24998 24999 25000 25001 25002 25003 25004 25005 25006 25007 25008 25009 25010 25011 25012 25013 25014 25015 25016 25017 25018 25019 25020 25021 25022 25023 25024 25025 25026 25027 25028 25029 25030 25031 25032 25033 25034
pub(crate) fn deser_structure_crate_model_aws_cors_configuration<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AwsCorsConfiguration>,
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::aws_cors_configuration::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() {
"AllowOrigins" => {
builder = builder.set_allow_origins(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"AllowCredentials" => {
builder = builder.set_allow_credentials(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"ExposeHeaders" => {
builder = builder.set_expose_headers(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"MaxAge" => {
builder = builder.set_max_age(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"AllowMethods" => {
builder = builder.set_allow_methods(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"AllowHeaders" => {
builder = builder.set_allow_headers(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
_ => 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
.
The allowed methods for CORS requests.
sourcepub fn set_allow_methods(self, input: Option<Vec<String>>) -> Self
pub fn set_allow_methods(self, input: Option<Vec<String>>) -> Self
The allowed methods for CORS requests.
Examples found in repository?
24953 24954 24955 24956 24957 24958 24959 24960 24961 24962 24963 24964 24965 24966 24967 24968 24969 24970 24971 24972 24973 24974 24975 24976 24977 24978 24979 24980 24981 24982 24983 24984 24985 24986 24987 24988 24989 24990 24991 24992 24993 24994 24995 24996 24997 24998 24999 25000 25001 25002 25003 25004 25005 25006 25007 25008 25009 25010 25011 25012 25013 25014 25015 25016 25017 25018 25019 25020 25021 25022 25023 25024 25025 25026 25027 25028 25029 25030 25031 25032 25033 25034
pub(crate) fn deser_structure_crate_model_aws_cors_configuration<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AwsCorsConfiguration>,
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::aws_cors_configuration::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() {
"AllowOrigins" => {
builder = builder.set_allow_origins(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"AllowCredentials" => {
builder = builder.set_allow_credentials(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"ExposeHeaders" => {
builder = builder.set_expose_headers(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"MaxAge" => {
builder = builder.set_max_age(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"AllowMethods" => {
builder = builder.set_allow_methods(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"AllowHeaders" => {
builder = builder.set_allow_headers(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
_ => 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
.
The allowed headers for CORS requests.
sourcepub fn set_allow_headers(self, input: Option<Vec<String>>) -> Self
pub fn set_allow_headers(self, input: Option<Vec<String>>) -> Self
The allowed headers for CORS requests.
Examples found in repository?
24953 24954 24955 24956 24957 24958 24959 24960 24961 24962 24963 24964 24965 24966 24967 24968 24969 24970 24971 24972 24973 24974 24975 24976 24977 24978 24979 24980 24981 24982 24983 24984 24985 24986 24987 24988 24989 24990 24991 24992 24993 24994 24995 24996 24997 24998 24999 25000 25001 25002 25003 25004 25005 25006 25007 25008 25009 25010 25011 25012 25013 25014 25015 25016 25017 25018 25019 25020 25021 25022 25023 25024 25025 25026 25027 25028 25029 25030 25031 25032 25033 25034
pub(crate) fn deser_structure_crate_model_aws_cors_configuration<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AwsCorsConfiguration>,
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::aws_cors_configuration::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() {
"AllowOrigins" => {
builder = builder.set_allow_origins(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"AllowCredentials" => {
builder = builder.set_allow_credentials(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"ExposeHeaders" => {
builder = builder.set_expose_headers(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"MaxAge" => {
builder = builder.set_max_age(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"AllowMethods" => {
builder = builder.set_allow_methods(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"AllowHeaders" => {
builder = builder.set_allow_headers(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
_ => 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) -> AwsCorsConfiguration
pub fn build(self) -> AwsCorsConfiguration
Consumes the builder and constructs a AwsCorsConfiguration
.
Examples found in repository?
24953 24954 24955 24956 24957 24958 24959 24960 24961 24962 24963 24964 24965 24966 24967 24968 24969 24970 24971 24972 24973 24974 24975 24976 24977 24978 24979 24980 24981 24982 24983 24984 24985 24986 24987 24988 24989 24990 24991 24992 24993 24994 24995 24996 24997 24998 24999 25000 25001 25002 25003 25004 25005 25006 25007 25008 25009 25010 25011 25012 25013 25014 25015 25016 25017 25018 25019 25020 25021 25022 25023 25024 25025 25026 25027 25028 25029 25030 25031 25032 25033 25034
pub(crate) fn deser_structure_crate_model_aws_cors_configuration<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AwsCorsConfiguration>,
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::aws_cors_configuration::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() {
"AllowOrigins" => {
builder = builder.set_allow_origins(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"AllowCredentials" => {
builder = builder.set_allow_credentials(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"ExposeHeaders" => {
builder = builder.set_expose_headers(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"MaxAge" => {
builder = builder.set_max_age(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"AllowMethods" => {
builder = builder.set_allow_methods(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
"AllowHeaders" => {
builder = builder.set_allow_headers(
crate::json_deser::deser_list_com_amazonaws_securityhub_non_empty_string_list(tokens)?
);
}
_ => 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",
),
),
}
}