Struct aws_sdk_s3::model::cors_rule::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for CorsRule
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn id(self, input: impl Into<String>) -> Self
pub fn id(self, input: impl Into<String>) -> Self
Unique identifier for the rule. The value cannot be longer than 255 characters.
sourcepub fn set_id(self, input: Option<String>) -> Self
pub fn set_id(self, input: Option<String>) -> Self
Unique identifier for the rule. The value cannot be longer than 255 characters.
Examples found in repository?
3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212
pub fn deser_structure_crate_model_cors_rule(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::CorsRule, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::CorsRule::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("ID") /* ID com.amazonaws.s3#CORSRule$ID */ => {
let var_160 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_id(var_160);
}
,
s if s.matches("AllowedHeader") /* AllowedHeaders com.amazonaws.s3#CORSRule$AllowedHeaders */ => {
let var_161 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_162 = builder.allowed_headers.take().unwrap_or_default();
list_162.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_162
})
?
)
;
builder = builder.set_allowed_headers(var_161);
}
,
s if s.matches("AllowedMethod") /* AllowedMethods com.amazonaws.s3#CORSRule$AllowedMethods */ => {
let var_163 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_164 = builder.allowed_methods.take().unwrap_or_default();
list_164.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_164
})
?
)
;
builder = builder.set_allowed_methods(var_163);
}
,
s if s.matches("AllowedOrigin") /* AllowedOrigins com.amazonaws.s3#CORSRule$AllowedOrigins */ => {
let var_165 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_166 = builder.allowed_origins.take().unwrap_or_default();
list_166.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_166
})
?
)
;
builder = builder.set_allowed_origins(var_165);
}
,
s if s.matches("ExposeHeader") /* ExposeHeaders com.amazonaws.s3#CORSRule$ExposeHeaders */ => {
let var_167 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_168 = builder.expose_headers.take().unwrap_or_default();
list_168.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_168
})
?
)
;
builder = builder.set_expose_headers(var_167);
}
,
s if s.matches("MaxAgeSeconds") /* MaxAgeSeconds com.amazonaws.s3#CORSRule$MaxAgeSeconds */ => {
let var_169 =
Some(
{
<i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.s3#MaxAgeSeconds`)"))
}
?
)
;
builder = builder.set_max_age_seconds(var_169);
}
,
_ => {}
}
}
Ok(builder.build())
}
sourcepub fn allowed_headers(self, input: impl Into<String>) -> Self
pub fn allowed_headers(self, input: impl Into<String>) -> Self
Appends an item to allowed_headers
.
To override the contents of this collection use set_allowed_headers
.
Headers that are specified in the Access-Control-Request-Headers
header. These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed.
sourcepub fn set_allowed_headers(self, input: Option<Vec<String>>) -> Self
pub fn set_allowed_headers(self, input: Option<Vec<String>>) -> Self
Headers that are specified in the Access-Control-Request-Headers
header. These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed.
Examples found in repository?
3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212
pub fn deser_structure_crate_model_cors_rule(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::CorsRule, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::CorsRule::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("ID") /* ID com.amazonaws.s3#CORSRule$ID */ => {
let var_160 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_id(var_160);
}
,
s if s.matches("AllowedHeader") /* AllowedHeaders com.amazonaws.s3#CORSRule$AllowedHeaders */ => {
let var_161 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_162 = builder.allowed_headers.take().unwrap_or_default();
list_162.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_162
})
?
)
;
builder = builder.set_allowed_headers(var_161);
}
,
s if s.matches("AllowedMethod") /* AllowedMethods com.amazonaws.s3#CORSRule$AllowedMethods */ => {
let var_163 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_164 = builder.allowed_methods.take().unwrap_or_default();
list_164.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_164
})
?
)
;
builder = builder.set_allowed_methods(var_163);
}
,
s if s.matches("AllowedOrigin") /* AllowedOrigins com.amazonaws.s3#CORSRule$AllowedOrigins */ => {
let var_165 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_166 = builder.allowed_origins.take().unwrap_or_default();
list_166.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_166
})
?
)
;
builder = builder.set_allowed_origins(var_165);
}
,
s if s.matches("ExposeHeader") /* ExposeHeaders com.amazonaws.s3#CORSRule$ExposeHeaders */ => {
let var_167 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_168 = builder.expose_headers.take().unwrap_or_default();
list_168.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_168
})
?
)
;
builder = builder.set_expose_headers(var_167);
}
,
s if s.matches("MaxAgeSeconds") /* MaxAgeSeconds com.amazonaws.s3#CORSRule$MaxAgeSeconds */ => {
let var_169 =
Some(
{
<i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.s3#MaxAgeSeconds`)"))
}
?
)
;
builder = builder.set_max_age_seconds(var_169);
}
,
_ => {}
}
}
Ok(builder.build())
}
sourcepub fn allowed_methods(self, input: impl Into<String>) -> Self
pub fn allowed_methods(self, input: impl Into<String>) -> Self
Appends an item to allowed_methods
.
To override the contents of this collection use set_allowed_methods
.
An HTTP method that you allow the origin to execute. Valid values are GET
, PUT
, HEAD
, POST
, and DELETE
.
sourcepub fn set_allowed_methods(self, input: Option<Vec<String>>) -> Self
pub fn set_allowed_methods(self, input: Option<Vec<String>>) -> Self
An HTTP method that you allow the origin to execute. Valid values are GET
, PUT
, HEAD
, POST
, and DELETE
.
Examples found in repository?
3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212
pub fn deser_structure_crate_model_cors_rule(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::CorsRule, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::CorsRule::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("ID") /* ID com.amazonaws.s3#CORSRule$ID */ => {
let var_160 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_id(var_160);
}
,
s if s.matches("AllowedHeader") /* AllowedHeaders com.amazonaws.s3#CORSRule$AllowedHeaders */ => {
let var_161 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_162 = builder.allowed_headers.take().unwrap_or_default();
list_162.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_162
})
?
)
;
builder = builder.set_allowed_headers(var_161);
}
,
s if s.matches("AllowedMethod") /* AllowedMethods com.amazonaws.s3#CORSRule$AllowedMethods */ => {
let var_163 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_164 = builder.allowed_methods.take().unwrap_or_default();
list_164.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_164
})
?
)
;
builder = builder.set_allowed_methods(var_163);
}
,
s if s.matches("AllowedOrigin") /* AllowedOrigins com.amazonaws.s3#CORSRule$AllowedOrigins */ => {
let var_165 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_166 = builder.allowed_origins.take().unwrap_or_default();
list_166.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_166
})
?
)
;
builder = builder.set_allowed_origins(var_165);
}
,
s if s.matches("ExposeHeader") /* ExposeHeaders com.amazonaws.s3#CORSRule$ExposeHeaders */ => {
let var_167 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_168 = builder.expose_headers.take().unwrap_or_default();
list_168.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_168
})
?
)
;
builder = builder.set_expose_headers(var_167);
}
,
s if s.matches("MaxAgeSeconds") /* MaxAgeSeconds com.amazonaws.s3#CORSRule$MaxAgeSeconds */ => {
let var_169 =
Some(
{
<i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.s3#MaxAgeSeconds`)"))
}
?
)
;
builder = builder.set_max_age_seconds(var_169);
}
,
_ => {}
}
}
Ok(builder.build())
}
sourcepub fn allowed_origins(self, input: impl Into<String>) -> Self
pub fn allowed_origins(self, input: impl Into<String>) -> Self
Appends an item to allowed_origins
.
To override the contents of this collection use set_allowed_origins
.
One or more origins you want customers to be able to access the bucket from.
sourcepub fn set_allowed_origins(self, input: Option<Vec<String>>) -> Self
pub fn set_allowed_origins(self, input: Option<Vec<String>>) -> Self
One or more origins you want customers to be able to access the bucket from.
Examples found in repository?
3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212
pub fn deser_structure_crate_model_cors_rule(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::CorsRule, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::CorsRule::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("ID") /* ID com.amazonaws.s3#CORSRule$ID */ => {
let var_160 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_id(var_160);
}
,
s if s.matches("AllowedHeader") /* AllowedHeaders com.amazonaws.s3#CORSRule$AllowedHeaders */ => {
let var_161 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_162 = builder.allowed_headers.take().unwrap_or_default();
list_162.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_162
})
?
)
;
builder = builder.set_allowed_headers(var_161);
}
,
s if s.matches("AllowedMethod") /* AllowedMethods com.amazonaws.s3#CORSRule$AllowedMethods */ => {
let var_163 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_164 = builder.allowed_methods.take().unwrap_or_default();
list_164.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_164
})
?
)
;
builder = builder.set_allowed_methods(var_163);
}
,
s if s.matches("AllowedOrigin") /* AllowedOrigins com.amazonaws.s3#CORSRule$AllowedOrigins */ => {
let var_165 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_166 = builder.allowed_origins.take().unwrap_or_default();
list_166.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_166
})
?
)
;
builder = builder.set_allowed_origins(var_165);
}
,
s if s.matches("ExposeHeader") /* ExposeHeaders com.amazonaws.s3#CORSRule$ExposeHeaders */ => {
let var_167 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_168 = builder.expose_headers.take().unwrap_or_default();
list_168.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_168
})
?
)
;
builder = builder.set_expose_headers(var_167);
}
,
s if s.matches("MaxAgeSeconds") /* MaxAgeSeconds com.amazonaws.s3#CORSRule$MaxAgeSeconds */ => {
let var_169 =
Some(
{
<i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.s3#MaxAgeSeconds`)"))
}
?
)
;
builder = builder.set_max_age_seconds(var_169);
}
,
_ => {}
}
}
Ok(builder.build())
}
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
.
One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript XMLHttpRequest
object).
sourcepub fn set_expose_headers(self, input: Option<Vec<String>>) -> Self
pub fn set_expose_headers(self, input: Option<Vec<String>>) -> Self
One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript XMLHttpRequest
object).
Examples found in repository?
3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212
pub fn deser_structure_crate_model_cors_rule(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::CorsRule, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::CorsRule::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("ID") /* ID com.amazonaws.s3#CORSRule$ID */ => {
let var_160 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_id(var_160);
}
,
s if s.matches("AllowedHeader") /* AllowedHeaders com.amazonaws.s3#CORSRule$AllowedHeaders */ => {
let var_161 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_162 = builder.allowed_headers.take().unwrap_or_default();
list_162.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_162
})
?
)
;
builder = builder.set_allowed_headers(var_161);
}
,
s if s.matches("AllowedMethod") /* AllowedMethods com.amazonaws.s3#CORSRule$AllowedMethods */ => {
let var_163 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_164 = builder.allowed_methods.take().unwrap_or_default();
list_164.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_164
})
?
)
;
builder = builder.set_allowed_methods(var_163);
}
,
s if s.matches("AllowedOrigin") /* AllowedOrigins com.amazonaws.s3#CORSRule$AllowedOrigins */ => {
let var_165 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_166 = builder.allowed_origins.take().unwrap_or_default();
list_166.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_166
})
?
)
;
builder = builder.set_allowed_origins(var_165);
}
,
s if s.matches("ExposeHeader") /* ExposeHeaders com.amazonaws.s3#CORSRule$ExposeHeaders */ => {
let var_167 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_168 = builder.expose_headers.take().unwrap_or_default();
list_168.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_168
})
?
)
;
builder = builder.set_expose_headers(var_167);
}
,
s if s.matches("MaxAgeSeconds") /* MaxAgeSeconds com.amazonaws.s3#CORSRule$MaxAgeSeconds */ => {
let var_169 =
Some(
{
<i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.s3#MaxAgeSeconds`)"))
}
?
)
;
builder = builder.set_max_age_seconds(var_169);
}
,
_ => {}
}
}
Ok(builder.build())
}
sourcepub fn max_age_seconds(self, input: i32) -> Self
pub fn max_age_seconds(self, input: i32) -> Self
The time in seconds that your browser is to cache the preflight response for the specified resource.
sourcepub fn set_max_age_seconds(self, input: Option<i32>) -> Self
pub fn set_max_age_seconds(self, input: Option<i32>) -> Self
The time in seconds that your browser is to cache the preflight response for the specified resource.
Examples found in repository?
3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212
pub fn deser_structure_crate_model_cors_rule(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::CorsRule, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::CorsRule::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("ID") /* ID com.amazonaws.s3#CORSRule$ID */ => {
let var_160 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_id(var_160);
}
,
s if s.matches("AllowedHeader") /* AllowedHeaders com.amazonaws.s3#CORSRule$AllowedHeaders */ => {
let var_161 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_162 = builder.allowed_headers.take().unwrap_or_default();
list_162.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_162
})
?
)
;
builder = builder.set_allowed_headers(var_161);
}
,
s if s.matches("AllowedMethod") /* AllowedMethods com.amazonaws.s3#CORSRule$AllowedMethods */ => {
let var_163 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_164 = builder.allowed_methods.take().unwrap_or_default();
list_164.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_164
})
?
)
;
builder = builder.set_allowed_methods(var_163);
}
,
s if s.matches("AllowedOrigin") /* AllowedOrigins com.amazonaws.s3#CORSRule$AllowedOrigins */ => {
let var_165 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_166 = builder.allowed_origins.take().unwrap_or_default();
list_166.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_166
})
?
)
;
builder = builder.set_allowed_origins(var_165);
}
,
s if s.matches("ExposeHeader") /* ExposeHeaders com.amazonaws.s3#CORSRule$ExposeHeaders */ => {
let var_167 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_168 = builder.expose_headers.take().unwrap_or_default();
list_168.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_168
})
?
)
;
builder = builder.set_expose_headers(var_167);
}
,
s if s.matches("MaxAgeSeconds") /* MaxAgeSeconds com.amazonaws.s3#CORSRule$MaxAgeSeconds */ => {
let var_169 =
Some(
{
<i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.s3#MaxAgeSeconds`)"))
}
?
)
;
builder = builder.set_max_age_seconds(var_169);
}
,
_ => {}
}
}
Ok(builder.build())
}
sourcepub fn build(self) -> CorsRule
pub fn build(self) -> CorsRule
Consumes the builder and constructs a CorsRule
.
Examples found in repository?
3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212
pub fn deser_structure_crate_model_cors_rule(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::CorsRule, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::CorsRule::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("ID") /* ID com.amazonaws.s3#CORSRule$ID */ => {
let var_160 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_id(var_160);
}
,
s if s.matches("AllowedHeader") /* AllowedHeaders com.amazonaws.s3#CORSRule$AllowedHeaders */ => {
let var_161 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_162 = builder.allowed_headers.take().unwrap_or_default();
list_162.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_162
})
?
)
;
builder = builder.set_allowed_headers(var_161);
}
,
s if s.matches("AllowedMethod") /* AllowedMethods com.amazonaws.s3#CORSRule$AllowedMethods */ => {
let var_163 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_164 = builder.allowed_methods.take().unwrap_or_default();
list_164.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_164
})
?
)
;
builder = builder.set_allowed_methods(var_163);
}
,
s if s.matches("AllowedOrigin") /* AllowedOrigins com.amazonaws.s3#CORSRule$AllowedOrigins */ => {
let var_165 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_166 = builder.allowed_origins.take().unwrap_or_default();
list_166.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_166
})
?
)
;
builder = builder.set_allowed_origins(var_165);
}
,
s if s.matches("ExposeHeader") /* ExposeHeaders com.amazonaws.s3#CORSRule$ExposeHeaders */ => {
let var_167 =
Some(
Result::<std::vec::Vec<std::string::String>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_168 = builder.expose_headers.take().unwrap_or_default();
list_168.push(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
);
list_168
})
?
)
;
builder = builder.set_expose_headers(var_167);
}
,
s if s.matches("MaxAgeSeconds") /* MaxAgeSeconds com.amazonaws.s3#CORSRule$MaxAgeSeconds */ => {
let var_169 =
Some(
{
<i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.s3#MaxAgeSeconds`)"))
}
?
)
;
builder = builder.set_max_age_seconds(var_169);
}
,
_ => {}
}
}
Ok(builder.build())
}