use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::param::{Params, ServiceParams};
use rusoto_core::proto::xml::error::*;
use rusoto_core::proto::xml::util::{
characters, deserialize_elements, end_element, find_start_element, peek_at_name, skip_tree,
start_element,
};
use rusoto_core::proto::xml::util::{Next, Peek, XmlParseError, XmlResponse};
use rusoto_core::signature::SignedRequest;
use std::io::Write;
use std::str::FromStr;
use xml;
use xml::reader::ParserConfig;
use xml::EventReader;
use xml::EventWriter;
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ActiveTrustedSigners {
pub enabled: bool,
pub items: Option<Vec<Signer>>,
pub quantity: i64,
}
struct ActiveTrustedSignersDeserializer;
impl ActiveTrustedSignersDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ActiveTrustedSigners, XmlParseError> {
deserialize_elements::<_, ActiveTrustedSigners, _>(tag_name, stack, |name, stack, obj| {
match name {
"Enabled" => {
obj.enabled = BooleanDeserializer::deserialize("Enabled", stack)?;
}
"Items" => {
obj.items
.get_or_insert(vec![])
.extend(SignerListDeserializer::deserialize("Items", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct AliasListDeserializer;
impl AliasListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<String>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "CNAME" {
obj.push(StringDeserializer::deserialize("CNAME", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct AliasListSerializer;
impl AliasListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<String>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
StringSerializer::serialize(writer, "CNAME", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Aliases {
pub items: Option<Vec<String>>,
pub quantity: i64,
}
struct AliasesDeserializer;
impl AliasesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Aliases, XmlParseError> {
deserialize_elements::<_, Aliases, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items
.get_or_insert(vec![])
.extend(AliasListDeserializer::deserialize("Items", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct AliasesSerializer;
impl AliasesSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Aliases,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.items {
&AliasListSerializer::serialize(&mut writer, "Items", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AllowedMethods {
pub cached_methods: Option<CachedMethods>,
pub items: Vec<String>,
pub quantity: i64,
}
struct AllowedMethodsDeserializer;
impl AllowedMethodsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<AllowedMethods, XmlParseError> {
deserialize_elements::<_, AllowedMethods, _>(tag_name, stack, |name, stack, obj| {
match name {
"CachedMethods" => {
obj.cached_methods = Some(CachedMethodsDeserializer::deserialize(
"CachedMethods",
stack,
)?);
}
"Items" => {
obj.items
.extend(MethodsListDeserializer::deserialize("Items", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct AllowedMethodsSerializer;
impl AllowedMethodsSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &AllowedMethods,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.cached_methods {
&CachedMethodsSerializer::serialize(&mut writer, "CachedMethods", value)?;
}
MethodsListSerializer::serialize(&mut writer, "Items", &obj.items)?;
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct AwsAccountNumberListDeserializer;
impl AwsAccountNumberListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<String>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "AwsAccountNumber" {
obj.push(StringDeserializer::deserialize("AwsAccountNumber", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct AwsAccountNumberListSerializer;
impl AwsAccountNumberListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<String>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
StringSerializer::serialize(writer, "AwsAccountNumber", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
struct BooleanDeserializer;
impl BooleanDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<bool, XmlParseError> {
start_element(tag_name, stack)?;
let obj = bool::from_str(characters(stack)?.as_ref()).unwrap();
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct BooleanSerializer;
impl BooleanSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &bool,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CacheBehavior {
pub allowed_methods: Option<AllowedMethods>,
pub compress: Option<bool>,
pub default_ttl: Option<i64>,
pub field_level_encryption_id: Option<String>,
pub forwarded_values: ForwardedValues,
pub lambda_function_associations: Option<LambdaFunctionAssociations>,
pub max_ttl: Option<i64>,
pub min_ttl: i64,
pub path_pattern: String,
pub smooth_streaming: Option<bool>,
pub target_origin_id: String,
pub trusted_signers: TrustedSigners,
pub viewer_protocol_policy: String,
}
struct CacheBehaviorDeserializer;
impl CacheBehaviorDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheBehavior, XmlParseError> {
deserialize_elements::<_, CacheBehavior, _>(tag_name, stack, |name, stack, obj| {
match name {
"AllowedMethods" => {
obj.allowed_methods = Some(AllowedMethodsDeserializer::deserialize(
"AllowedMethods",
stack,
)?);
}
"Compress" => {
obj.compress = Some(BooleanDeserializer::deserialize("Compress", stack)?);
}
"DefaultTTL" => {
obj.default_ttl = Some(LongDeserializer::deserialize("DefaultTTL", stack)?);
}
"FieldLevelEncryptionId" => {
obj.field_level_encryption_id = Some(StringDeserializer::deserialize(
"FieldLevelEncryptionId",
stack,
)?);
}
"ForwardedValues" => {
obj.forwarded_values =
ForwardedValuesDeserializer::deserialize("ForwardedValues", stack)?;
}
"LambdaFunctionAssociations" => {
obj.lambda_function_associations =
Some(LambdaFunctionAssociationsDeserializer::deserialize(
"LambdaFunctionAssociations",
stack,
)?);
}
"MaxTTL" => {
obj.max_ttl = Some(LongDeserializer::deserialize("MaxTTL", stack)?);
}
"MinTTL" => {
obj.min_ttl = LongDeserializer::deserialize("MinTTL", stack)?;
}
"PathPattern" => {
obj.path_pattern = StringDeserializer::deserialize("PathPattern", stack)?;
}
"SmoothStreaming" => {
obj.smooth_streaming =
Some(BooleanDeserializer::deserialize("SmoothStreaming", stack)?);
}
"TargetOriginId" => {
obj.target_origin_id =
StringDeserializer::deserialize("TargetOriginId", stack)?;
}
"TrustedSigners" => {
obj.trusted_signers =
TrustedSignersDeserializer::deserialize("TrustedSigners", stack)?;
}
"ViewerProtocolPolicy" => {
obj.viewer_protocol_policy = ViewerProtocolPolicyDeserializer::deserialize(
"ViewerProtocolPolicy",
stack,
)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct CacheBehaviorSerializer;
impl CacheBehaviorSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &CacheBehavior,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.allowed_methods {
&AllowedMethodsSerializer::serialize(&mut writer, "AllowedMethods", value)?;
}
if let Some(ref value) = obj.compress {
writer.write(xml::writer::XmlEvent::start_element("Compress"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
if let Some(ref value) = obj.default_ttl {
writer.write(xml::writer::XmlEvent::start_element("DefaultTTL"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
if let Some(ref value) = obj.field_level_encryption_id {
writer.write(xml::writer::XmlEvent::start_element(
"FieldLevelEncryptionId",
))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
ForwardedValuesSerializer::serialize(
&mut writer,
"ForwardedValues",
&obj.forwarded_values,
)?;
if let Some(ref value) = obj.lambda_function_associations {
&LambdaFunctionAssociationsSerializer::serialize(
&mut writer,
"LambdaFunctionAssociations",
value,
)?;
}
if let Some(ref value) = obj.max_ttl {
writer.write(xml::writer::XmlEvent::start_element("MaxTTL"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
writer.write(xml::writer::XmlEvent::start_element("MinTTL"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.min_ttl
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("PathPattern"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.path_pattern
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.smooth_streaming {
writer.write(xml::writer::XmlEvent::start_element("SmoothStreaming"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
writer.write(xml::writer::XmlEvent::start_element("TargetOriginId"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.target_origin_id
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
TrustedSignersSerializer::serialize(&mut writer, "TrustedSigners", &obj.trusted_signers)?;
writer.write(xml::writer::XmlEvent::start_element("ViewerProtocolPolicy"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.viewer_protocol_policy
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct CacheBehaviorListDeserializer;
impl CacheBehaviorListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<CacheBehavior>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "CacheBehavior" {
obj.push(CacheBehaviorDeserializer::deserialize(
"CacheBehavior",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct CacheBehaviorListSerializer;
impl CacheBehaviorListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<CacheBehavior>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
CacheBehaviorSerializer::serialize(writer, "CacheBehavior", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CacheBehaviors {
pub items: Option<Vec<CacheBehavior>>,
pub quantity: i64,
}
struct CacheBehaviorsDeserializer;
impl CacheBehaviorsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheBehaviors, XmlParseError> {
deserialize_elements::<_, CacheBehaviors, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items
.get_or_insert(vec![])
.extend(CacheBehaviorListDeserializer::deserialize("Items", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct CacheBehaviorsSerializer;
impl CacheBehaviorsSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &CacheBehaviors,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.items {
&CacheBehaviorListSerializer::serialize(&mut writer, "Items", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CachedMethods {
pub items: Vec<String>,
pub quantity: i64,
}
struct CachedMethodsDeserializer;
impl CachedMethodsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CachedMethods, XmlParseError> {
deserialize_elements::<_, CachedMethods, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items
.extend(MethodsListDeserializer::deserialize("Items", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct CachedMethodsSerializer;
impl CachedMethodsSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &CachedMethods,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
MethodsListSerializer::serialize(&mut writer, "Items", &obj.items)?;
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CloudFrontOriginAccessIdentity {
pub cloud_front_origin_access_identity_config: Option<CloudFrontOriginAccessIdentityConfig>,
pub id: String,
pub s3_canonical_user_id: String,
}
struct CloudFrontOriginAccessIdentityDeserializer;
impl CloudFrontOriginAccessIdentityDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CloudFrontOriginAccessIdentity, XmlParseError> {
deserialize_elements::<_, CloudFrontOriginAccessIdentity, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CloudFrontOriginAccessIdentityConfig" => {
obj.cloud_front_origin_access_identity_config = Some(
CloudFrontOriginAccessIdentityConfigDeserializer::deserialize(
"CloudFrontOriginAccessIdentityConfig",
stack,
)?,
);
}
"Id" => {
obj.id = StringDeserializer::deserialize("Id", stack)?;
}
"S3CanonicalUserId" => {
obj.s3_canonical_user_id =
StringDeserializer::deserialize("S3CanonicalUserId", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CloudFrontOriginAccessIdentityConfig {
pub caller_reference: String,
pub comment: String,
}
struct CloudFrontOriginAccessIdentityConfigDeserializer;
impl CloudFrontOriginAccessIdentityConfigDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CloudFrontOriginAccessIdentityConfig, XmlParseError> {
deserialize_elements::<_, CloudFrontOriginAccessIdentityConfig, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CallerReference" => {
obj.caller_reference =
StringDeserializer::deserialize("CallerReference", stack)?;
}
"Comment" => {
obj.comment = StringDeserializer::deserialize("Comment", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
pub struct CloudFrontOriginAccessIdentityConfigSerializer;
impl CloudFrontOriginAccessIdentityConfigSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &CloudFrontOriginAccessIdentityConfig,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element("CallerReference"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.caller_reference
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("Comment"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.comment
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CloudFrontOriginAccessIdentityList {
pub is_truncated: bool,
pub items: Option<Vec<CloudFrontOriginAccessIdentitySummary>>,
pub marker: String,
pub max_items: i64,
pub next_marker: Option<String>,
pub quantity: i64,
}
struct CloudFrontOriginAccessIdentityListDeserializer;
impl CloudFrontOriginAccessIdentityListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CloudFrontOriginAccessIdentityList, XmlParseError> {
deserialize_elements::<_, CloudFrontOriginAccessIdentityList, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"IsTruncated" => {
obj.is_truncated = BooleanDeserializer::deserialize("IsTruncated", stack)?;
}
"Items" => {
obj.items.get_or_insert(vec![]).extend(
CloudFrontOriginAccessIdentitySummaryListDeserializer::deserialize(
"Items", stack,
)?,
);
}
"Marker" => {
obj.marker = StringDeserializer::deserialize("Marker", stack)?;
}
"MaxItems" => {
obj.max_items = IntegerDeserializer::deserialize("MaxItems", stack)?;
}
"NextMarker" => {
obj.next_marker =
Some(StringDeserializer::deserialize("NextMarker", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CloudFrontOriginAccessIdentitySummary {
pub comment: String,
pub id: String,
pub s3_canonical_user_id: String,
}
struct CloudFrontOriginAccessIdentitySummaryDeserializer;
impl CloudFrontOriginAccessIdentitySummaryDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CloudFrontOriginAccessIdentitySummary, XmlParseError> {
deserialize_elements::<_, CloudFrontOriginAccessIdentitySummary, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Comment" => {
obj.comment = StringDeserializer::deserialize("Comment", stack)?;
}
"Id" => {
obj.id = StringDeserializer::deserialize("Id", stack)?;
}
"S3CanonicalUserId" => {
obj.s3_canonical_user_id =
StringDeserializer::deserialize("S3CanonicalUserId", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct CloudFrontOriginAccessIdentitySummaryListDeserializer;
impl CloudFrontOriginAccessIdentitySummaryListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<CloudFrontOriginAccessIdentitySummary>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "CloudFrontOriginAccessIdentitySummary" {
obj.push(
CloudFrontOriginAccessIdentitySummaryDeserializer::deserialize(
"CloudFrontOriginAccessIdentitySummary",
stack,
)?,
);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ContentTypeProfile {
pub content_type: String,
pub format: String,
pub profile_id: Option<String>,
}
struct ContentTypeProfileDeserializer;
impl ContentTypeProfileDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ContentTypeProfile, XmlParseError> {
deserialize_elements::<_, ContentTypeProfile, _>(tag_name, stack, |name, stack, obj| {
match name {
"ContentType" => {
obj.content_type = StringDeserializer::deserialize("ContentType", stack)?;
}
"Format" => {
obj.format = FormatDeserializer::deserialize("Format", stack)?;
}
"ProfileId" => {
obj.profile_id = Some(StringDeserializer::deserialize("ProfileId", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct ContentTypeProfileSerializer;
impl ContentTypeProfileSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &ContentTypeProfile,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element("ContentType"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.content_type
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("Format"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.format
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.profile_id {
writer.write(xml::writer::XmlEvent::start_element("ProfileId"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ContentTypeProfileConfig {
pub content_type_profiles: Option<ContentTypeProfiles>,
pub forward_when_content_type_is_unknown: bool,
}
struct ContentTypeProfileConfigDeserializer;
impl ContentTypeProfileConfigDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ContentTypeProfileConfig, XmlParseError> {
deserialize_elements::<_, ContentTypeProfileConfig, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"ContentTypeProfiles" => {
obj.content_type_profiles =
Some(ContentTypeProfilesDeserializer::deserialize(
"ContentTypeProfiles",
stack,
)?);
}
"ForwardWhenContentTypeIsUnknown" => {
obj.forward_when_content_type_is_unknown =
BooleanDeserializer::deserialize(
"ForwardWhenContentTypeIsUnknown",
stack,
)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
pub struct ContentTypeProfileConfigSerializer;
impl ContentTypeProfileConfigSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &ContentTypeProfileConfig,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.content_type_profiles {
&ContentTypeProfilesSerializer::serialize(&mut writer, "ContentTypeProfiles", value)?;
}
writer.write(xml::writer::XmlEvent::start_element(
"ForwardWhenContentTypeIsUnknown",
))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.forward_when_content_type_is_unknown
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct ContentTypeProfileListDeserializer;
impl ContentTypeProfileListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<ContentTypeProfile>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "ContentTypeProfile" {
obj.push(ContentTypeProfileDeserializer::deserialize(
"ContentTypeProfile",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct ContentTypeProfileListSerializer;
impl ContentTypeProfileListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<ContentTypeProfile>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
ContentTypeProfileSerializer::serialize(writer, "ContentTypeProfile", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ContentTypeProfiles {
pub items: Option<Vec<ContentTypeProfile>>,
pub quantity: i64,
}
struct ContentTypeProfilesDeserializer;
impl ContentTypeProfilesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ContentTypeProfiles, XmlParseError> {
deserialize_elements::<_, ContentTypeProfiles, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items.get_or_insert(vec![]).extend(
ContentTypeProfileListDeserializer::deserialize("Items", stack)?,
);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct ContentTypeProfilesSerializer;
impl ContentTypeProfilesSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &ContentTypeProfiles,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.items {
&ContentTypeProfileListSerializer::serialize(&mut writer, "Items", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct CookieNameListDeserializer;
impl CookieNameListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<String>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "Name" {
obj.push(StringDeserializer::deserialize("Name", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct CookieNameListSerializer;
impl CookieNameListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<String>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
StringSerializer::serialize(writer, "Name", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CookieNames {
pub items: Option<Vec<String>>,
pub quantity: i64,
}
struct CookieNamesDeserializer;
impl CookieNamesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CookieNames, XmlParseError> {
deserialize_elements::<_, CookieNames, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items
.get_or_insert(vec![])
.extend(CookieNameListDeserializer::deserialize("Items", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct CookieNamesSerializer;
impl CookieNamesSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &CookieNames,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.items {
&CookieNameListSerializer::serialize(&mut writer, "Items", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CookiePreference {
pub forward: String,
pub whitelisted_names: Option<CookieNames>,
}
struct CookiePreferenceDeserializer;
impl CookiePreferenceDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CookiePreference, XmlParseError> {
deserialize_elements::<_, CookiePreference, _>(tag_name, stack, |name, stack, obj| {
match name {
"Forward" => {
obj.forward = ItemSelectionDeserializer::deserialize("Forward", stack)?;
}
"WhitelistedNames" => {
obj.whitelisted_names = Some(CookieNamesDeserializer::deserialize(
"WhitelistedNames",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct CookiePreferenceSerializer;
impl CookiePreferenceSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &CookiePreference,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element("Forward"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.forward
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.whitelisted_names {
&CookieNamesSerializer::serialize(&mut writer, "WhitelistedNames", value)?;
}
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateCloudFrontOriginAccessIdentityRequest {
pub cloud_front_origin_access_identity_config: CloudFrontOriginAccessIdentityConfig,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateCloudFrontOriginAccessIdentityResult {
pub cloud_front_origin_access_identity: Option<CloudFrontOriginAccessIdentity>,
pub e_tag: Option<String>,
pub location: Option<String>,
}
struct CreateCloudFrontOriginAccessIdentityResultDeserializer;
impl CreateCloudFrontOriginAccessIdentityResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CreateCloudFrontOriginAccessIdentityResult, XmlParseError> {
Ok(CreateCloudFrontOriginAccessIdentityResult {
cloud_front_origin_access_identity: Some(
CloudFrontOriginAccessIdentityDeserializer::deserialize(
"CloudFrontOriginAccessIdentity",
stack,
)?,
),
..CreateCloudFrontOriginAccessIdentityResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateDistributionRequest {
pub distribution_config: DistributionConfig,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateDistributionResult {
pub distribution: Option<Distribution>,
pub e_tag: Option<String>,
pub location: Option<String>,
}
struct CreateDistributionResultDeserializer;
impl CreateDistributionResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CreateDistributionResult, XmlParseError> {
Ok(CreateDistributionResult {
distribution: Some(DistributionDeserializer::deserialize(
"Distribution",
stack,
)?),
..CreateDistributionResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateDistributionWithTagsRequest {
pub distribution_config_with_tags: DistributionConfigWithTags,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateDistributionWithTagsResult {
pub distribution: Option<Distribution>,
pub e_tag: Option<String>,
pub location: Option<String>,
}
struct CreateDistributionWithTagsResultDeserializer;
impl CreateDistributionWithTagsResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CreateDistributionWithTagsResult, XmlParseError> {
Ok(CreateDistributionWithTagsResult {
distribution: Some(DistributionDeserializer::deserialize(
"Distribution",
stack,
)?),
..CreateDistributionWithTagsResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateFieldLevelEncryptionConfigRequest {
pub field_level_encryption_config: FieldLevelEncryptionConfig,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateFieldLevelEncryptionConfigResult {
pub e_tag: Option<String>,
pub field_level_encryption: Option<FieldLevelEncryption>,
pub location: Option<String>,
}
struct CreateFieldLevelEncryptionConfigResultDeserializer;
impl CreateFieldLevelEncryptionConfigResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CreateFieldLevelEncryptionConfigResult, XmlParseError> {
Ok(CreateFieldLevelEncryptionConfigResult {
field_level_encryption: Some(FieldLevelEncryptionDeserializer::deserialize(
"FieldLevelEncryption",
stack,
)?),
..CreateFieldLevelEncryptionConfigResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateFieldLevelEncryptionProfileRequest {
pub field_level_encryption_profile_config: FieldLevelEncryptionProfileConfig,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateFieldLevelEncryptionProfileResult {
pub e_tag: Option<String>,
pub field_level_encryption_profile: Option<FieldLevelEncryptionProfile>,
pub location: Option<String>,
}
struct CreateFieldLevelEncryptionProfileResultDeserializer;
impl CreateFieldLevelEncryptionProfileResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CreateFieldLevelEncryptionProfileResult, XmlParseError> {
Ok(CreateFieldLevelEncryptionProfileResult {
field_level_encryption_profile: Some(
FieldLevelEncryptionProfileDeserializer::deserialize(
"FieldLevelEncryptionProfile",
stack,
)?,
),
..CreateFieldLevelEncryptionProfileResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateInvalidationRequest {
pub distribution_id: String,
pub invalidation_batch: InvalidationBatch,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateInvalidationResult {
pub invalidation: Option<Invalidation>,
pub location: Option<String>,
}
struct CreateInvalidationResultDeserializer;
impl CreateInvalidationResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CreateInvalidationResult, XmlParseError> {
Ok(CreateInvalidationResult {
invalidation: Some(InvalidationDeserializer::deserialize(
"Invalidation",
stack,
)?),
..CreateInvalidationResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreatePublicKeyRequest {
pub public_key_config: PublicKeyConfig,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreatePublicKeyResult {
pub e_tag: Option<String>,
pub location: Option<String>,
pub public_key: Option<PublicKey>,
}
struct CreatePublicKeyResultDeserializer;
impl CreatePublicKeyResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CreatePublicKeyResult, XmlParseError> {
Ok(CreatePublicKeyResult {
public_key: Some(PublicKeyDeserializer::deserialize("PublicKey", stack)?),
..CreatePublicKeyResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateStreamingDistributionRequest {
pub streaming_distribution_config: StreamingDistributionConfig,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateStreamingDistributionResult {
pub e_tag: Option<String>,
pub location: Option<String>,
pub streaming_distribution: Option<StreamingDistribution>,
}
struct CreateStreamingDistributionResultDeserializer;
impl CreateStreamingDistributionResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CreateStreamingDistributionResult, XmlParseError> {
Ok(CreateStreamingDistributionResult {
streaming_distribution: Some(StreamingDistributionDeserializer::deserialize(
"StreamingDistribution",
stack,
)?),
..CreateStreamingDistributionResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateStreamingDistributionWithTagsRequest {
pub streaming_distribution_config_with_tags: StreamingDistributionConfigWithTags,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateStreamingDistributionWithTagsResult {
pub e_tag: Option<String>,
pub location: Option<String>,
pub streaming_distribution: Option<StreamingDistribution>,
}
struct CreateStreamingDistributionWithTagsResultDeserializer;
impl CreateStreamingDistributionWithTagsResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CreateStreamingDistributionWithTagsResult, XmlParseError> {
Ok(CreateStreamingDistributionWithTagsResult {
streaming_distribution: Some(StreamingDistributionDeserializer::deserialize(
"StreamingDistribution",
stack,
)?),
..CreateStreamingDistributionWithTagsResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CustomErrorResponse {
pub error_caching_min_ttl: Option<i64>,
pub error_code: i64,
pub response_code: Option<String>,
pub response_page_path: Option<String>,
}
struct CustomErrorResponseDeserializer;
impl CustomErrorResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CustomErrorResponse, XmlParseError> {
deserialize_elements::<_, CustomErrorResponse, _>(tag_name, stack, |name, stack, obj| {
match name {
"ErrorCachingMinTTL" => {
obj.error_caching_min_ttl =
Some(LongDeserializer::deserialize("ErrorCachingMinTTL", stack)?);
}
"ErrorCode" => {
obj.error_code = IntegerDeserializer::deserialize("ErrorCode", stack)?;
}
"ResponseCode" => {
obj.response_code =
Some(StringDeserializer::deserialize("ResponseCode", stack)?);
}
"ResponsePagePath" => {
obj.response_page_path =
Some(StringDeserializer::deserialize("ResponsePagePath", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct CustomErrorResponseSerializer;
impl CustomErrorResponseSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &CustomErrorResponse,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.error_caching_min_ttl {
writer.write(xml::writer::XmlEvent::start_element("ErrorCachingMinTTL"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
writer.write(xml::writer::XmlEvent::start_element("ErrorCode"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.error_code
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.response_code {
writer.write(xml::writer::XmlEvent::start_element("ResponseCode"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
if let Some(ref value) = obj.response_page_path {
writer.write(xml::writer::XmlEvent::start_element("ResponsePagePath"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct CustomErrorResponseListDeserializer;
impl CustomErrorResponseListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<CustomErrorResponse>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "CustomErrorResponse" {
obj.push(CustomErrorResponseDeserializer::deserialize(
"CustomErrorResponse",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct CustomErrorResponseListSerializer;
impl CustomErrorResponseListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<CustomErrorResponse>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
CustomErrorResponseSerializer::serialize(writer, "CustomErrorResponse", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CustomErrorResponses {
pub items: Option<Vec<CustomErrorResponse>>,
pub quantity: i64,
}
struct CustomErrorResponsesDeserializer;
impl CustomErrorResponsesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CustomErrorResponses, XmlParseError> {
deserialize_elements::<_, CustomErrorResponses, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items.get_or_insert(vec![]).extend(
CustomErrorResponseListDeserializer::deserialize("Items", stack)?,
);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct CustomErrorResponsesSerializer;
impl CustomErrorResponsesSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &CustomErrorResponses,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.items {
&CustomErrorResponseListSerializer::serialize(&mut writer, "Items", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CustomHeaders {
pub items: Option<Vec<OriginCustomHeader>>,
pub quantity: i64,
}
struct CustomHeadersDeserializer;
impl CustomHeadersDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CustomHeaders, XmlParseError> {
deserialize_elements::<_, CustomHeaders, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items.get_or_insert(vec![]).extend(
OriginCustomHeadersListDeserializer::deserialize("Items", stack)?,
);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct CustomHeadersSerializer;
impl CustomHeadersSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &CustomHeaders,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.items {
&OriginCustomHeadersListSerializer::serialize(&mut writer, "Items", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CustomOriginConfig {
pub http_port: i64,
pub https_port: i64,
pub origin_keepalive_timeout: Option<i64>,
pub origin_protocol_policy: String,
pub origin_read_timeout: Option<i64>,
pub origin_ssl_protocols: Option<OriginSslProtocols>,
}
struct CustomOriginConfigDeserializer;
impl CustomOriginConfigDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CustomOriginConfig, XmlParseError> {
deserialize_elements::<_, CustomOriginConfig, _>(tag_name, stack, |name, stack, obj| {
match name {
"HTTPPort" => {
obj.http_port = IntegerDeserializer::deserialize("HTTPPort", stack)?;
}
"HTTPSPort" => {
obj.https_port = IntegerDeserializer::deserialize("HTTPSPort", stack)?;
}
"OriginKeepaliveTimeout" => {
obj.origin_keepalive_timeout = Some(IntegerDeserializer::deserialize(
"OriginKeepaliveTimeout",
stack,
)?);
}
"OriginProtocolPolicy" => {
obj.origin_protocol_policy = OriginProtocolPolicyDeserializer::deserialize(
"OriginProtocolPolicy",
stack,
)?;
}
"OriginReadTimeout" => {
obj.origin_read_timeout = Some(IntegerDeserializer::deserialize(
"OriginReadTimeout",
stack,
)?);
}
"OriginSslProtocols" => {
obj.origin_ssl_protocols = Some(OriginSslProtocolsDeserializer::deserialize(
"OriginSslProtocols",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct CustomOriginConfigSerializer;
impl CustomOriginConfigSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &CustomOriginConfig,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element("HTTPPort"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.http_port
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("HTTPSPort"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.https_port
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.origin_keepalive_timeout {
writer.write(xml::writer::XmlEvent::start_element(
"OriginKeepaliveTimeout",
))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
writer.write(xml::writer::XmlEvent::start_element("OriginProtocolPolicy"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.origin_protocol_policy
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.origin_read_timeout {
writer.write(xml::writer::XmlEvent::start_element("OriginReadTimeout"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
if let Some(ref value) = obj.origin_ssl_protocols {
&OriginSslProtocolsSerializer::serialize(&mut writer, "OriginSslProtocols", value)?;
}
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DefaultCacheBehavior {
pub allowed_methods: Option<AllowedMethods>,
pub compress: Option<bool>,
pub default_ttl: Option<i64>,
pub field_level_encryption_id: Option<String>,
pub forwarded_values: ForwardedValues,
pub lambda_function_associations: Option<LambdaFunctionAssociations>,
pub max_ttl: Option<i64>,
pub min_ttl: i64,
pub smooth_streaming: Option<bool>,
pub target_origin_id: String,
pub trusted_signers: TrustedSigners,
pub viewer_protocol_policy: String,
}
struct DefaultCacheBehaviorDeserializer;
impl DefaultCacheBehaviorDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DefaultCacheBehavior, XmlParseError> {
deserialize_elements::<_, DefaultCacheBehavior, _>(tag_name, stack, |name, stack, obj| {
match name {
"AllowedMethods" => {
obj.allowed_methods = Some(AllowedMethodsDeserializer::deserialize(
"AllowedMethods",
stack,
)?);
}
"Compress" => {
obj.compress = Some(BooleanDeserializer::deserialize("Compress", stack)?);
}
"DefaultTTL" => {
obj.default_ttl = Some(LongDeserializer::deserialize("DefaultTTL", stack)?);
}
"FieldLevelEncryptionId" => {
obj.field_level_encryption_id = Some(StringDeserializer::deserialize(
"FieldLevelEncryptionId",
stack,
)?);
}
"ForwardedValues" => {
obj.forwarded_values =
ForwardedValuesDeserializer::deserialize("ForwardedValues", stack)?;
}
"LambdaFunctionAssociations" => {
obj.lambda_function_associations =
Some(LambdaFunctionAssociationsDeserializer::deserialize(
"LambdaFunctionAssociations",
stack,
)?);
}
"MaxTTL" => {
obj.max_ttl = Some(LongDeserializer::deserialize("MaxTTL", stack)?);
}
"MinTTL" => {
obj.min_ttl = LongDeserializer::deserialize("MinTTL", stack)?;
}
"SmoothStreaming" => {
obj.smooth_streaming =
Some(BooleanDeserializer::deserialize("SmoothStreaming", stack)?);
}
"TargetOriginId" => {
obj.target_origin_id =
StringDeserializer::deserialize("TargetOriginId", stack)?;
}
"TrustedSigners" => {
obj.trusted_signers =
TrustedSignersDeserializer::deserialize("TrustedSigners", stack)?;
}
"ViewerProtocolPolicy" => {
obj.viewer_protocol_policy = ViewerProtocolPolicyDeserializer::deserialize(
"ViewerProtocolPolicy",
stack,
)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct DefaultCacheBehaviorSerializer;
impl DefaultCacheBehaviorSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &DefaultCacheBehavior,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.allowed_methods {
&AllowedMethodsSerializer::serialize(&mut writer, "AllowedMethods", value)?;
}
if let Some(ref value) = obj.compress {
writer.write(xml::writer::XmlEvent::start_element("Compress"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
if let Some(ref value) = obj.default_ttl {
writer.write(xml::writer::XmlEvent::start_element("DefaultTTL"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
if let Some(ref value) = obj.field_level_encryption_id {
writer.write(xml::writer::XmlEvent::start_element(
"FieldLevelEncryptionId",
))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
ForwardedValuesSerializer::serialize(
&mut writer,
"ForwardedValues",
&obj.forwarded_values,
)?;
if let Some(ref value) = obj.lambda_function_associations {
&LambdaFunctionAssociationsSerializer::serialize(
&mut writer,
"LambdaFunctionAssociations",
value,
)?;
}
if let Some(ref value) = obj.max_ttl {
writer.write(xml::writer::XmlEvent::start_element("MaxTTL"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
writer.write(xml::writer::XmlEvent::start_element("MinTTL"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.min_ttl
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.smooth_streaming {
writer.write(xml::writer::XmlEvent::start_element("SmoothStreaming"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
writer.write(xml::writer::XmlEvent::start_element("TargetOriginId"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.target_origin_id
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
TrustedSignersSerializer::serialize(&mut writer, "TrustedSigners", &obj.trusted_signers)?;
writer.write(xml::writer::XmlEvent::start_element("ViewerProtocolPolicy"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.viewer_protocol_policy
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteCloudFrontOriginAccessIdentityRequest {
pub id: String,
pub if_match: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteDistributionRequest {
pub id: String,
pub if_match: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteFieldLevelEncryptionConfigRequest {
pub id: String,
pub if_match: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteFieldLevelEncryptionProfileRequest {
pub id: String,
pub if_match: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeletePublicKeyRequest {
pub id: String,
pub if_match: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteStreamingDistributionRequest {
pub id: String,
pub if_match: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Distribution {
pub arn: String,
pub active_trusted_signers: ActiveTrustedSigners,
pub distribution_config: DistributionConfig,
pub domain_name: String,
pub id: String,
pub in_progress_invalidation_batches: i64,
pub last_modified_time: String,
pub status: String,
}
struct DistributionDeserializer;
impl DistributionDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Distribution, XmlParseError> {
deserialize_elements::<_, Distribution, _>(tag_name, stack, |name, stack, obj| {
match name {
"ARN" => {
obj.arn = StringDeserializer::deserialize("ARN", stack)?;
}
"ActiveTrustedSigners" => {
obj.active_trusted_signers = ActiveTrustedSignersDeserializer::deserialize(
"ActiveTrustedSigners",
stack,
)?;
}
"DistributionConfig" => {
obj.distribution_config =
DistributionConfigDeserializer::deserialize("DistributionConfig", stack)?;
}
"DomainName" => {
obj.domain_name = StringDeserializer::deserialize("DomainName", stack)?;
}
"Id" => {
obj.id = StringDeserializer::deserialize("Id", stack)?;
}
"InProgressInvalidationBatches" => {
obj.in_progress_invalidation_batches =
IntegerDeserializer::deserialize("InProgressInvalidationBatches", stack)?;
}
"LastModifiedTime" => {
obj.last_modified_time =
TimestampDeserializer::deserialize("LastModifiedTime", stack)?;
}
"Status" => {
obj.status = StringDeserializer::deserialize("Status", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DistributionConfig {
pub aliases: Option<Aliases>,
pub cache_behaviors: Option<CacheBehaviors>,
pub caller_reference: String,
pub comment: String,
pub custom_error_responses: Option<CustomErrorResponses>,
pub default_cache_behavior: DefaultCacheBehavior,
pub default_root_object: Option<String>,
pub enabled: bool,
pub http_version: Option<String>,
pub is_ipv6_enabled: Option<bool>,
pub logging: Option<LoggingConfig>,
pub origin_groups: Option<OriginGroups>,
pub origins: Origins,
pub price_class: Option<String>,
pub restrictions: Option<Restrictions>,
pub viewer_certificate: Option<ViewerCertificate>,
pub web_acl_id: Option<String>,
}
struct DistributionConfigDeserializer;
impl DistributionConfigDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DistributionConfig, XmlParseError> {
deserialize_elements::<_, DistributionConfig, _>(tag_name, stack, |name, stack, obj| {
match name {
"Aliases" => {
obj.aliases = Some(AliasesDeserializer::deserialize("Aliases", stack)?);
}
"CacheBehaviors" => {
obj.cache_behaviors = Some(CacheBehaviorsDeserializer::deserialize(
"CacheBehaviors",
stack,
)?);
}
"CallerReference" => {
obj.caller_reference =
StringDeserializer::deserialize("CallerReference", stack)?;
}
"Comment" => {
obj.comment = StringDeserializer::deserialize("Comment", stack)?;
}
"CustomErrorResponses" => {
obj.custom_error_responses =
Some(CustomErrorResponsesDeserializer::deserialize(
"CustomErrorResponses",
stack,
)?);
}
"DefaultCacheBehavior" => {
obj.default_cache_behavior = DefaultCacheBehaviorDeserializer::deserialize(
"DefaultCacheBehavior",
stack,
)?;
}
"DefaultRootObject" => {
obj.default_root_object =
Some(StringDeserializer::deserialize("DefaultRootObject", stack)?);
}
"Enabled" => {
obj.enabled = BooleanDeserializer::deserialize("Enabled", stack)?;
}
"HttpVersion" => {
obj.http_version =
Some(HttpVersionDeserializer::deserialize("HttpVersion", stack)?);
}
"IsIPV6Enabled" => {
obj.is_ipv6_enabled =
Some(BooleanDeserializer::deserialize("IsIPV6Enabled", stack)?);
}
"Logging" => {
obj.logging = Some(LoggingConfigDeserializer::deserialize("Logging", stack)?);
}
"OriginGroups" => {
obj.origin_groups = Some(OriginGroupsDeserializer::deserialize(
"OriginGroups",
stack,
)?);
}
"Origins" => {
obj.origins = OriginsDeserializer::deserialize("Origins", stack)?;
}
"PriceClass" => {
obj.price_class =
Some(PriceClassDeserializer::deserialize("PriceClass", stack)?);
}
"Restrictions" => {
obj.restrictions = Some(RestrictionsDeserializer::deserialize(
"Restrictions",
stack,
)?);
}
"ViewerCertificate" => {
obj.viewer_certificate = Some(ViewerCertificateDeserializer::deserialize(
"ViewerCertificate",
stack,
)?);
}
"WebACLId" => {
obj.web_acl_id = Some(StringDeserializer::deserialize("WebACLId", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct DistributionConfigSerializer;
impl DistributionConfigSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &DistributionConfig,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.aliases {
&AliasesSerializer::serialize(&mut writer, "Aliases", value)?;
}
if let Some(ref value) = obj.cache_behaviors {
&CacheBehaviorsSerializer::serialize(&mut writer, "CacheBehaviors", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("CallerReference"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.caller_reference
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("Comment"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.comment
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.custom_error_responses {
&CustomErrorResponsesSerializer::serialize(&mut writer, "CustomErrorResponses", value)?;
}
DefaultCacheBehaviorSerializer::serialize(
&mut writer,
"DefaultCacheBehavior",
&obj.default_cache_behavior,
)?;
if let Some(ref value) = obj.default_root_object {
writer.write(xml::writer::XmlEvent::start_element("DefaultRootObject"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
writer.write(xml::writer::XmlEvent::start_element("Enabled"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.enabled
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.http_version {
writer.write(xml::writer::XmlEvent::start_element("HttpVersion"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
if let Some(ref value) = obj.is_ipv6_enabled {
writer.write(xml::writer::XmlEvent::start_element("IsIPV6Enabled"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
if let Some(ref value) = obj.logging {
&LoggingConfigSerializer::serialize(&mut writer, "Logging", value)?;
}
if let Some(ref value) = obj.origin_groups {
&OriginGroupsSerializer::serialize(&mut writer, "OriginGroups", value)?;
}
OriginsSerializer::serialize(&mut writer, "Origins", &obj.origins)?;
if let Some(ref value) = obj.price_class {
writer.write(xml::writer::XmlEvent::start_element("PriceClass"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
if let Some(ref value) = obj.restrictions {
&RestrictionsSerializer::serialize(&mut writer, "Restrictions", value)?;
}
if let Some(ref value) = obj.viewer_certificate {
&ViewerCertificateSerializer::serialize(&mut writer, "ViewerCertificate", value)?;
}
if let Some(ref value) = obj.web_acl_id {
writer.write(xml::writer::XmlEvent::start_element("WebACLId"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DistributionConfigWithTags {
pub distribution_config: DistributionConfig,
pub tags: Tags,
}
pub struct DistributionConfigWithTagsSerializer;
impl DistributionConfigWithTagsSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &DistributionConfigWithTags,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
DistributionConfigSerializer::serialize(
&mut writer,
"DistributionConfig",
&obj.distribution_config,
)?;
TagsSerializer::serialize(&mut writer, "Tags", &obj.tags)?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DistributionList {
pub is_truncated: bool,
pub items: Option<Vec<DistributionSummary>>,
pub marker: String,
pub max_items: i64,
pub next_marker: Option<String>,
pub quantity: i64,
}
struct DistributionListDeserializer;
impl DistributionListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DistributionList, XmlParseError> {
deserialize_elements::<_, DistributionList, _>(tag_name, stack, |name, stack, obj| {
match name {
"IsTruncated" => {
obj.is_truncated = BooleanDeserializer::deserialize("IsTruncated", stack)?;
}
"Items" => {
obj.items.get_or_insert(vec![]).extend(
DistributionSummaryListDeserializer::deserialize("Items", stack)?,
);
}
"Marker" => {
obj.marker = StringDeserializer::deserialize("Marker", stack)?;
}
"MaxItems" => {
obj.max_items = IntegerDeserializer::deserialize("MaxItems", stack)?;
}
"NextMarker" => {
obj.next_marker = Some(StringDeserializer::deserialize("NextMarker", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DistributionSummary {
pub arn: String,
pub aliases: Aliases,
pub cache_behaviors: CacheBehaviors,
pub comment: String,
pub custom_error_responses: CustomErrorResponses,
pub default_cache_behavior: DefaultCacheBehavior,
pub domain_name: String,
pub enabled: bool,
pub http_version: String,
pub id: String,
pub is_ipv6_enabled: bool,
pub last_modified_time: String,
pub origin_groups: Option<OriginGroups>,
pub origins: Origins,
pub price_class: String,
pub restrictions: Restrictions,
pub status: String,
pub viewer_certificate: ViewerCertificate,
pub web_acl_id: String,
}
struct DistributionSummaryDeserializer;
impl DistributionSummaryDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DistributionSummary, XmlParseError> {
deserialize_elements::<_, DistributionSummary, _>(tag_name, stack, |name, stack, obj| {
match name {
"ARN" => {
obj.arn = StringDeserializer::deserialize("ARN", stack)?;
}
"Aliases" => {
obj.aliases = AliasesDeserializer::deserialize("Aliases", stack)?;
}
"CacheBehaviors" => {
obj.cache_behaviors =
CacheBehaviorsDeserializer::deserialize("CacheBehaviors", stack)?;
}
"Comment" => {
obj.comment = StringDeserializer::deserialize("Comment", stack)?;
}
"CustomErrorResponses" => {
obj.custom_error_responses = CustomErrorResponsesDeserializer::deserialize(
"CustomErrorResponses",
stack,
)?;
}
"DefaultCacheBehavior" => {
obj.default_cache_behavior = DefaultCacheBehaviorDeserializer::deserialize(
"DefaultCacheBehavior",
stack,
)?;
}
"DomainName" => {
obj.domain_name = StringDeserializer::deserialize("DomainName", stack)?;
}
"Enabled" => {
obj.enabled = BooleanDeserializer::deserialize("Enabled", stack)?;
}
"HttpVersion" => {
obj.http_version = HttpVersionDeserializer::deserialize("HttpVersion", stack)?;
}
"Id" => {
obj.id = StringDeserializer::deserialize("Id", stack)?;
}
"IsIPV6Enabled" => {
obj.is_ipv6_enabled = BooleanDeserializer::deserialize("IsIPV6Enabled", stack)?;
}
"LastModifiedTime" => {
obj.last_modified_time =
TimestampDeserializer::deserialize("LastModifiedTime", stack)?;
}
"OriginGroups" => {
obj.origin_groups = Some(OriginGroupsDeserializer::deserialize(
"OriginGroups",
stack,
)?);
}
"Origins" => {
obj.origins = OriginsDeserializer::deserialize("Origins", stack)?;
}
"PriceClass" => {
obj.price_class = PriceClassDeserializer::deserialize("PriceClass", stack)?;
}
"Restrictions" => {
obj.restrictions =
RestrictionsDeserializer::deserialize("Restrictions", stack)?;
}
"Status" => {
obj.status = StringDeserializer::deserialize("Status", stack)?;
}
"ViewerCertificate" => {
obj.viewer_certificate =
ViewerCertificateDeserializer::deserialize("ViewerCertificate", stack)?;
}
"WebACLId" => {
obj.web_acl_id = StringDeserializer::deserialize("WebACLId", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct DistributionSummaryListDeserializer;
impl DistributionSummaryListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<DistributionSummary>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "DistributionSummary" {
obj.push(DistributionSummaryDeserializer::deserialize(
"DistributionSummary",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct EncryptionEntities {
pub items: Option<Vec<EncryptionEntity>>,
pub quantity: i64,
}
struct EncryptionEntitiesDeserializer;
impl EncryptionEntitiesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<EncryptionEntities, XmlParseError> {
deserialize_elements::<_, EncryptionEntities, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items.get_or_insert(vec![]).extend(
EncryptionEntityListDeserializer::deserialize("Items", stack)?,
);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct EncryptionEntitiesSerializer;
impl EncryptionEntitiesSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &EncryptionEntities,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.items {
&EncryptionEntityListSerializer::serialize(&mut writer, "Items", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct EncryptionEntity {
pub field_patterns: FieldPatterns,
pub provider_id: String,
pub public_key_id: String,
}
struct EncryptionEntityDeserializer;
impl EncryptionEntityDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<EncryptionEntity, XmlParseError> {
deserialize_elements::<_, EncryptionEntity, _>(tag_name, stack, |name, stack, obj| {
match name {
"FieldPatterns" => {
obj.field_patterns =
FieldPatternsDeserializer::deserialize("FieldPatterns", stack)?;
}
"ProviderId" => {
obj.provider_id = StringDeserializer::deserialize("ProviderId", stack)?;
}
"PublicKeyId" => {
obj.public_key_id = StringDeserializer::deserialize("PublicKeyId", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct EncryptionEntitySerializer;
impl EncryptionEntitySerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &EncryptionEntity,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
FieldPatternsSerializer::serialize(&mut writer, "FieldPatterns", &obj.field_patterns)?;
writer.write(xml::writer::XmlEvent::start_element("ProviderId"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.provider_id
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("PublicKeyId"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.public_key_id
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct EncryptionEntityListDeserializer;
impl EncryptionEntityListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<EncryptionEntity>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "EncryptionEntity" {
obj.push(EncryptionEntityDeserializer::deserialize(
"EncryptionEntity",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct EncryptionEntityListSerializer;
impl EncryptionEntityListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<EncryptionEntity>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
EncryptionEntitySerializer::serialize(writer, "EncryptionEntity", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
struct EventTypeDeserializer;
impl EventTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct EventTypeSerializer;
impl EventTypeSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &String,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct FieldLevelEncryption {
pub field_level_encryption_config: FieldLevelEncryptionConfig,
pub id: String,
pub last_modified_time: String,
}
struct FieldLevelEncryptionDeserializer;
impl FieldLevelEncryptionDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<FieldLevelEncryption, XmlParseError> {
deserialize_elements::<_, FieldLevelEncryption, _>(tag_name, stack, |name, stack, obj| {
match name {
"FieldLevelEncryptionConfig" => {
obj.field_level_encryption_config =
FieldLevelEncryptionConfigDeserializer::deserialize(
"FieldLevelEncryptionConfig",
stack,
)?;
}
"Id" => {
obj.id = StringDeserializer::deserialize("Id", stack)?;
}
"LastModifiedTime" => {
obj.last_modified_time =
TimestampDeserializer::deserialize("LastModifiedTime", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct FieldLevelEncryptionConfig {
pub caller_reference: String,
pub comment: Option<String>,
pub content_type_profile_config: Option<ContentTypeProfileConfig>,
pub query_arg_profile_config: Option<QueryArgProfileConfig>,
}
struct FieldLevelEncryptionConfigDeserializer;
impl FieldLevelEncryptionConfigDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<FieldLevelEncryptionConfig, XmlParseError> {
deserialize_elements::<_, FieldLevelEncryptionConfig, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CallerReference" => {
obj.caller_reference =
StringDeserializer::deserialize("CallerReference", stack)?;
}
"Comment" => {
obj.comment = Some(StringDeserializer::deserialize("Comment", stack)?);
}
"ContentTypeProfileConfig" => {
obj.content_type_profile_config =
Some(ContentTypeProfileConfigDeserializer::deserialize(
"ContentTypeProfileConfig",
stack,
)?);
}
"QueryArgProfileConfig" => {
obj.query_arg_profile_config =
Some(QueryArgProfileConfigDeserializer::deserialize(
"QueryArgProfileConfig",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
pub struct FieldLevelEncryptionConfigSerializer;
impl FieldLevelEncryptionConfigSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &FieldLevelEncryptionConfig,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element("CallerReference"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.caller_reference
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.comment {
writer.write(xml::writer::XmlEvent::start_element("Comment"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
if let Some(ref value) = obj.content_type_profile_config {
&ContentTypeProfileConfigSerializer::serialize(
&mut writer,
"ContentTypeProfileConfig",
value,
)?;
}
if let Some(ref value) = obj.query_arg_profile_config {
&QueryArgProfileConfigSerializer::serialize(
&mut writer,
"QueryArgProfileConfig",
value,
)?;
}
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct FieldLevelEncryptionList {
pub items: Option<Vec<FieldLevelEncryptionSummary>>,
pub max_items: i64,
pub next_marker: Option<String>,
pub quantity: i64,
}
struct FieldLevelEncryptionListDeserializer;
impl FieldLevelEncryptionListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<FieldLevelEncryptionList, XmlParseError> {
deserialize_elements::<_, FieldLevelEncryptionList, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Items" => {
obj.items.get_or_insert(vec![]).extend(
FieldLevelEncryptionSummaryListDeserializer::deserialize(
"Items", stack,
)?,
);
}
"MaxItems" => {
obj.max_items = IntegerDeserializer::deserialize("MaxItems", stack)?;
}
"NextMarker" => {
obj.next_marker =
Some(StringDeserializer::deserialize("NextMarker", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct FieldLevelEncryptionProfile {
pub field_level_encryption_profile_config: FieldLevelEncryptionProfileConfig,
pub id: String,
pub last_modified_time: String,
}
struct FieldLevelEncryptionProfileDeserializer;
impl FieldLevelEncryptionProfileDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<FieldLevelEncryptionProfile, XmlParseError> {
deserialize_elements::<_, FieldLevelEncryptionProfile, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"FieldLevelEncryptionProfileConfig" => {
obj.field_level_encryption_profile_config =
FieldLevelEncryptionProfileConfigDeserializer::deserialize(
"FieldLevelEncryptionProfileConfig",
stack,
)?;
}
"Id" => {
obj.id = StringDeserializer::deserialize("Id", stack)?;
}
"LastModifiedTime" => {
obj.last_modified_time =
TimestampDeserializer::deserialize("LastModifiedTime", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct FieldLevelEncryptionProfileConfig {
pub caller_reference: String,
pub comment: Option<String>,
pub encryption_entities: EncryptionEntities,
pub name: String,
}
struct FieldLevelEncryptionProfileConfigDeserializer;
impl FieldLevelEncryptionProfileConfigDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<FieldLevelEncryptionProfileConfig, XmlParseError> {
deserialize_elements::<_, FieldLevelEncryptionProfileConfig, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CallerReference" => {
obj.caller_reference =
StringDeserializer::deserialize("CallerReference", stack)?;
}
"Comment" => {
obj.comment = Some(StringDeserializer::deserialize("Comment", stack)?);
}
"EncryptionEntities" => {
obj.encryption_entities = EncryptionEntitiesDeserializer::deserialize(
"EncryptionEntities",
stack,
)?;
}
"Name" => {
obj.name = StringDeserializer::deserialize("Name", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
pub struct FieldLevelEncryptionProfileConfigSerializer;
impl FieldLevelEncryptionProfileConfigSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &FieldLevelEncryptionProfileConfig,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element("CallerReference"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.caller_reference
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.comment {
writer.write(xml::writer::XmlEvent::start_element("Comment"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
EncryptionEntitiesSerializer::serialize(
&mut writer,
"EncryptionEntities",
&obj.encryption_entities,
)?;
writer.write(xml::writer::XmlEvent::start_element("Name"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.name
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct FieldLevelEncryptionProfileList {
pub items: Option<Vec<FieldLevelEncryptionProfileSummary>>,
pub max_items: i64,
pub next_marker: Option<String>,
pub quantity: i64,
}
struct FieldLevelEncryptionProfileListDeserializer;
impl FieldLevelEncryptionProfileListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<FieldLevelEncryptionProfileList, XmlParseError> {
deserialize_elements::<_, FieldLevelEncryptionProfileList, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Items" => {
obj.items.get_or_insert(vec![]).extend(
FieldLevelEncryptionProfileSummaryListDeserializer::deserialize(
"Items", stack,
)?,
);
}
"MaxItems" => {
obj.max_items = IntegerDeserializer::deserialize("MaxItems", stack)?;
}
"NextMarker" => {
obj.next_marker =
Some(StringDeserializer::deserialize("NextMarker", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct FieldLevelEncryptionProfileSummary {
pub comment: Option<String>,
pub encryption_entities: EncryptionEntities,
pub id: String,
pub last_modified_time: String,
pub name: String,
}
struct FieldLevelEncryptionProfileSummaryDeserializer;
impl FieldLevelEncryptionProfileSummaryDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<FieldLevelEncryptionProfileSummary, XmlParseError> {
deserialize_elements::<_, FieldLevelEncryptionProfileSummary, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Comment" => {
obj.comment = Some(StringDeserializer::deserialize("Comment", stack)?);
}
"EncryptionEntities" => {
obj.encryption_entities = EncryptionEntitiesDeserializer::deserialize(
"EncryptionEntities",
stack,
)?;
}
"Id" => {
obj.id = StringDeserializer::deserialize("Id", stack)?;
}
"LastModifiedTime" => {
obj.last_modified_time =
TimestampDeserializer::deserialize("LastModifiedTime", stack)?;
}
"Name" => {
obj.name = StringDeserializer::deserialize("Name", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct FieldLevelEncryptionProfileSummaryListDeserializer;
impl FieldLevelEncryptionProfileSummaryListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<FieldLevelEncryptionProfileSummary>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "FieldLevelEncryptionProfileSummary" {
obj.push(FieldLevelEncryptionProfileSummaryDeserializer::deserialize(
"FieldLevelEncryptionProfileSummary",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct FieldLevelEncryptionSummary {
pub comment: Option<String>,
pub content_type_profile_config: Option<ContentTypeProfileConfig>,
pub id: String,
pub last_modified_time: String,
pub query_arg_profile_config: Option<QueryArgProfileConfig>,
}
struct FieldLevelEncryptionSummaryDeserializer;
impl FieldLevelEncryptionSummaryDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<FieldLevelEncryptionSummary, XmlParseError> {
deserialize_elements::<_, FieldLevelEncryptionSummary, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Comment" => {
obj.comment = Some(StringDeserializer::deserialize("Comment", stack)?);
}
"ContentTypeProfileConfig" => {
obj.content_type_profile_config =
Some(ContentTypeProfileConfigDeserializer::deserialize(
"ContentTypeProfileConfig",
stack,
)?);
}
"Id" => {
obj.id = StringDeserializer::deserialize("Id", stack)?;
}
"LastModifiedTime" => {
obj.last_modified_time =
TimestampDeserializer::deserialize("LastModifiedTime", stack)?;
}
"QueryArgProfileConfig" => {
obj.query_arg_profile_config =
Some(QueryArgProfileConfigDeserializer::deserialize(
"QueryArgProfileConfig",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct FieldLevelEncryptionSummaryListDeserializer;
impl FieldLevelEncryptionSummaryListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<FieldLevelEncryptionSummary>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "FieldLevelEncryptionSummary" {
obj.push(FieldLevelEncryptionSummaryDeserializer::deserialize(
"FieldLevelEncryptionSummary",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct FieldPatternListDeserializer;
impl FieldPatternListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<String>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "FieldPattern" {
obj.push(StringDeserializer::deserialize("FieldPattern", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct FieldPatternListSerializer;
impl FieldPatternListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<String>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
StringSerializer::serialize(writer, "FieldPattern", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct FieldPatterns {
pub items: Option<Vec<String>>,
pub quantity: i64,
}
struct FieldPatternsDeserializer;
impl FieldPatternsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<FieldPatterns, XmlParseError> {
deserialize_elements::<_, FieldPatterns, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items
.get_or_insert(vec![])
.extend(FieldPatternListDeserializer::deserialize("Items", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct FieldPatternsSerializer;
impl FieldPatternsSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &FieldPatterns,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.items {
&FieldPatternListSerializer::serialize(&mut writer, "Items", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct FormatDeserializer;
impl FormatDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct FormatSerializer;
impl FormatSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &String,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ForwardedValues {
pub cookies: CookiePreference,
pub headers: Option<Headers>,
pub query_string: bool,
pub query_string_cache_keys: Option<QueryStringCacheKeys>,
}
struct ForwardedValuesDeserializer;
impl ForwardedValuesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ForwardedValues, XmlParseError> {
deserialize_elements::<_, ForwardedValues, _>(tag_name, stack, |name, stack, obj| {
match name {
"Cookies" => {
obj.cookies = CookiePreferenceDeserializer::deserialize("Cookies", stack)?;
}
"Headers" => {
obj.headers = Some(HeadersDeserializer::deserialize("Headers", stack)?);
}
"QueryString" => {
obj.query_string = BooleanDeserializer::deserialize("QueryString", stack)?;
}
"QueryStringCacheKeys" => {
obj.query_string_cache_keys =
Some(QueryStringCacheKeysDeserializer::deserialize(
"QueryStringCacheKeys",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct ForwardedValuesSerializer;
impl ForwardedValuesSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &ForwardedValues,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
CookiePreferenceSerializer::serialize(&mut writer, "Cookies", &obj.cookies)?;
if let Some(ref value) = obj.headers {
&HeadersSerializer::serialize(&mut writer, "Headers", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("QueryString"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.query_string
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.query_string_cache_keys {
&QueryStringCacheKeysSerializer::serialize(&mut writer, "QueryStringCacheKeys", value)?;
}
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GeoRestriction {
pub items: Option<Vec<String>>,
pub quantity: i64,
pub restriction_type: String,
}
struct GeoRestrictionDeserializer;
impl GeoRestrictionDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<GeoRestriction, XmlParseError> {
deserialize_elements::<_, GeoRestriction, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items
.get_or_insert(vec![])
.extend(LocationListDeserializer::deserialize("Items", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
"RestrictionType" => {
obj.restriction_type =
GeoRestrictionTypeDeserializer::deserialize("RestrictionType", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct GeoRestrictionSerializer;
impl GeoRestrictionSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &GeoRestriction,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.items {
&LocationListSerializer::serialize(&mut writer, "Items", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("RestrictionType"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.restriction_type
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct GeoRestrictionTypeDeserializer;
impl GeoRestrictionTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct GeoRestrictionTypeSerializer;
impl GeoRestrictionTypeSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &String,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetCloudFrontOriginAccessIdentityConfigRequest {
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetCloudFrontOriginAccessIdentityConfigResult {
pub cloud_front_origin_access_identity_config: Option<CloudFrontOriginAccessIdentityConfig>,
pub e_tag: Option<String>,
}
struct GetCloudFrontOriginAccessIdentityConfigResultDeserializer;
impl GetCloudFrontOriginAccessIdentityConfigResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<GetCloudFrontOriginAccessIdentityConfigResult, XmlParseError> {
Ok(GetCloudFrontOriginAccessIdentityConfigResult {
cloud_front_origin_access_identity_config: Some(
CloudFrontOriginAccessIdentityConfigDeserializer::deserialize(
"CloudFrontOriginAccessIdentityConfig",
stack,
)?,
),
..GetCloudFrontOriginAccessIdentityConfigResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetCloudFrontOriginAccessIdentityRequest {
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetCloudFrontOriginAccessIdentityResult {
pub cloud_front_origin_access_identity: Option<CloudFrontOriginAccessIdentity>,
pub e_tag: Option<String>,
}
struct GetCloudFrontOriginAccessIdentityResultDeserializer;
impl GetCloudFrontOriginAccessIdentityResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<GetCloudFrontOriginAccessIdentityResult, XmlParseError> {
Ok(GetCloudFrontOriginAccessIdentityResult {
cloud_front_origin_access_identity: Some(
CloudFrontOriginAccessIdentityDeserializer::deserialize(
"CloudFrontOriginAccessIdentity",
stack,
)?,
),
..GetCloudFrontOriginAccessIdentityResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetDistributionConfigRequest {
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetDistributionConfigResult {
pub distribution_config: Option<DistributionConfig>,
pub e_tag: Option<String>,
}
struct GetDistributionConfigResultDeserializer;
impl GetDistributionConfigResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<GetDistributionConfigResult, XmlParseError> {
Ok(GetDistributionConfigResult {
distribution_config: Some(DistributionConfigDeserializer::deserialize(
"DistributionConfig",
stack,
)?),
..GetDistributionConfigResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetDistributionRequest {
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetDistributionResult {
pub distribution: Option<Distribution>,
pub e_tag: Option<String>,
}
struct GetDistributionResultDeserializer;
impl GetDistributionResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<GetDistributionResult, XmlParseError> {
Ok(GetDistributionResult {
distribution: Some(DistributionDeserializer::deserialize(
"Distribution",
stack,
)?),
..GetDistributionResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetFieldLevelEncryptionConfigRequest {
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetFieldLevelEncryptionConfigResult {
pub e_tag: Option<String>,
pub field_level_encryption_config: Option<FieldLevelEncryptionConfig>,
}
struct GetFieldLevelEncryptionConfigResultDeserializer;
impl GetFieldLevelEncryptionConfigResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<GetFieldLevelEncryptionConfigResult, XmlParseError> {
Ok(GetFieldLevelEncryptionConfigResult {
field_level_encryption_config: Some(
FieldLevelEncryptionConfigDeserializer::deserialize(
"FieldLevelEncryptionConfig",
stack,
)?,
),
..GetFieldLevelEncryptionConfigResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetFieldLevelEncryptionProfileConfigRequest {
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetFieldLevelEncryptionProfileConfigResult {
pub e_tag: Option<String>,
pub field_level_encryption_profile_config: Option<FieldLevelEncryptionProfileConfig>,
}
struct GetFieldLevelEncryptionProfileConfigResultDeserializer;
impl GetFieldLevelEncryptionProfileConfigResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<GetFieldLevelEncryptionProfileConfigResult, XmlParseError> {
Ok(GetFieldLevelEncryptionProfileConfigResult {
field_level_encryption_profile_config: Some(
FieldLevelEncryptionProfileConfigDeserializer::deserialize(
"FieldLevelEncryptionProfileConfig",
stack,
)?,
),
..GetFieldLevelEncryptionProfileConfigResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetFieldLevelEncryptionProfileRequest {
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetFieldLevelEncryptionProfileResult {
pub e_tag: Option<String>,
pub field_level_encryption_profile: Option<FieldLevelEncryptionProfile>,
}
struct GetFieldLevelEncryptionProfileResultDeserializer;
impl GetFieldLevelEncryptionProfileResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<GetFieldLevelEncryptionProfileResult, XmlParseError> {
Ok(GetFieldLevelEncryptionProfileResult {
field_level_encryption_profile: Some(
FieldLevelEncryptionProfileDeserializer::deserialize(
"FieldLevelEncryptionProfile",
stack,
)?,
),
..GetFieldLevelEncryptionProfileResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetFieldLevelEncryptionRequest {
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetFieldLevelEncryptionResult {
pub e_tag: Option<String>,
pub field_level_encryption: Option<FieldLevelEncryption>,
}
struct GetFieldLevelEncryptionResultDeserializer;
impl GetFieldLevelEncryptionResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<GetFieldLevelEncryptionResult, XmlParseError> {
Ok(GetFieldLevelEncryptionResult {
field_level_encryption: Some(FieldLevelEncryptionDeserializer::deserialize(
"FieldLevelEncryption",
stack,
)?),
..GetFieldLevelEncryptionResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetInvalidationRequest {
pub distribution_id: String,
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetInvalidationResult {
pub invalidation: Option<Invalidation>,
}
struct GetInvalidationResultDeserializer;
impl GetInvalidationResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<GetInvalidationResult, XmlParseError> {
Ok(GetInvalidationResult {
invalidation: Some(InvalidationDeserializer::deserialize(
"Invalidation",
stack,
)?),
..GetInvalidationResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetPublicKeyConfigRequest {
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetPublicKeyConfigResult {
pub e_tag: Option<String>,
pub public_key_config: Option<PublicKeyConfig>,
}
struct GetPublicKeyConfigResultDeserializer;
impl GetPublicKeyConfigResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<GetPublicKeyConfigResult, XmlParseError> {
Ok(GetPublicKeyConfigResult {
public_key_config: Some(PublicKeyConfigDeserializer::deserialize(
"PublicKeyConfig",
stack,
)?),
..GetPublicKeyConfigResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetPublicKeyRequest {
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetPublicKeyResult {
pub e_tag: Option<String>,
pub public_key: Option<PublicKey>,
}
struct GetPublicKeyResultDeserializer;
impl GetPublicKeyResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<GetPublicKeyResult, XmlParseError> {
Ok(GetPublicKeyResult {
public_key: Some(PublicKeyDeserializer::deserialize("PublicKey", stack)?),
..GetPublicKeyResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetStreamingDistributionConfigRequest {
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetStreamingDistributionConfigResult {
pub e_tag: Option<String>,
pub streaming_distribution_config: Option<StreamingDistributionConfig>,
}
struct GetStreamingDistributionConfigResultDeserializer;
impl GetStreamingDistributionConfigResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<GetStreamingDistributionConfigResult, XmlParseError> {
Ok(GetStreamingDistributionConfigResult {
streaming_distribution_config: Some(
StreamingDistributionConfigDeserializer::deserialize(
"StreamingDistributionConfig",
stack,
)?,
),
..GetStreamingDistributionConfigResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetStreamingDistributionRequest {
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetStreamingDistributionResult {
pub e_tag: Option<String>,
pub streaming_distribution: Option<StreamingDistribution>,
}
struct GetStreamingDistributionResultDeserializer;
impl GetStreamingDistributionResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<GetStreamingDistributionResult, XmlParseError> {
Ok(GetStreamingDistributionResult {
streaming_distribution: Some(StreamingDistributionDeserializer::deserialize(
"StreamingDistribution",
stack,
)?),
..GetStreamingDistributionResult::default()
})
}
}
struct HeaderListDeserializer;
impl HeaderListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<String>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "Name" {
obj.push(StringDeserializer::deserialize("Name", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct HeaderListSerializer;
impl HeaderListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<String>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
StringSerializer::serialize(writer, "Name", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Headers {
pub items: Option<Vec<String>>,
pub quantity: i64,
}
struct HeadersDeserializer;
impl HeadersDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Headers, XmlParseError> {
deserialize_elements::<_, Headers, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items
.get_or_insert(vec![])
.extend(HeaderListDeserializer::deserialize("Items", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct HeadersSerializer;
impl HeadersSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Headers,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.items {
&HeaderListSerializer::serialize(&mut writer, "Items", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct HttpVersionDeserializer;
impl HttpVersionDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct HttpVersionSerializer;
impl HttpVersionSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &String,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct IntegerDeserializer;
impl IntegerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<i64, XmlParseError> {
start_element(tag_name, stack)?;
let obj = i64::from_str(characters(stack)?.as_ref()).unwrap();
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct IntegerSerializer;
impl IntegerSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &i64,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Invalidation {
pub create_time: String,
pub id: String,
pub invalidation_batch: InvalidationBatch,
pub status: String,
}
struct InvalidationDeserializer;
impl InvalidationDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Invalidation, XmlParseError> {
deserialize_elements::<_, Invalidation, _>(tag_name, stack, |name, stack, obj| {
match name {
"CreateTime" => {
obj.create_time = TimestampDeserializer::deserialize("CreateTime", stack)?;
}
"Id" => {
obj.id = StringDeserializer::deserialize("Id", stack)?;
}
"InvalidationBatch" => {
obj.invalidation_batch =
InvalidationBatchDeserializer::deserialize("InvalidationBatch", stack)?;
}
"Status" => {
obj.status = StringDeserializer::deserialize("Status", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct InvalidationBatch {
pub caller_reference: String,
pub paths: Paths,
}
struct InvalidationBatchDeserializer;
impl InvalidationBatchDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<InvalidationBatch, XmlParseError> {
deserialize_elements::<_, InvalidationBatch, _>(tag_name, stack, |name, stack, obj| {
match name {
"CallerReference" => {
obj.caller_reference =
StringDeserializer::deserialize("CallerReference", stack)?;
}
"Paths" => {
obj.paths = PathsDeserializer::deserialize("Paths", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct InvalidationBatchSerializer;
impl InvalidationBatchSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &InvalidationBatch,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element("CallerReference"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.caller_reference
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
PathsSerializer::serialize(&mut writer, "Paths", &obj.paths)?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct InvalidationList {
pub is_truncated: bool,
pub items: Option<Vec<InvalidationSummary>>,
pub marker: String,
pub max_items: i64,
pub next_marker: Option<String>,
pub quantity: i64,
}
struct InvalidationListDeserializer;
impl InvalidationListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<InvalidationList, XmlParseError> {
deserialize_elements::<_, InvalidationList, _>(tag_name, stack, |name, stack, obj| {
match name {
"IsTruncated" => {
obj.is_truncated = BooleanDeserializer::deserialize("IsTruncated", stack)?;
}
"Items" => {
obj.items.get_or_insert(vec![]).extend(
InvalidationSummaryListDeserializer::deserialize("Items", stack)?,
);
}
"Marker" => {
obj.marker = StringDeserializer::deserialize("Marker", stack)?;
}
"MaxItems" => {
obj.max_items = IntegerDeserializer::deserialize("MaxItems", stack)?;
}
"NextMarker" => {
obj.next_marker = Some(StringDeserializer::deserialize("NextMarker", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct InvalidationSummary {
pub create_time: String,
pub id: String,
pub status: String,
}
struct InvalidationSummaryDeserializer;
impl InvalidationSummaryDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<InvalidationSummary, XmlParseError> {
deserialize_elements::<_, InvalidationSummary, _>(tag_name, stack, |name, stack, obj| {
match name {
"CreateTime" => {
obj.create_time = TimestampDeserializer::deserialize("CreateTime", stack)?;
}
"Id" => {
obj.id = StringDeserializer::deserialize("Id", stack)?;
}
"Status" => {
obj.status = StringDeserializer::deserialize("Status", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct InvalidationSummaryListDeserializer;
impl InvalidationSummaryListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<InvalidationSummary>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "InvalidationSummary" {
obj.push(InvalidationSummaryDeserializer::deserialize(
"InvalidationSummary",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct ItemSelectionDeserializer;
impl ItemSelectionDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct ItemSelectionSerializer;
impl ItemSelectionSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &String,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct KeyPairIdListDeserializer;
impl KeyPairIdListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<String>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "KeyPairId" {
obj.push(StringDeserializer::deserialize("KeyPairId", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct KeyPairIds {
pub items: Option<Vec<String>>,
pub quantity: i64,
}
struct KeyPairIdsDeserializer;
impl KeyPairIdsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<KeyPairIds, XmlParseError> {
deserialize_elements::<_, KeyPairIds, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items
.get_or_insert(vec![])
.extend(KeyPairIdListDeserializer::deserialize("Items", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct LambdaFunctionARNDeserializer;
impl LambdaFunctionARNDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct LambdaFunctionARNSerializer;
impl LambdaFunctionARNSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &String,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct LambdaFunctionAssociation {
pub event_type: String,
pub include_body: Option<bool>,
pub lambda_function_arn: String,
}
struct LambdaFunctionAssociationDeserializer;
impl LambdaFunctionAssociationDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<LambdaFunctionAssociation, XmlParseError> {
deserialize_elements::<_, LambdaFunctionAssociation, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"EventType" => {
obj.event_type = EventTypeDeserializer::deserialize("EventType", stack)?;
}
"IncludeBody" => {
obj.include_body =
Some(BooleanDeserializer::deserialize("IncludeBody", stack)?);
}
"LambdaFunctionARN" => {
obj.lambda_function_arn =
LambdaFunctionARNDeserializer::deserialize("LambdaFunctionARN", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
pub struct LambdaFunctionAssociationSerializer;
impl LambdaFunctionAssociationSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &LambdaFunctionAssociation,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element("EventType"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.event_type
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.include_body {
writer.write(xml::writer::XmlEvent::start_element("IncludeBody"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
writer.write(xml::writer::XmlEvent::start_element("LambdaFunctionARN"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.lambda_function_arn
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct LambdaFunctionAssociationListDeserializer;
impl LambdaFunctionAssociationListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<LambdaFunctionAssociation>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "LambdaFunctionAssociation" {
obj.push(LambdaFunctionAssociationDeserializer::deserialize(
"LambdaFunctionAssociation",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct LambdaFunctionAssociationListSerializer;
impl LambdaFunctionAssociationListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<LambdaFunctionAssociation>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
LambdaFunctionAssociationSerializer::serialize(
writer,
"LambdaFunctionAssociation",
element,
)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct LambdaFunctionAssociations {
pub items: Option<Vec<LambdaFunctionAssociation>>,
pub quantity: i64,
}
struct LambdaFunctionAssociationsDeserializer;
impl LambdaFunctionAssociationsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<LambdaFunctionAssociations, XmlParseError> {
deserialize_elements::<_, LambdaFunctionAssociations, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Items" => {
obj.items.get_or_insert(vec![]).extend(
LambdaFunctionAssociationListDeserializer::deserialize("Items", stack)?,
);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
pub struct LambdaFunctionAssociationsSerializer;
impl LambdaFunctionAssociationsSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &LambdaFunctionAssociations,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.items {
&LambdaFunctionAssociationListSerializer::serialize(&mut writer, "Items", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListCloudFrontOriginAccessIdentitiesRequest {
pub marker: Option<String>,
pub max_items: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListCloudFrontOriginAccessIdentitiesResult {
pub cloud_front_origin_access_identity_list: Option<CloudFrontOriginAccessIdentityList>,
}
struct ListCloudFrontOriginAccessIdentitiesResultDeserializer;
impl ListCloudFrontOriginAccessIdentitiesResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ListCloudFrontOriginAccessIdentitiesResult, XmlParseError> {
Ok(ListCloudFrontOriginAccessIdentitiesResult {
cloud_front_origin_access_identity_list: Some(
CloudFrontOriginAccessIdentityListDeserializer::deserialize(
"CloudFrontOriginAccessIdentityList",
stack,
)?,
),
..ListCloudFrontOriginAccessIdentitiesResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListDistributionsByWebACLIdRequest {
pub marker: Option<String>,
pub max_items: Option<String>,
pub web_acl_id: String,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListDistributionsByWebACLIdResult {
pub distribution_list: Option<DistributionList>,
}
struct ListDistributionsByWebACLIdResultDeserializer;
impl ListDistributionsByWebACLIdResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ListDistributionsByWebACLIdResult, XmlParseError> {
Ok(ListDistributionsByWebACLIdResult {
distribution_list: Some(DistributionListDeserializer::deserialize(
"DistributionList",
stack,
)?),
..ListDistributionsByWebACLIdResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListDistributionsRequest {
pub marker: Option<String>,
pub max_items: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListDistributionsResult {
pub distribution_list: Option<DistributionList>,
}
struct ListDistributionsResultDeserializer;
impl ListDistributionsResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ListDistributionsResult, XmlParseError> {
Ok(ListDistributionsResult {
distribution_list: Some(DistributionListDeserializer::deserialize(
"DistributionList",
stack,
)?),
..ListDistributionsResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListFieldLevelEncryptionConfigsRequest {
pub marker: Option<String>,
pub max_items: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListFieldLevelEncryptionConfigsResult {
pub field_level_encryption_list: Option<FieldLevelEncryptionList>,
}
struct ListFieldLevelEncryptionConfigsResultDeserializer;
impl ListFieldLevelEncryptionConfigsResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ListFieldLevelEncryptionConfigsResult, XmlParseError> {
Ok(ListFieldLevelEncryptionConfigsResult {
field_level_encryption_list: Some(FieldLevelEncryptionListDeserializer::deserialize(
"FieldLevelEncryptionList",
stack,
)?),
..ListFieldLevelEncryptionConfigsResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListFieldLevelEncryptionProfilesRequest {
pub marker: Option<String>,
pub max_items: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListFieldLevelEncryptionProfilesResult {
pub field_level_encryption_profile_list: Option<FieldLevelEncryptionProfileList>,
}
struct ListFieldLevelEncryptionProfilesResultDeserializer;
impl ListFieldLevelEncryptionProfilesResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ListFieldLevelEncryptionProfilesResult, XmlParseError> {
Ok(ListFieldLevelEncryptionProfilesResult {
field_level_encryption_profile_list: Some(
FieldLevelEncryptionProfileListDeserializer::deserialize(
"FieldLevelEncryptionProfileList",
stack,
)?,
),
..ListFieldLevelEncryptionProfilesResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListInvalidationsRequest {
pub distribution_id: String,
pub marker: Option<String>,
pub max_items: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListInvalidationsResult {
pub invalidation_list: Option<InvalidationList>,
}
struct ListInvalidationsResultDeserializer;
impl ListInvalidationsResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ListInvalidationsResult, XmlParseError> {
Ok(ListInvalidationsResult {
invalidation_list: Some(InvalidationListDeserializer::deserialize(
"InvalidationList",
stack,
)?),
..ListInvalidationsResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListPublicKeysRequest {
pub marker: Option<String>,
pub max_items: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListPublicKeysResult {
pub public_key_list: Option<PublicKeyList>,
}
struct ListPublicKeysResultDeserializer;
impl ListPublicKeysResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ListPublicKeysResult, XmlParseError> {
Ok(ListPublicKeysResult {
public_key_list: Some(PublicKeyListDeserializer::deserialize(
"PublicKeyList",
stack,
)?),
..ListPublicKeysResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListStreamingDistributionsRequest {
pub marker: Option<String>,
pub max_items: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListStreamingDistributionsResult {
pub streaming_distribution_list: Option<StreamingDistributionList>,
}
struct ListStreamingDistributionsResultDeserializer;
impl ListStreamingDistributionsResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ListStreamingDistributionsResult, XmlParseError> {
Ok(ListStreamingDistributionsResult {
streaming_distribution_list: Some(StreamingDistributionListDeserializer::deserialize(
"StreamingDistributionList",
stack,
)?),
..ListStreamingDistributionsResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListTagsForResourceRequest {
pub resource: String,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListTagsForResourceResult {
pub tags: Tags,
}
struct ListTagsForResourceResultDeserializer;
impl ListTagsForResourceResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ListTagsForResourceResult, XmlParseError> {
Ok(ListTagsForResourceResult {
tags: TagsDeserializer::deserialize("Tags", stack)?,
..ListTagsForResourceResult::default()
})
}
}
struct LocationListDeserializer;
impl LocationListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<String>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "Location" {
obj.push(StringDeserializer::deserialize("Location", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct LocationListSerializer;
impl LocationListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<String>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
StringSerializer::serialize(writer, "Location", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct LoggingConfig {
pub bucket: String,
pub enabled: bool,
pub include_cookies: bool,
pub prefix: String,
}
struct LoggingConfigDeserializer;
impl LoggingConfigDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<LoggingConfig, XmlParseError> {
deserialize_elements::<_, LoggingConfig, _>(tag_name, stack, |name, stack, obj| {
match name {
"Bucket" => {
obj.bucket = StringDeserializer::deserialize("Bucket", stack)?;
}
"Enabled" => {
obj.enabled = BooleanDeserializer::deserialize("Enabled", stack)?;
}
"IncludeCookies" => {
obj.include_cookies =
BooleanDeserializer::deserialize("IncludeCookies", stack)?;
}
"Prefix" => {
obj.prefix = StringDeserializer::deserialize("Prefix", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct LoggingConfigSerializer;
impl LoggingConfigSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &LoggingConfig,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element("Bucket"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.bucket
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("Enabled"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.enabled
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("IncludeCookies"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.include_cookies
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("Prefix"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.prefix
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct LongDeserializer;
impl LongDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<i64, XmlParseError> {
start_element(tag_name, stack)?;
let obj = i64::from_str(characters(stack)?.as_ref()).unwrap();
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct LongSerializer;
impl LongSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &i64,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct MethodDeserializer;
impl MethodDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct MethodSerializer;
impl MethodSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &String,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct MethodsListDeserializer;
impl MethodsListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<String>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "Method" {
obj.push(MethodDeserializer::deserialize("Method", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct MethodsListSerializer;
impl MethodsListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<String>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
MethodSerializer::serialize(writer, "Method", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
struct MinimumProtocolVersionDeserializer;
impl MinimumProtocolVersionDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct MinimumProtocolVersionSerializer;
impl MinimumProtocolVersionSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &String,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Origin {
pub custom_headers: Option<CustomHeaders>,
pub custom_origin_config: Option<CustomOriginConfig>,
pub domain_name: String,
pub id: String,
pub origin_path: Option<String>,
pub s3_origin_config: Option<S3OriginConfig>,
}
struct OriginDeserializer;
impl OriginDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<Origin, XmlParseError> {
deserialize_elements::<_, Origin, _>(tag_name, stack, |name, stack, obj| {
match name {
"CustomHeaders" => {
obj.custom_headers = Some(CustomHeadersDeserializer::deserialize(
"CustomHeaders",
stack,
)?);
}
"CustomOriginConfig" => {
obj.custom_origin_config = Some(CustomOriginConfigDeserializer::deserialize(
"CustomOriginConfig",
stack,
)?);
}
"DomainName" => {
obj.domain_name = StringDeserializer::deserialize("DomainName", stack)?;
}
"Id" => {
obj.id = StringDeserializer::deserialize("Id", stack)?;
}
"OriginPath" => {
obj.origin_path = Some(StringDeserializer::deserialize("OriginPath", stack)?);
}
"S3OriginConfig" => {
obj.s3_origin_config = Some(S3OriginConfigDeserializer::deserialize(
"S3OriginConfig",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct OriginSerializer;
impl OriginSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Origin,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.custom_headers {
&CustomHeadersSerializer::serialize(&mut writer, "CustomHeaders", value)?;
}
if let Some(ref value) = obj.custom_origin_config {
&CustomOriginConfigSerializer::serialize(&mut writer, "CustomOriginConfig", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("DomainName"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.domain_name
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("Id"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.id
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.origin_path {
writer.write(xml::writer::XmlEvent::start_element("OriginPath"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
if let Some(ref value) = obj.s3_origin_config {
&S3OriginConfigSerializer::serialize(&mut writer, "S3OriginConfig", value)?;
}
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct OriginCustomHeader {
pub header_name: String,
pub header_value: String,
}
struct OriginCustomHeaderDeserializer;
impl OriginCustomHeaderDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<OriginCustomHeader, XmlParseError> {
deserialize_elements::<_, OriginCustomHeader, _>(tag_name, stack, |name, stack, obj| {
match name {
"HeaderName" => {
obj.header_name = StringDeserializer::deserialize("HeaderName", stack)?;
}
"HeaderValue" => {
obj.header_value = StringDeserializer::deserialize("HeaderValue", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct OriginCustomHeaderSerializer;
impl OriginCustomHeaderSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &OriginCustomHeader,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element("HeaderName"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.header_name
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("HeaderValue"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.header_value
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct OriginCustomHeadersListDeserializer;
impl OriginCustomHeadersListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<OriginCustomHeader>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "OriginCustomHeader" {
obj.push(OriginCustomHeaderDeserializer::deserialize(
"OriginCustomHeader",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct OriginCustomHeadersListSerializer;
impl OriginCustomHeadersListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<OriginCustomHeader>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
OriginCustomHeaderSerializer::serialize(writer, "OriginCustomHeader", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct OriginGroup {
pub failover_criteria: OriginGroupFailoverCriteria,
pub id: String,
pub members: OriginGroupMembers,
}
struct OriginGroupDeserializer;
impl OriginGroupDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<OriginGroup, XmlParseError> {
deserialize_elements::<_, OriginGroup, _>(tag_name, stack, |name, stack, obj| {
match name {
"FailoverCriteria" => {
obj.failover_criteria = OriginGroupFailoverCriteriaDeserializer::deserialize(
"FailoverCriteria",
stack,
)?;
}
"Id" => {
obj.id = StringDeserializer::deserialize("Id", stack)?;
}
"Members" => {
obj.members = OriginGroupMembersDeserializer::deserialize("Members", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct OriginGroupSerializer;
impl OriginGroupSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &OriginGroup,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
OriginGroupFailoverCriteriaSerializer::serialize(
&mut writer,
"FailoverCriteria",
&obj.failover_criteria,
)?;
writer.write(xml::writer::XmlEvent::start_element("Id"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.id
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
OriginGroupMembersSerializer::serialize(&mut writer, "Members", &obj.members)?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct OriginGroupFailoverCriteria {
pub status_codes: StatusCodes,
}
struct OriginGroupFailoverCriteriaDeserializer;
impl OriginGroupFailoverCriteriaDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<OriginGroupFailoverCriteria, XmlParseError> {
deserialize_elements::<_, OriginGroupFailoverCriteria, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"StatusCodes" => {
obj.status_codes =
StatusCodesDeserializer::deserialize("StatusCodes", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
pub struct OriginGroupFailoverCriteriaSerializer;
impl OriginGroupFailoverCriteriaSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &OriginGroupFailoverCriteria,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
StatusCodesSerializer::serialize(&mut writer, "StatusCodes", &obj.status_codes)?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct OriginGroupListDeserializer;
impl OriginGroupListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<OriginGroup>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "OriginGroup" {
obj.push(OriginGroupDeserializer::deserialize("OriginGroup", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct OriginGroupListSerializer;
impl OriginGroupListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<OriginGroup>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
OriginGroupSerializer::serialize(writer, "OriginGroup", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct OriginGroupMember {
pub origin_id: String,
}
struct OriginGroupMemberDeserializer;
impl OriginGroupMemberDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<OriginGroupMember, XmlParseError> {
deserialize_elements::<_, OriginGroupMember, _>(tag_name, stack, |name, stack, obj| {
match name {
"OriginId" => {
obj.origin_id = StringDeserializer::deserialize("OriginId", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct OriginGroupMemberSerializer;
impl OriginGroupMemberSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &OriginGroupMember,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element("OriginId"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.origin_id
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct OriginGroupMemberListDeserializer;
impl OriginGroupMemberListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<OriginGroupMember>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "OriginGroupMember" {
obj.push(OriginGroupMemberDeserializer::deserialize(
"OriginGroupMember",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct OriginGroupMemberListSerializer;
impl OriginGroupMemberListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<OriginGroupMember>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
OriginGroupMemberSerializer::serialize(writer, "OriginGroupMember", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct OriginGroupMembers {
pub items: Vec<OriginGroupMember>,
pub quantity: i64,
}
struct OriginGroupMembersDeserializer;
impl OriginGroupMembersDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<OriginGroupMembers, XmlParseError> {
deserialize_elements::<_, OriginGroupMembers, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items
.extend(OriginGroupMemberListDeserializer::deserialize(
"Items", stack,
)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct OriginGroupMembersSerializer;
impl OriginGroupMembersSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &OriginGroupMembers,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
OriginGroupMemberListSerializer::serialize(&mut writer, "Items", &obj.items)?;
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct OriginGroups {
pub items: Option<Vec<OriginGroup>>,
pub quantity: i64,
}
struct OriginGroupsDeserializer;
impl OriginGroupsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<OriginGroups, XmlParseError> {
deserialize_elements::<_, OriginGroups, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items
.get_or_insert(vec![])
.extend(OriginGroupListDeserializer::deserialize("Items", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct OriginGroupsSerializer;
impl OriginGroupsSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &OriginGroups,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.items {
&OriginGroupListSerializer::serialize(&mut writer, "Items", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct OriginListDeserializer;
impl OriginListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<Origin>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "Origin" {
obj.push(OriginDeserializer::deserialize("Origin", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct OriginListSerializer;
impl OriginListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<Origin>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
OriginSerializer::serialize(writer, "Origin", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
struct OriginProtocolPolicyDeserializer;
impl OriginProtocolPolicyDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct OriginProtocolPolicySerializer;
impl OriginProtocolPolicySerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &String,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct OriginSslProtocols {
pub items: Vec<String>,
pub quantity: i64,
}
struct OriginSslProtocolsDeserializer;
impl OriginSslProtocolsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<OriginSslProtocols, XmlParseError> {
deserialize_elements::<_, OriginSslProtocols, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items
.extend(SslProtocolsListDeserializer::deserialize("Items", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct OriginSslProtocolsSerializer;
impl OriginSslProtocolsSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &OriginSslProtocols,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
SslProtocolsListSerializer::serialize(&mut writer, "Items", &obj.items)?;
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Origins {
pub items: Vec<Origin>,
pub quantity: i64,
}
struct OriginsDeserializer;
impl OriginsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Origins, XmlParseError> {
deserialize_elements::<_, Origins, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items
.extend(OriginListDeserializer::deserialize("Items", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct OriginsSerializer;
impl OriginsSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Origins,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
OriginListSerializer::serialize(&mut writer, "Items", &obj.items)?;
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct PathListDeserializer;
impl PathListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<String>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "Path" {
obj.push(StringDeserializer::deserialize("Path", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct PathListSerializer;
impl PathListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<String>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
StringSerializer::serialize(writer, "Path", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Paths {
pub items: Option<Vec<String>>,
pub quantity: i64,
}
struct PathsDeserializer;
impl PathsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<Paths, XmlParseError> {
deserialize_elements::<_, Paths, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items
.get_or_insert(vec![])
.extend(PathListDeserializer::deserialize("Items", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct PathsSerializer;
impl PathsSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Paths,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.items {
&PathListSerializer::serialize(&mut writer, "Items", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct PriceClassDeserializer;
impl PriceClassDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct PriceClassSerializer;
impl PriceClassSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &String,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct PublicKey {
pub created_time: String,
pub id: String,
pub public_key_config: PublicKeyConfig,
}
struct PublicKeyDeserializer;
impl PublicKeyDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<PublicKey, XmlParseError> {
deserialize_elements::<_, PublicKey, _>(tag_name, stack, |name, stack, obj| {
match name {
"CreatedTime" => {
obj.created_time = TimestampDeserializer::deserialize("CreatedTime", stack)?;
}
"Id" => {
obj.id = StringDeserializer::deserialize("Id", stack)?;
}
"PublicKeyConfig" => {
obj.public_key_config =
PublicKeyConfigDeserializer::deserialize("PublicKeyConfig", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct PublicKeyConfig {
pub caller_reference: String,
pub comment: Option<String>,
pub encoded_key: String,
pub name: String,
}
struct PublicKeyConfigDeserializer;
impl PublicKeyConfigDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<PublicKeyConfig, XmlParseError> {
deserialize_elements::<_, PublicKeyConfig, _>(tag_name, stack, |name, stack, obj| {
match name {
"CallerReference" => {
obj.caller_reference =
StringDeserializer::deserialize("CallerReference", stack)?;
}
"Comment" => {
obj.comment = Some(StringDeserializer::deserialize("Comment", stack)?);
}
"EncodedKey" => {
obj.encoded_key = StringDeserializer::deserialize("EncodedKey", stack)?;
}
"Name" => {
obj.name = StringDeserializer::deserialize("Name", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct PublicKeyConfigSerializer;
impl PublicKeyConfigSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &PublicKeyConfig,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element("CallerReference"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.caller_reference
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.comment {
writer.write(xml::writer::XmlEvent::start_element("Comment"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
writer.write(xml::writer::XmlEvent::start_element("EncodedKey"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.encoded_key
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("Name"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.name
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct PublicKeyList {
pub items: Option<Vec<PublicKeySummary>>,
pub max_items: i64,
pub next_marker: Option<String>,
pub quantity: i64,
}
struct PublicKeyListDeserializer;
impl PublicKeyListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<PublicKeyList, XmlParseError> {
deserialize_elements::<_, PublicKeyList, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items.get_or_insert(vec![]).extend(
PublicKeySummaryListDeserializer::deserialize("Items", stack)?,
);
}
"MaxItems" => {
obj.max_items = IntegerDeserializer::deserialize("MaxItems", stack)?;
}
"NextMarker" => {
obj.next_marker = Some(StringDeserializer::deserialize("NextMarker", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct PublicKeySummary {
pub comment: Option<String>,
pub created_time: String,
pub encoded_key: String,
pub id: String,
pub name: String,
}
struct PublicKeySummaryDeserializer;
impl PublicKeySummaryDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<PublicKeySummary, XmlParseError> {
deserialize_elements::<_, PublicKeySummary, _>(tag_name, stack, |name, stack, obj| {
match name {
"Comment" => {
obj.comment = Some(StringDeserializer::deserialize("Comment", stack)?);
}
"CreatedTime" => {
obj.created_time = TimestampDeserializer::deserialize("CreatedTime", stack)?;
}
"EncodedKey" => {
obj.encoded_key = StringDeserializer::deserialize("EncodedKey", stack)?;
}
"Id" => {
obj.id = StringDeserializer::deserialize("Id", stack)?;
}
"Name" => {
obj.name = StringDeserializer::deserialize("Name", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct PublicKeySummaryListDeserializer;
impl PublicKeySummaryListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<PublicKeySummary>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "PublicKeySummary" {
obj.push(PublicKeySummaryDeserializer::deserialize(
"PublicKeySummary",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct QueryArgProfile {
pub profile_id: String,
pub query_arg: String,
}
struct QueryArgProfileDeserializer;
impl QueryArgProfileDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<QueryArgProfile, XmlParseError> {
deserialize_elements::<_, QueryArgProfile, _>(tag_name, stack, |name, stack, obj| {
match name {
"ProfileId" => {
obj.profile_id = StringDeserializer::deserialize("ProfileId", stack)?;
}
"QueryArg" => {
obj.query_arg = StringDeserializer::deserialize("QueryArg", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct QueryArgProfileSerializer;
impl QueryArgProfileSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &QueryArgProfile,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element("ProfileId"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.profile_id
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("QueryArg"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.query_arg
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct QueryArgProfileConfig {
pub forward_when_query_arg_profile_is_unknown: bool,
pub query_arg_profiles: Option<QueryArgProfiles>,
}
struct QueryArgProfileConfigDeserializer;
impl QueryArgProfileConfigDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<QueryArgProfileConfig, XmlParseError> {
deserialize_elements::<_, QueryArgProfileConfig, _>(tag_name, stack, |name, stack, obj| {
match name {
"ForwardWhenQueryArgProfileIsUnknown" => {
obj.forward_when_query_arg_profile_is_unknown =
BooleanDeserializer::deserialize(
"ForwardWhenQueryArgProfileIsUnknown",
stack,
)?;
}
"QueryArgProfiles" => {
obj.query_arg_profiles = Some(QueryArgProfilesDeserializer::deserialize(
"QueryArgProfiles",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct QueryArgProfileConfigSerializer;
impl QueryArgProfileConfigSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &QueryArgProfileConfig,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element(
"ForwardWhenQueryArgProfileIsUnknown",
))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.forward_when_query_arg_profile_is_unknown
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.query_arg_profiles {
&QueryArgProfilesSerializer::serialize(&mut writer, "QueryArgProfiles", value)?;
}
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct QueryArgProfileListDeserializer;
impl QueryArgProfileListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<QueryArgProfile>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "QueryArgProfile" {
obj.push(QueryArgProfileDeserializer::deserialize(
"QueryArgProfile",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct QueryArgProfileListSerializer;
impl QueryArgProfileListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<QueryArgProfile>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
QueryArgProfileSerializer::serialize(writer, "QueryArgProfile", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct QueryArgProfiles {
pub items: Option<Vec<QueryArgProfile>>,
pub quantity: i64,
}
struct QueryArgProfilesDeserializer;
impl QueryArgProfilesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<QueryArgProfiles, XmlParseError> {
deserialize_elements::<_, QueryArgProfiles, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items.get_or_insert(vec![]).extend(
QueryArgProfileListDeserializer::deserialize("Items", stack)?,
);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct QueryArgProfilesSerializer;
impl QueryArgProfilesSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &QueryArgProfiles,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.items {
&QueryArgProfileListSerializer::serialize(&mut writer, "Items", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct QueryStringCacheKeys {
pub items: Option<Vec<String>>,
pub quantity: i64,
}
struct QueryStringCacheKeysDeserializer;
impl QueryStringCacheKeysDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<QueryStringCacheKeys, XmlParseError> {
deserialize_elements::<_, QueryStringCacheKeys, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items.get_or_insert(vec![]).extend(
QueryStringCacheKeysListDeserializer::deserialize("Items", stack)?,
);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct QueryStringCacheKeysSerializer;
impl QueryStringCacheKeysSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &QueryStringCacheKeys,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.items {
&QueryStringCacheKeysListSerializer::serialize(&mut writer, "Items", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct QueryStringCacheKeysListDeserializer;
impl QueryStringCacheKeysListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<String>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "Name" {
obj.push(StringDeserializer::deserialize("Name", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct QueryStringCacheKeysListSerializer;
impl QueryStringCacheKeysListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<String>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
StringSerializer::serialize(writer, "Name", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
pub struct ResourceARNSerializer;
impl ResourceARNSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &String,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Restrictions {
pub geo_restriction: GeoRestriction,
}
struct RestrictionsDeserializer;
impl RestrictionsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Restrictions, XmlParseError> {
deserialize_elements::<_, Restrictions, _>(tag_name, stack, |name, stack, obj| {
match name {
"GeoRestriction" => {
obj.geo_restriction =
GeoRestrictionDeserializer::deserialize("GeoRestriction", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct RestrictionsSerializer;
impl RestrictionsSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Restrictions,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
GeoRestrictionSerializer::serialize(&mut writer, "GeoRestriction", &obj.geo_restriction)?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct S3Origin {
pub domain_name: String,
pub origin_access_identity: String,
}
struct S3OriginDeserializer;
impl S3OriginDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<S3Origin, XmlParseError> {
deserialize_elements::<_, S3Origin, _>(tag_name, stack, |name, stack, obj| {
match name {
"DomainName" => {
obj.domain_name = StringDeserializer::deserialize("DomainName", stack)?;
}
"OriginAccessIdentity" => {
obj.origin_access_identity =
StringDeserializer::deserialize("OriginAccessIdentity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct S3OriginSerializer;
impl S3OriginSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &S3Origin,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element("DomainName"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.domain_name
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("OriginAccessIdentity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.origin_access_identity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct S3OriginConfig {
pub origin_access_identity: String,
}
struct S3OriginConfigDeserializer;
impl S3OriginConfigDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<S3OriginConfig, XmlParseError> {
deserialize_elements::<_, S3OriginConfig, _>(tag_name, stack, |name, stack, obj| {
match name {
"OriginAccessIdentity" => {
obj.origin_access_identity =
StringDeserializer::deserialize("OriginAccessIdentity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct S3OriginConfigSerializer;
impl S3OriginConfigSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &S3OriginConfig,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element("OriginAccessIdentity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.origin_access_identity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct SSLSupportMethodDeserializer;
impl SSLSupportMethodDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct SSLSupportMethodSerializer;
impl SSLSupportMethodSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &String,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Signer {
pub aws_account_number: Option<String>,
pub key_pair_ids: Option<KeyPairIds>,
}
struct SignerDeserializer;
impl SignerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<Signer, XmlParseError> {
deserialize_elements::<_, Signer, _>(tag_name, stack, |name, stack, obj| {
match name {
"AwsAccountNumber" => {
obj.aws_account_number =
Some(StringDeserializer::deserialize("AwsAccountNumber", stack)?);
}
"KeyPairIds" => {
obj.key_pair_ids =
Some(KeyPairIdsDeserializer::deserialize("KeyPairIds", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct SignerListDeserializer;
impl SignerListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<Signer>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "Signer" {
obj.push(SignerDeserializer::deserialize("Signer", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct SslProtocolDeserializer;
impl SslProtocolDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct SslProtocolSerializer;
impl SslProtocolSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &String,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct SslProtocolsListDeserializer;
impl SslProtocolsListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<String>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "SslProtocol" {
obj.push(SslProtocolDeserializer::deserialize("SslProtocol", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct SslProtocolsListSerializer;
impl SslProtocolsListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<String>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
SslProtocolSerializer::serialize(writer, "SslProtocol", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
struct StatusCodeListDeserializer;
impl StatusCodeListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<i64>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "StatusCode" {
obj.push(IntegerDeserializer::deserialize("StatusCode", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct StatusCodeListSerializer;
impl StatusCodeListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<i64>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
IntegerSerializer::serialize(writer, "StatusCode", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct StatusCodes {
pub items: Vec<i64>,
pub quantity: i64,
}
struct StatusCodesDeserializer;
impl StatusCodesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<StatusCodes, XmlParseError> {
deserialize_elements::<_, StatusCodes, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items
.extend(StatusCodeListDeserializer::deserialize("Items", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct StatusCodesSerializer;
impl StatusCodesSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &StatusCodes,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
StatusCodeListSerializer::serialize(&mut writer, "Items", &obj.items)?;
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct StreamingDistribution {
pub arn: String,
pub active_trusted_signers: ActiveTrustedSigners,
pub domain_name: String,
pub id: String,
pub last_modified_time: Option<String>,
pub status: String,
pub streaming_distribution_config: StreamingDistributionConfig,
}
struct StreamingDistributionDeserializer;
impl StreamingDistributionDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<StreamingDistribution, XmlParseError> {
deserialize_elements::<_, StreamingDistribution, _>(tag_name, stack, |name, stack, obj| {
match name {
"ARN" => {
obj.arn = StringDeserializer::deserialize("ARN", stack)?;
}
"ActiveTrustedSigners" => {
obj.active_trusted_signers = ActiveTrustedSignersDeserializer::deserialize(
"ActiveTrustedSigners",
stack,
)?;
}
"DomainName" => {
obj.domain_name = StringDeserializer::deserialize("DomainName", stack)?;
}
"Id" => {
obj.id = StringDeserializer::deserialize("Id", stack)?;
}
"LastModifiedTime" => {
obj.last_modified_time = Some(TimestampDeserializer::deserialize(
"LastModifiedTime",
stack,
)?);
}
"Status" => {
obj.status = StringDeserializer::deserialize("Status", stack)?;
}
"StreamingDistributionConfig" => {
obj.streaming_distribution_config =
StreamingDistributionConfigDeserializer::deserialize(
"StreamingDistributionConfig",
stack,
)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct StreamingDistributionConfig {
pub aliases: Option<Aliases>,
pub caller_reference: String,
pub comment: String,
pub enabled: bool,
pub logging: Option<StreamingLoggingConfig>,
pub price_class: Option<String>,
pub s3_origin: S3Origin,
pub trusted_signers: TrustedSigners,
}
struct StreamingDistributionConfigDeserializer;
impl StreamingDistributionConfigDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<StreamingDistributionConfig, XmlParseError> {
deserialize_elements::<_, StreamingDistributionConfig, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Aliases" => {
obj.aliases = Some(AliasesDeserializer::deserialize("Aliases", stack)?);
}
"CallerReference" => {
obj.caller_reference =
StringDeserializer::deserialize("CallerReference", stack)?;
}
"Comment" => {
obj.comment = StringDeserializer::deserialize("Comment", stack)?;
}
"Enabled" => {
obj.enabled = BooleanDeserializer::deserialize("Enabled", stack)?;
}
"Logging" => {
obj.logging = Some(StreamingLoggingConfigDeserializer::deserialize(
"Logging", stack,
)?);
}
"PriceClass" => {
obj.price_class =
Some(PriceClassDeserializer::deserialize("PriceClass", stack)?);
}
"S3Origin" => {
obj.s3_origin = S3OriginDeserializer::deserialize("S3Origin", stack)?;
}
"TrustedSigners" => {
obj.trusted_signers =
TrustedSignersDeserializer::deserialize("TrustedSigners", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
pub struct StreamingDistributionConfigSerializer;
impl StreamingDistributionConfigSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &StreamingDistributionConfig,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.aliases {
&AliasesSerializer::serialize(&mut writer, "Aliases", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("CallerReference"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.caller_reference
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("Comment"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.comment
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("Enabled"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.enabled
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.logging {
&StreamingLoggingConfigSerializer::serialize(&mut writer, "Logging", value)?;
}
if let Some(ref value) = obj.price_class {
writer.write(xml::writer::XmlEvent::start_element("PriceClass"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
S3OriginSerializer::serialize(&mut writer, "S3Origin", &obj.s3_origin)?;
TrustedSignersSerializer::serialize(&mut writer, "TrustedSigners", &obj.trusted_signers)?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct StreamingDistributionConfigWithTags {
pub streaming_distribution_config: StreamingDistributionConfig,
pub tags: Tags,
}
pub struct StreamingDistributionConfigWithTagsSerializer;
impl StreamingDistributionConfigWithTagsSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &StreamingDistributionConfigWithTags,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
StreamingDistributionConfigSerializer::serialize(
&mut writer,
"StreamingDistributionConfig",
&obj.streaming_distribution_config,
)?;
TagsSerializer::serialize(&mut writer, "Tags", &obj.tags)?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct StreamingDistributionList {
pub is_truncated: bool,
pub items: Option<Vec<StreamingDistributionSummary>>,
pub marker: String,
pub max_items: i64,
pub next_marker: Option<String>,
pub quantity: i64,
}
struct StreamingDistributionListDeserializer;
impl StreamingDistributionListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<StreamingDistributionList, XmlParseError> {
deserialize_elements::<_, StreamingDistributionList, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"IsTruncated" => {
obj.is_truncated = BooleanDeserializer::deserialize("IsTruncated", stack)?;
}
"Items" => {
obj.items.get_or_insert(vec![]).extend(
StreamingDistributionSummaryListDeserializer::deserialize(
"Items", stack,
)?,
);
}
"Marker" => {
obj.marker = StringDeserializer::deserialize("Marker", stack)?;
}
"MaxItems" => {
obj.max_items = IntegerDeserializer::deserialize("MaxItems", stack)?;
}
"NextMarker" => {
obj.next_marker =
Some(StringDeserializer::deserialize("NextMarker", stack)?);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct StreamingDistributionSummary {
pub arn: String,
pub aliases: Aliases,
pub comment: String,
pub domain_name: String,
pub enabled: bool,
pub id: String,
pub last_modified_time: String,
pub price_class: String,
pub s3_origin: S3Origin,
pub status: String,
pub trusted_signers: TrustedSigners,
}
struct StreamingDistributionSummaryDeserializer;
impl StreamingDistributionSummaryDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<StreamingDistributionSummary, XmlParseError> {
deserialize_elements::<_, StreamingDistributionSummary, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"ARN" => {
obj.arn = StringDeserializer::deserialize("ARN", stack)?;
}
"Aliases" => {
obj.aliases = AliasesDeserializer::deserialize("Aliases", stack)?;
}
"Comment" => {
obj.comment = StringDeserializer::deserialize("Comment", stack)?;
}
"DomainName" => {
obj.domain_name = StringDeserializer::deserialize("DomainName", stack)?;
}
"Enabled" => {
obj.enabled = BooleanDeserializer::deserialize("Enabled", stack)?;
}
"Id" => {
obj.id = StringDeserializer::deserialize("Id", stack)?;
}
"LastModifiedTime" => {
obj.last_modified_time =
TimestampDeserializer::deserialize("LastModifiedTime", stack)?;
}
"PriceClass" => {
obj.price_class = PriceClassDeserializer::deserialize("PriceClass", stack)?;
}
"S3Origin" => {
obj.s3_origin = S3OriginDeserializer::deserialize("S3Origin", stack)?;
}
"Status" => {
obj.status = StringDeserializer::deserialize("Status", stack)?;
}
"TrustedSigners" => {
obj.trusted_signers =
TrustedSignersDeserializer::deserialize("TrustedSigners", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct StreamingDistributionSummaryListDeserializer;
impl StreamingDistributionSummaryListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<StreamingDistributionSummary>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "StreamingDistributionSummary" {
obj.push(StreamingDistributionSummaryDeserializer::deserialize(
"StreamingDistributionSummary",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct StreamingLoggingConfig {
pub bucket: String,
pub enabled: bool,
pub prefix: String,
}
struct StreamingLoggingConfigDeserializer;
impl StreamingLoggingConfigDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<StreamingLoggingConfig, XmlParseError> {
deserialize_elements::<_, StreamingLoggingConfig, _>(tag_name, stack, |name, stack, obj| {
match name {
"Bucket" => {
obj.bucket = StringDeserializer::deserialize("Bucket", stack)?;
}
"Enabled" => {
obj.enabled = BooleanDeserializer::deserialize("Enabled", stack)?;
}
"Prefix" => {
obj.prefix = StringDeserializer::deserialize("Prefix", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct StreamingLoggingConfigSerializer;
impl StreamingLoggingConfigSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &StreamingLoggingConfig,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element("Bucket"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.bucket
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("Enabled"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.enabled
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::start_element("Prefix"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.prefix
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct StringDeserializer;
impl StringDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct StringSerializer;
impl StringSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &String,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Tag {
pub key: String,
pub value: Option<String>,
}
struct TagDeserializer;
impl TagDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<Tag, XmlParseError> {
deserialize_elements::<_, Tag, _>(tag_name, stack, |name, stack, obj| {
match name {
"Key" => {
obj.key = TagKeyDeserializer::deserialize("Key", stack)?;
}
"Value" => {
obj.value = Some(TagValueDeserializer::deserialize("Value", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct TagSerializer;
impl TagSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Tag,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element("Key"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.key
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.value {
writer.write(xml::writer::XmlEvent::start_element("Value"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct TagKeyDeserializer;
impl TagKeyDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct TagKeySerializer;
impl TagKeySerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &String,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
pub struct TagKeyListSerializer;
impl TagKeyListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<String>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
TagKeySerializer::serialize(writer, "Key", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct TagKeys {
pub items: Option<Vec<String>>,
}
pub struct TagKeysSerializer;
impl TagKeysSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &TagKeys,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.items {
&TagKeyListSerializer::serialize(&mut writer, "Items", value)?;
}
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct TagListDeserializer;
impl TagListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<Tag>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "Tag" {
obj.push(TagDeserializer::deserialize("Tag", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
pub struct TagListSerializer;
impl TagListSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Vec<Tag>,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
for element in obj {
TagSerializer::serialize(writer, "Tag", element)?;
}
writer.write(xml::writer::XmlEvent::end_element())?;
Ok(())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct TagResourceRequest {
pub resource: String,
pub tags: Tags,
}
struct TagValueDeserializer;
impl TagValueDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct TagValueSerializer;
impl TagValueSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &String,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Tags {
pub items: Option<Vec<Tag>>,
}
struct TagsDeserializer;
impl TagsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<Tags, XmlParseError> {
deserialize_elements::<_, Tags, _>(tag_name, stack, |name, stack, obj| {
match name {
"Items" => {
obj.items
.get_or_insert(vec![])
.extend(TagListDeserializer::deserialize("Items", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct TagsSerializer;
impl TagsSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &Tags,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.items {
&TagListSerializer::serialize(&mut writer, "Items", value)?;
}
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct TimestampDeserializer;
impl TimestampDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct TrustedSigners {
pub enabled: bool,
pub items: Option<Vec<String>>,
pub quantity: i64,
}
struct TrustedSignersDeserializer;
impl TrustedSignersDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<TrustedSigners, XmlParseError> {
deserialize_elements::<_, TrustedSigners, _>(tag_name, stack, |name, stack, obj| {
match name {
"Enabled" => {
obj.enabled = BooleanDeserializer::deserialize("Enabled", stack)?;
}
"Items" => {
obj.items.get_or_insert(vec![]).extend(
AwsAccountNumberListDeserializer::deserialize("Items", stack)?,
);
}
"Quantity" => {
obj.quantity = IntegerDeserializer::deserialize("Quantity", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct TrustedSignersSerializer;
impl TrustedSignersSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &TrustedSigners,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::start_element("Enabled"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.enabled
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
if let Some(ref value) = obj.items {
&AwsAccountNumberListSerializer::serialize(&mut writer, "Items", value)?;
}
writer.write(xml::writer::XmlEvent::start_element("Quantity"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.quantity
)))?;
writer.write(xml::writer::XmlEvent::end_element())?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UntagResourceRequest {
pub resource: String,
pub tag_keys: TagKeys,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateCloudFrontOriginAccessIdentityRequest {
pub cloud_front_origin_access_identity_config: CloudFrontOriginAccessIdentityConfig,
pub id: String,
pub if_match: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateCloudFrontOriginAccessIdentityResult {
pub cloud_front_origin_access_identity: Option<CloudFrontOriginAccessIdentity>,
pub e_tag: Option<String>,
}
struct UpdateCloudFrontOriginAccessIdentityResultDeserializer;
impl UpdateCloudFrontOriginAccessIdentityResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<UpdateCloudFrontOriginAccessIdentityResult, XmlParseError> {
Ok(UpdateCloudFrontOriginAccessIdentityResult {
cloud_front_origin_access_identity: Some(
CloudFrontOriginAccessIdentityDeserializer::deserialize(
"CloudFrontOriginAccessIdentity",
stack,
)?,
),
..UpdateCloudFrontOriginAccessIdentityResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateDistributionRequest {
pub distribution_config: DistributionConfig,
pub id: String,
pub if_match: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateDistributionResult {
pub distribution: Option<Distribution>,
pub e_tag: Option<String>,
}
struct UpdateDistributionResultDeserializer;
impl UpdateDistributionResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<UpdateDistributionResult, XmlParseError> {
Ok(UpdateDistributionResult {
distribution: Some(DistributionDeserializer::deserialize(
"Distribution",
stack,
)?),
..UpdateDistributionResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateFieldLevelEncryptionConfigRequest {
pub field_level_encryption_config: FieldLevelEncryptionConfig,
pub id: String,
pub if_match: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateFieldLevelEncryptionConfigResult {
pub e_tag: Option<String>,
pub field_level_encryption: Option<FieldLevelEncryption>,
}
struct UpdateFieldLevelEncryptionConfigResultDeserializer;
impl UpdateFieldLevelEncryptionConfigResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<UpdateFieldLevelEncryptionConfigResult, XmlParseError> {
Ok(UpdateFieldLevelEncryptionConfigResult {
field_level_encryption: Some(FieldLevelEncryptionDeserializer::deserialize(
"FieldLevelEncryption",
stack,
)?),
..UpdateFieldLevelEncryptionConfigResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateFieldLevelEncryptionProfileRequest {
pub field_level_encryption_profile_config: FieldLevelEncryptionProfileConfig,
pub id: String,
pub if_match: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateFieldLevelEncryptionProfileResult {
pub e_tag: Option<String>,
pub field_level_encryption_profile: Option<FieldLevelEncryptionProfile>,
}
struct UpdateFieldLevelEncryptionProfileResultDeserializer;
impl UpdateFieldLevelEncryptionProfileResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<UpdateFieldLevelEncryptionProfileResult, XmlParseError> {
Ok(UpdateFieldLevelEncryptionProfileResult {
field_level_encryption_profile: Some(
FieldLevelEncryptionProfileDeserializer::deserialize(
"FieldLevelEncryptionProfile",
stack,
)?,
),
..UpdateFieldLevelEncryptionProfileResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdatePublicKeyRequest {
pub id: String,
pub if_match: Option<String>,
pub public_key_config: PublicKeyConfig,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdatePublicKeyResult {
pub e_tag: Option<String>,
pub public_key: Option<PublicKey>,
}
struct UpdatePublicKeyResultDeserializer;
impl UpdatePublicKeyResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<UpdatePublicKeyResult, XmlParseError> {
Ok(UpdatePublicKeyResult {
public_key: Some(PublicKeyDeserializer::deserialize("PublicKey", stack)?),
..UpdatePublicKeyResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateStreamingDistributionRequest {
pub id: String,
pub if_match: Option<String>,
pub streaming_distribution_config: StreamingDistributionConfig,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateStreamingDistributionResult {
pub e_tag: Option<String>,
pub streaming_distribution: Option<StreamingDistribution>,
}
struct UpdateStreamingDistributionResultDeserializer;
impl UpdateStreamingDistributionResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<UpdateStreamingDistributionResult, XmlParseError> {
Ok(UpdateStreamingDistributionResult {
streaming_distribution: Some(StreamingDistributionDeserializer::deserialize(
"StreamingDistribution",
stack,
)?),
..UpdateStreamingDistributionResult::default()
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ViewerCertificate {
pub acm_certificate_arn: Option<String>,
pub cloud_front_default_certificate: Option<bool>,
pub iam_certificate_id: Option<String>,
pub minimum_protocol_version: Option<String>,
pub ssl_support_method: Option<String>,
}
struct ViewerCertificateDeserializer;
impl ViewerCertificateDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ViewerCertificate, XmlParseError> {
deserialize_elements::<_, ViewerCertificate, _>(tag_name, stack, |name, stack, obj| {
match name {
"ACMCertificateArn" => {
obj.acm_certificate_arn =
Some(StringDeserializer::deserialize("ACMCertificateArn", stack)?);
}
"CloudFrontDefaultCertificate" => {
obj.cloud_front_default_certificate = Some(BooleanDeserializer::deserialize(
"CloudFrontDefaultCertificate",
stack,
)?);
}
"IAMCertificateId" => {
obj.iam_certificate_id =
Some(StringDeserializer::deserialize("IAMCertificateId", stack)?);
}
"MinimumProtocolVersion" => {
obj.minimum_protocol_version =
Some(MinimumProtocolVersionDeserializer::deserialize(
"MinimumProtocolVersion",
stack,
)?);
}
"SSLSupportMethod" => {
obj.ssl_support_method = Some(SSLSupportMethodDeserializer::deserialize(
"SSLSupportMethod",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
pub struct ViewerCertificateSerializer;
impl ViewerCertificateSerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &ViewerCertificate,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
if let Some(ref value) = obj.acm_certificate_arn {
writer.write(xml::writer::XmlEvent::start_element("ACMCertificateArn"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
if let Some(ref value) = obj.cloud_front_default_certificate {
writer.write(xml::writer::XmlEvent::start_element(
"CloudFrontDefaultCertificate",
))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
if let Some(ref value) = obj.iam_certificate_id {
writer.write(xml::writer::XmlEvent::start_element("IAMCertificateId"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
if let Some(ref value) = obj.minimum_protocol_version {
writer.write(xml::writer::XmlEvent::start_element(
"MinimumProtocolVersion",
))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
if let Some(ref value) = obj.ssl_support_method {
writer.write(xml::writer::XmlEvent::start_element("SSLSupportMethod"))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = value
)));
writer.write(xml::writer::XmlEvent::end_element())?;
}
writer.write(xml::writer::XmlEvent::end_element())
}
}
struct ViewerProtocolPolicyDeserializer;
impl ViewerProtocolPolicyDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
pub struct ViewerProtocolPolicySerializer;
impl ViewerProtocolPolicySerializer {
#[allow(unused_variables, warnings)]
pub fn serialize<W>(
mut writer: &mut EventWriter<W>,
name: &str,
obj: &String,
) -> Result<(), xml::writer::Error>
where
W: Write,
{
writer.write(xml::writer::XmlEvent::start_element(name))?;
writer.write(xml::writer::XmlEvent::characters(&format!(
"{value}",
value = obj.to_string()
)))?;
writer.write(xml::writer::XmlEvent::end_element())
}
}
#[derive(Debug, PartialEq)]
pub enum CreateCloudFrontOriginAccessIdentityError {
CloudFrontOriginAccessIdentityAlreadyExists(String),
InconsistentQuantities(String),
InvalidArgument(String),
MissingBody(String),
TooManyCloudFrontOriginAccessIdentities(String),
}
impl CreateCloudFrontOriginAccessIdentityError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<CreateCloudFrontOriginAccessIdentityError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"CloudFrontOriginAccessIdentityAlreadyExists" => return RusotoError::Service(CreateCloudFrontOriginAccessIdentityError::CloudFrontOriginAccessIdentityAlreadyExists(parsed_error.message)),"InconsistentQuantities" => return RusotoError::Service(CreateCloudFrontOriginAccessIdentityError::InconsistentQuantities(parsed_error.message)),"InvalidArgument" => return RusotoError::Service(CreateCloudFrontOriginAccessIdentityError::InvalidArgument(parsed_error.message)),"MissingBody" => return RusotoError::Service(CreateCloudFrontOriginAccessIdentityError::MissingBody(parsed_error.message)),"TooManyCloudFrontOriginAccessIdentities" => return RusotoError::Service(CreateCloudFrontOriginAccessIdentityError::TooManyCloudFrontOriginAccessIdentities(parsed_error.message)),_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for CreateCloudFrontOriginAccessIdentityError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateCloudFrontOriginAccessIdentityError {
fn description(&self) -> &str {
match *self {
CreateCloudFrontOriginAccessIdentityError::CloudFrontOriginAccessIdentityAlreadyExists(ref cause) => cause,
CreateCloudFrontOriginAccessIdentityError::InconsistentQuantities(ref cause) => cause,
CreateCloudFrontOriginAccessIdentityError::InvalidArgument(ref cause) => cause,
CreateCloudFrontOriginAccessIdentityError::MissingBody(ref cause) => cause,
CreateCloudFrontOriginAccessIdentityError::TooManyCloudFrontOriginAccessIdentities(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateDistributionError {
AccessDenied(String),
CNAMEAlreadyExists(String),
DistributionAlreadyExists(String),
IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior(String),
InconsistentQuantities(String),
InvalidArgument(String),
InvalidDefaultRootObject(String),
InvalidErrorCode(String),
InvalidForwardCookies(String),
InvalidGeoRestrictionParameter(String),
InvalidHeadersForS3Origin(String),
InvalidLambdaFunctionAssociation(String),
InvalidLocationCode(String),
InvalidMinimumProtocolVersion(String),
InvalidOrigin(String),
InvalidOriginAccessIdentity(String),
InvalidOriginKeepaliveTimeout(String),
InvalidOriginReadTimeout(String),
InvalidProtocolSettings(String),
InvalidQueryStringParameters(String),
InvalidRelativePath(String),
InvalidRequiredProtocol(String),
InvalidResponseCode(String),
InvalidTTLOrder(String),
InvalidViewerCertificate(String),
InvalidWebACLId(String),
MissingBody(String),
NoSuchFieldLevelEncryptionConfig(String),
NoSuchOrigin(String),
TooManyCacheBehaviors(String),
TooManyCertificates(String),
TooManyCookieNamesInWhiteList(String),
TooManyDistributionCNAMEs(String),
TooManyDistributions(String),
TooManyDistributionsAssociatedToFieldLevelEncryptionConfig(String),
TooManyDistributionsWithLambdaAssociations(String),
TooManyHeadersInForwardedValues(String),
TooManyLambdaFunctionAssociations(String),
TooManyOriginCustomHeaders(String),
TooManyOriginGroupsPerDistribution(String),
TooManyOrigins(String),
TooManyQueryStringParameters(String),
TooManyTrustedSigners(String),
TrustedSignerDoesNotExist(String),
}
impl CreateDistributionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateDistributionError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => return RusotoError::Service(CreateDistributionError::AccessDenied(parsed_error.message)),"CNAMEAlreadyExists" => return RusotoError::Service(CreateDistributionError::CNAMEAlreadyExists(parsed_error.message)),"DistributionAlreadyExists" => return RusotoError::Service(CreateDistributionError::DistributionAlreadyExists(parsed_error.message)),"IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior" => return RusotoError::Service(CreateDistributionError::IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior(parsed_error.message)),"InconsistentQuantities" => return RusotoError::Service(CreateDistributionError::InconsistentQuantities(parsed_error.message)),"InvalidArgument" => return RusotoError::Service(CreateDistributionError::InvalidArgument(parsed_error.message)),"InvalidDefaultRootObject" => return RusotoError::Service(CreateDistributionError::InvalidDefaultRootObject(parsed_error.message)),"InvalidErrorCode" => return RusotoError::Service(CreateDistributionError::InvalidErrorCode(parsed_error.message)),"InvalidForwardCookies" => return RusotoError::Service(CreateDistributionError::InvalidForwardCookies(parsed_error.message)),"InvalidGeoRestrictionParameter" => return RusotoError::Service(CreateDistributionError::InvalidGeoRestrictionParameter(parsed_error.message)),"InvalidHeadersForS3Origin" => return RusotoError::Service(CreateDistributionError::InvalidHeadersForS3Origin(parsed_error.message)),"InvalidLambdaFunctionAssociation" => return RusotoError::Service(CreateDistributionError::InvalidLambdaFunctionAssociation(parsed_error.message)),"InvalidLocationCode" => return RusotoError::Service(CreateDistributionError::InvalidLocationCode(parsed_error.message)),"InvalidMinimumProtocolVersion" => return RusotoError::Service(CreateDistributionError::InvalidMinimumProtocolVersion(parsed_error.message)),"InvalidOrigin" => return RusotoError::Service(CreateDistributionError::InvalidOrigin(parsed_error.message)),"InvalidOriginAccessIdentity" => return RusotoError::Service(CreateDistributionError::InvalidOriginAccessIdentity(parsed_error.message)),"InvalidOriginKeepaliveTimeout" => return RusotoError::Service(CreateDistributionError::InvalidOriginKeepaliveTimeout(parsed_error.message)),"InvalidOriginReadTimeout" => return RusotoError::Service(CreateDistributionError::InvalidOriginReadTimeout(parsed_error.message)),"InvalidProtocolSettings" => return RusotoError::Service(CreateDistributionError::InvalidProtocolSettings(parsed_error.message)),"InvalidQueryStringParameters" => return RusotoError::Service(CreateDistributionError::InvalidQueryStringParameters(parsed_error.message)),"InvalidRelativePath" => return RusotoError::Service(CreateDistributionError::InvalidRelativePath(parsed_error.message)),"InvalidRequiredProtocol" => return RusotoError::Service(CreateDistributionError::InvalidRequiredProtocol(parsed_error.message)),"InvalidResponseCode" => return RusotoError::Service(CreateDistributionError::InvalidResponseCode(parsed_error.message)),"InvalidTTLOrder" => return RusotoError::Service(CreateDistributionError::InvalidTTLOrder(parsed_error.message)),"InvalidViewerCertificate" => return RusotoError::Service(CreateDistributionError::InvalidViewerCertificate(parsed_error.message)),"InvalidWebACLId" => return RusotoError::Service(CreateDistributionError::InvalidWebACLId(parsed_error.message)),"MissingBody" => return RusotoError::Service(CreateDistributionError::MissingBody(parsed_error.message)),"NoSuchFieldLevelEncryptionConfig" => return RusotoError::Service(CreateDistributionError::NoSuchFieldLevelEncryptionConfig(parsed_error.message)),"NoSuchOrigin" => return RusotoError::Service(CreateDistributionError::NoSuchOrigin(parsed_error.message)),"TooManyCacheBehaviors" => return RusotoError::Service(CreateDistributionError::TooManyCacheBehaviors(parsed_error.message)),"TooManyCertificates" => return RusotoError::Service(CreateDistributionError::TooManyCertificates(parsed_error.message)),"TooManyCookieNamesInWhiteList" => return RusotoError::Service(CreateDistributionError::TooManyCookieNamesInWhiteList(parsed_error.message)),"TooManyDistributionCNAMEs" => return RusotoError::Service(CreateDistributionError::TooManyDistributionCNAMEs(parsed_error.message)),"TooManyDistributions" => return RusotoError::Service(CreateDistributionError::TooManyDistributions(parsed_error.message)),"TooManyDistributionsAssociatedToFieldLevelEncryptionConfig" => return RusotoError::Service(CreateDistributionError::TooManyDistributionsAssociatedToFieldLevelEncryptionConfig(parsed_error.message)),"TooManyDistributionsWithLambdaAssociations" => return RusotoError::Service(CreateDistributionError::TooManyDistributionsWithLambdaAssociations(parsed_error.message)),"TooManyHeadersInForwardedValues" => return RusotoError::Service(CreateDistributionError::TooManyHeadersInForwardedValues(parsed_error.message)),"TooManyLambdaFunctionAssociations" => return RusotoError::Service(CreateDistributionError::TooManyLambdaFunctionAssociations(parsed_error.message)),"TooManyOriginCustomHeaders" => return RusotoError::Service(CreateDistributionError::TooManyOriginCustomHeaders(parsed_error.message)),"TooManyOriginGroupsPerDistribution" => return RusotoError::Service(CreateDistributionError::TooManyOriginGroupsPerDistribution(parsed_error.message)),"TooManyOrigins" => return RusotoError::Service(CreateDistributionError::TooManyOrigins(parsed_error.message)),"TooManyQueryStringParameters" => return RusotoError::Service(CreateDistributionError::TooManyQueryStringParameters(parsed_error.message)),"TooManyTrustedSigners" => return RusotoError::Service(CreateDistributionError::TooManyTrustedSigners(parsed_error.message)),"TrustedSignerDoesNotExist" => return RusotoError::Service(CreateDistributionError::TrustedSignerDoesNotExist(parsed_error.message)),_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for CreateDistributionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateDistributionError {
fn description(&self) -> &str {
match *self {
CreateDistributionError::AccessDenied(ref cause) => cause,
CreateDistributionError::CNAMEAlreadyExists(ref cause) => cause,
CreateDistributionError::DistributionAlreadyExists(ref cause) => cause,
CreateDistributionError::IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior(ref cause) => cause,
CreateDistributionError::InconsistentQuantities(ref cause) => cause,
CreateDistributionError::InvalidArgument(ref cause) => cause,
CreateDistributionError::InvalidDefaultRootObject(ref cause) => cause,
CreateDistributionError::InvalidErrorCode(ref cause) => cause,
CreateDistributionError::InvalidForwardCookies(ref cause) => cause,
CreateDistributionError::InvalidGeoRestrictionParameter(ref cause) => cause,
CreateDistributionError::InvalidHeadersForS3Origin(ref cause) => cause,
CreateDistributionError::InvalidLambdaFunctionAssociation(ref cause) => cause,
CreateDistributionError::InvalidLocationCode(ref cause) => cause,
CreateDistributionError::InvalidMinimumProtocolVersion(ref cause) => cause,
CreateDistributionError::InvalidOrigin(ref cause) => cause,
CreateDistributionError::InvalidOriginAccessIdentity(ref cause) => cause,
CreateDistributionError::InvalidOriginKeepaliveTimeout(ref cause) => cause,
CreateDistributionError::InvalidOriginReadTimeout(ref cause) => cause,
CreateDistributionError::InvalidProtocolSettings(ref cause) => cause,
CreateDistributionError::InvalidQueryStringParameters(ref cause) => cause,
CreateDistributionError::InvalidRelativePath(ref cause) => cause,
CreateDistributionError::InvalidRequiredProtocol(ref cause) => cause,
CreateDistributionError::InvalidResponseCode(ref cause) => cause,
CreateDistributionError::InvalidTTLOrder(ref cause) => cause,
CreateDistributionError::InvalidViewerCertificate(ref cause) => cause,
CreateDistributionError::InvalidWebACLId(ref cause) => cause,
CreateDistributionError::MissingBody(ref cause) => cause,
CreateDistributionError::NoSuchFieldLevelEncryptionConfig(ref cause) => cause,
CreateDistributionError::NoSuchOrigin(ref cause) => cause,
CreateDistributionError::TooManyCacheBehaviors(ref cause) => cause,
CreateDistributionError::TooManyCertificates(ref cause) => cause,
CreateDistributionError::TooManyCookieNamesInWhiteList(ref cause) => cause,
CreateDistributionError::TooManyDistributionCNAMEs(ref cause) => cause,
CreateDistributionError::TooManyDistributions(ref cause) => cause,
CreateDistributionError::TooManyDistributionsAssociatedToFieldLevelEncryptionConfig(ref cause) => cause,
CreateDistributionError::TooManyDistributionsWithLambdaAssociations(ref cause) => cause,
CreateDistributionError::TooManyHeadersInForwardedValues(ref cause) => cause,
CreateDistributionError::TooManyLambdaFunctionAssociations(ref cause) => cause,
CreateDistributionError::TooManyOriginCustomHeaders(ref cause) => cause,
CreateDistributionError::TooManyOriginGroupsPerDistribution(ref cause) => cause,
CreateDistributionError::TooManyOrigins(ref cause) => cause,
CreateDistributionError::TooManyQueryStringParameters(ref cause) => cause,
CreateDistributionError::TooManyTrustedSigners(ref cause) => cause,
CreateDistributionError::TrustedSignerDoesNotExist(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateDistributionWithTagsError {
AccessDenied(String),
CNAMEAlreadyExists(String),
DistributionAlreadyExists(String),
IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior(String),
InconsistentQuantities(String),
InvalidArgument(String),
InvalidDefaultRootObject(String),
InvalidErrorCode(String),
InvalidForwardCookies(String),
InvalidGeoRestrictionParameter(String),
InvalidHeadersForS3Origin(String),
InvalidLambdaFunctionAssociation(String),
InvalidLocationCode(String),
InvalidMinimumProtocolVersion(String),
InvalidOrigin(String),
InvalidOriginAccessIdentity(String),
InvalidOriginKeepaliveTimeout(String),
InvalidOriginReadTimeout(String),
InvalidProtocolSettings(String),
InvalidQueryStringParameters(String),
InvalidRelativePath(String),
InvalidRequiredProtocol(String),
InvalidResponseCode(String),
InvalidTTLOrder(String),
InvalidTagging(String),
InvalidViewerCertificate(String),
InvalidWebACLId(String),
MissingBody(String),
NoSuchFieldLevelEncryptionConfig(String),
NoSuchOrigin(String),
TooManyCacheBehaviors(String),
TooManyCertificates(String),
TooManyCookieNamesInWhiteList(String),
TooManyDistributionCNAMEs(String),
TooManyDistributions(String),
TooManyDistributionsAssociatedToFieldLevelEncryptionConfig(String),
TooManyDistributionsWithLambdaAssociations(String),
TooManyHeadersInForwardedValues(String),
TooManyLambdaFunctionAssociations(String),
TooManyOriginCustomHeaders(String),
TooManyOriginGroupsPerDistribution(String),
TooManyOrigins(String),
TooManyQueryStringParameters(String),
TooManyTrustedSigners(String),
TrustedSignerDoesNotExist(String),
}
impl CreateDistributionWithTagsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<CreateDistributionWithTagsError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => return RusotoError::Service(CreateDistributionWithTagsError::AccessDenied(parsed_error.message)),"CNAMEAlreadyExists" => return RusotoError::Service(CreateDistributionWithTagsError::CNAMEAlreadyExists(parsed_error.message)),"DistributionAlreadyExists" => return RusotoError::Service(CreateDistributionWithTagsError::DistributionAlreadyExists(parsed_error.message)),"IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior" => return RusotoError::Service(CreateDistributionWithTagsError::IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior(parsed_error.message)),"InconsistentQuantities" => return RusotoError::Service(CreateDistributionWithTagsError::InconsistentQuantities(parsed_error.message)),"InvalidArgument" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidArgument(parsed_error.message)),"InvalidDefaultRootObject" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidDefaultRootObject(parsed_error.message)),"InvalidErrorCode" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidErrorCode(parsed_error.message)),"InvalidForwardCookies" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidForwardCookies(parsed_error.message)),"InvalidGeoRestrictionParameter" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidGeoRestrictionParameter(parsed_error.message)),"InvalidHeadersForS3Origin" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidHeadersForS3Origin(parsed_error.message)),"InvalidLambdaFunctionAssociation" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidLambdaFunctionAssociation(parsed_error.message)),"InvalidLocationCode" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidLocationCode(parsed_error.message)),"InvalidMinimumProtocolVersion" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidMinimumProtocolVersion(parsed_error.message)),"InvalidOrigin" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidOrigin(parsed_error.message)),"InvalidOriginAccessIdentity" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidOriginAccessIdentity(parsed_error.message)),"InvalidOriginKeepaliveTimeout" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidOriginKeepaliveTimeout(parsed_error.message)),"InvalidOriginReadTimeout" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidOriginReadTimeout(parsed_error.message)),"InvalidProtocolSettings" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidProtocolSettings(parsed_error.message)),"InvalidQueryStringParameters" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidQueryStringParameters(parsed_error.message)),"InvalidRelativePath" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidRelativePath(parsed_error.message)),"InvalidRequiredProtocol" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidRequiredProtocol(parsed_error.message)),"InvalidResponseCode" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidResponseCode(parsed_error.message)),"InvalidTTLOrder" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidTTLOrder(parsed_error.message)),"InvalidTagging" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidTagging(parsed_error.message)),"InvalidViewerCertificate" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidViewerCertificate(parsed_error.message)),"InvalidWebACLId" => return RusotoError::Service(CreateDistributionWithTagsError::InvalidWebACLId(parsed_error.message)),"MissingBody" => return RusotoError::Service(CreateDistributionWithTagsError::MissingBody(parsed_error.message)),"NoSuchFieldLevelEncryptionConfig" => return RusotoError::Service(CreateDistributionWithTagsError::NoSuchFieldLevelEncryptionConfig(parsed_error.message)),"NoSuchOrigin" => return RusotoError::Service(CreateDistributionWithTagsError::NoSuchOrigin(parsed_error.message)),"TooManyCacheBehaviors" => return RusotoError::Service(CreateDistributionWithTagsError::TooManyCacheBehaviors(parsed_error.message)),"TooManyCertificates" => return RusotoError::Service(CreateDistributionWithTagsError::TooManyCertificates(parsed_error.message)),"TooManyCookieNamesInWhiteList" => return RusotoError::Service(CreateDistributionWithTagsError::TooManyCookieNamesInWhiteList(parsed_error.message)),"TooManyDistributionCNAMEs" => return RusotoError::Service(CreateDistributionWithTagsError::TooManyDistributionCNAMEs(parsed_error.message)),"TooManyDistributions" => return RusotoError::Service(CreateDistributionWithTagsError::TooManyDistributions(parsed_error.message)),"TooManyDistributionsAssociatedToFieldLevelEncryptionConfig" => return RusotoError::Service(CreateDistributionWithTagsError::TooManyDistributionsAssociatedToFieldLevelEncryptionConfig(parsed_error.message)),"TooManyDistributionsWithLambdaAssociations" => return RusotoError::Service(CreateDistributionWithTagsError::TooManyDistributionsWithLambdaAssociations(parsed_error.message)),"TooManyHeadersInForwardedValues" => return RusotoError::Service(CreateDistributionWithTagsError::TooManyHeadersInForwardedValues(parsed_error.message)),"TooManyLambdaFunctionAssociations" => return RusotoError::Service(CreateDistributionWithTagsError::TooManyLambdaFunctionAssociations(parsed_error.message)),"TooManyOriginCustomHeaders" => return RusotoError::Service(CreateDistributionWithTagsError::TooManyOriginCustomHeaders(parsed_error.message)),"TooManyOriginGroupsPerDistribution" => return RusotoError::Service(CreateDistributionWithTagsError::TooManyOriginGroupsPerDistribution(parsed_error.message)),"TooManyOrigins" => return RusotoError::Service(CreateDistributionWithTagsError::TooManyOrigins(parsed_error.message)),"TooManyQueryStringParameters" => return RusotoError::Service(CreateDistributionWithTagsError::TooManyQueryStringParameters(parsed_error.message)),"TooManyTrustedSigners" => return RusotoError::Service(CreateDistributionWithTagsError::TooManyTrustedSigners(parsed_error.message)),"TrustedSignerDoesNotExist" => return RusotoError::Service(CreateDistributionWithTagsError::TrustedSignerDoesNotExist(parsed_error.message)),_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for CreateDistributionWithTagsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateDistributionWithTagsError {
fn description(&self) -> &str {
match *self {
CreateDistributionWithTagsError::AccessDenied(ref cause) => cause,
CreateDistributionWithTagsError::CNAMEAlreadyExists(ref cause) => cause,
CreateDistributionWithTagsError::DistributionAlreadyExists(ref cause) => cause,
CreateDistributionWithTagsError::IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior(ref cause) => cause,
CreateDistributionWithTagsError::InconsistentQuantities(ref cause) => cause,
CreateDistributionWithTagsError::InvalidArgument(ref cause) => cause,
CreateDistributionWithTagsError::InvalidDefaultRootObject(ref cause) => cause,
CreateDistributionWithTagsError::InvalidErrorCode(ref cause) => cause,
CreateDistributionWithTagsError::InvalidForwardCookies(ref cause) => cause,
CreateDistributionWithTagsError::InvalidGeoRestrictionParameter(ref cause) => cause,
CreateDistributionWithTagsError::InvalidHeadersForS3Origin(ref cause) => cause,
CreateDistributionWithTagsError::InvalidLambdaFunctionAssociation(ref cause) => cause,
CreateDistributionWithTagsError::InvalidLocationCode(ref cause) => cause,
CreateDistributionWithTagsError::InvalidMinimumProtocolVersion(ref cause) => cause,
CreateDistributionWithTagsError::InvalidOrigin(ref cause) => cause,
CreateDistributionWithTagsError::InvalidOriginAccessIdentity(ref cause) => cause,
CreateDistributionWithTagsError::InvalidOriginKeepaliveTimeout(ref cause) => cause,
CreateDistributionWithTagsError::InvalidOriginReadTimeout(ref cause) => cause,
CreateDistributionWithTagsError::InvalidProtocolSettings(ref cause) => cause,
CreateDistributionWithTagsError::InvalidQueryStringParameters(ref cause) => cause,
CreateDistributionWithTagsError::InvalidRelativePath(ref cause) => cause,
CreateDistributionWithTagsError::InvalidRequiredProtocol(ref cause) => cause,
CreateDistributionWithTagsError::InvalidResponseCode(ref cause) => cause,
CreateDistributionWithTagsError::InvalidTTLOrder(ref cause) => cause,
CreateDistributionWithTagsError::InvalidTagging(ref cause) => cause,
CreateDistributionWithTagsError::InvalidViewerCertificate(ref cause) => cause,
CreateDistributionWithTagsError::InvalidWebACLId(ref cause) => cause,
CreateDistributionWithTagsError::MissingBody(ref cause) => cause,
CreateDistributionWithTagsError::NoSuchFieldLevelEncryptionConfig(ref cause) => cause,
CreateDistributionWithTagsError::NoSuchOrigin(ref cause) => cause,
CreateDistributionWithTagsError::TooManyCacheBehaviors(ref cause) => cause,
CreateDistributionWithTagsError::TooManyCertificates(ref cause) => cause,
CreateDistributionWithTagsError::TooManyCookieNamesInWhiteList(ref cause) => cause,
CreateDistributionWithTagsError::TooManyDistributionCNAMEs(ref cause) => cause,
CreateDistributionWithTagsError::TooManyDistributions(ref cause) => cause,
CreateDistributionWithTagsError::TooManyDistributionsAssociatedToFieldLevelEncryptionConfig(ref cause) => cause,
CreateDistributionWithTagsError::TooManyDistributionsWithLambdaAssociations(ref cause) => cause,
CreateDistributionWithTagsError::TooManyHeadersInForwardedValues(ref cause) => cause,
CreateDistributionWithTagsError::TooManyLambdaFunctionAssociations(ref cause) => cause,
CreateDistributionWithTagsError::TooManyOriginCustomHeaders(ref cause) => cause,
CreateDistributionWithTagsError::TooManyOriginGroupsPerDistribution(ref cause) => cause,
CreateDistributionWithTagsError::TooManyOrigins(ref cause) => cause,
CreateDistributionWithTagsError::TooManyQueryStringParameters(ref cause) => cause,
CreateDistributionWithTagsError::TooManyTrustedSigners(ref cause) => cause,
CreateDistributionWithTagsError::TrustedSignerDoesNotExist(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateFieldLevelEncryptionConfigError {
FieldLevelEncryptionConfigAlreadyExists(String),
InconsistentQuantities(String),
InvalidArgument(String),
NoSuchFieldLevelEncryptionProfile(String),
QueryArgProfileEmpty(String),
TooManyFieldLevelEncryptionConfigs(String),
TooManyFieldLevelEncryptionContentTypeProfiles(String),
TooManyFieldLevelEncryptionQueryArgProfiles(String),
}
impl CreateFieldLevelEncryptionConfigError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<CreateFieldLevelEncryptionConfigError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"FieldLevelEncryptionConfigAlreadyExists" => return RusotoError::Service(CreateFieldLevelEncryptionConfigError::FieldLevelEncryptionConfigAlreadyExists(parsed_error.message)),"InconsistentQuantities" => return RusotoError::Service(CreateFieldLevelEncryptionConfigError::InconsistentQuantities(parsed_error.message)),"InvalidArgument" => return RusotoError::Service(CreateFieldLevelEncryptionConfigError::InvalidArgument(parsed_error.message)),"NoSuchFieldLevelEncryptionProfile" => return RusotoError::Service(CreateFieldLevelEncryptionConfigError::NoSuchFieldLevelEncryptionProfile(parsed_error.message)),"QueryArgProfileEmpty" => return RusotoError::Service(CreateFieldLevelEncryptionConfigError::QueryArgProfileEmpty(parsed_error.message)),"TooManyFieldLevelEncryptionConfigs" => return RusotoError::Service(CreateFieldLevelEncryptionConfigError::TooManyFieldLevelEncryptionConfigs(parsed_error.message)),"TooManyFieldLevelEncryptionContentTypeProfiles" => return RusotoError::Service(CreateFieldLevelEncryptionConfigError::TooManyFieldLevelEncryptionContentTypeProfiles(parsed_error.message)),"TooManyFieldLevelEncryptionQueryArgProfiles" => return RusotoError::Service(CreateFieldLevelEncryptionConfigError::TooManyFieldLevelEncryptionQueryArgProfiles(parsed_error.message)),_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for CreateFieldLevelEncryptionConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateFieldLevelEncryptionConfigError {
fn description(&self) -> &str {
match *self {
CreateFieldLevelEncryptionConfigError::FieldLevelEncryptionConfigAlreadyExists(ref cause) => cause,
CreateFieldLevelEncryptionConfigError::InconsistentQuantities(ref cause) => cause,
CreateFieldLevelEncryptionConfigError::InvalidArgument(ref cause) => cause,
CreateFieldLevelEncryptionConfigError::NoSuchFieldLevelEncryptionProfile(ref cause) => cause,
CreateFieldLevelEncryptionConfigError::QueryArgProfileEmpty(ref cause) => cause,
CreateFieldLevelEncryptionConfigError::TooManyFieldLevelEncryptionConfigs(ref cause) => cause,
CreateFieldLevelEncryptionConfigError::TooManyFieldLevelEncryptionContentTypeProfiles(ref cause) => cause,
CreateFieldLevelEncryptionConfigError::TooManyFieldLevelEncryptionQueryArgProfiles(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateFieldLevelEncryptionProfileError {
FieldLevelEncryptionProfileAlreadyExists(String),
FieldLevelEncryptionProfileSizeExceeded(String),
InconsistentQuantities(String),
InvalidArgument(String),
NoSuchPublicKey(String),
TooManyFieldLevelEncryptionEncryptionEntities(String),
TooManyFieldLevelEncryptionFieldPatterns(String),
TooManyFieldLevelEncryptionProfiles(String),
}
impl CreateFieldLevelEncryptionProfileError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<CreateFieldLevelEncryptionProfileError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"FieldLevelEncryptionProfileAlreadyExists" => return RusotoError::Service(CreateFieldLevelEncryptionProfileError::FieldLevelEncryptionProfileAlreadyExists(parsed_error.message)),"FieldLevelEncryptionProfileSizeExceeded" => return RusotoError::Service(CreateFieldLevelEncryptionProfileError::FieldLevelEncryptionProfileSizeExceeded(parsed_error.message)),"InconsistentQuantities" => return RusotoError::Service(CreateFieldLevelEncryptionProfileError::InconsistentQuantities(parsed_error.message)),"InvalidArgument" => return RusotoError::Service(CreateFieldLevelEncryptionProfileError::InvalidArgument(parsed_error.message)),"NoSuchPublicKey" => return RusotoError::Service(CreateFieldLevelEncryptionProfileError::NoSuchPublicKey(parsed_error.message)),"TooManyFieldLevelEncryptionEncryptionEntities" => return RusotoError::Service(CreateFieldLevelEncryptionProfileError::TooManyFieldLevelEncryptionEncryptionEntities(parsed_error.message)),"TooManyFieldLevelEncryptionFieldPatterns" => return RusotoError::Service(CreateFieldLevelEncryptionProfileError::TooManyFieldLevelEncryptionFieldPatterns(parsed_error.message)),"TooManyFieldLevelEncryptionProfiles" => return RusotoError::Service(CreateFieldLevelEncryptionProfileError::TooManyFieldLevelEncryptionProfiles(parsed_error.message)),_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for CreateFieldLevelEncryptionProfileError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateFieldLevelEncryptionProfileError {
fn description(&self) -> &str {
match *self {
CreateFieldLevelEncryptionProfileError::FieldLevelEncryptionProfileAlreadyExists(ref cause) => cause,
CreateFieldLevelEncryptionProfileError::FieldLevelEncryptionProfileSizeExceeded(ref cause) => cause,
CreateFieldLevelEncryptionProfileError::InconsistentQuantities(ref cause) => cause,
CreateFieldLevelEncryptionProfileError::InvalidArgument(ref cause) => cause,
CreateFieldLevelEncryptionProfileError::NoSuchPublicKey(ref cause) => cause,
CreateFieldLevelEncryptionProfileError::TooManyFieldLevelEncryptionEncryptionEntities(ref cause) => cause,
CreateFieldLevelEncryptionProfileError::TooManyFieldLevelEncryptionFieldPatterns(ref cause) => cause,
CreateFieldLevelEncryptionProfileError::TooManyFieldLevelEncryptionProfiles(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateInvalidationError {
AccessDenied(String),
BatchTooLarge(String),
InconsistentQuantities(String),
InvalidArgument(String),
MissingBody(String),
NoSuchDistribution(String),
TooManyInvalidationsInProgress(String),
}
impl CreateInvalidationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateInvalidationError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(CreateInvalidationError::AccessDenied(
parsed_error.message,
))
}
"BatchTooLarge" => {
return RusotoError::Service(CreateInvalidationError::BatchTooLarge(
parsed_error.message,
))
}
"InconsistentQuantities" => {
return RusotoError::Service(
CreateInvalidationError::InconsistentQuantities(parsed_error.message),
)
}
"InvalidArgument" => {
return RusotoError::Service(CreateInvalidationError::InvalidArgument(
parsed_error.message,
))
}
"MissingBody" => {
return RusotoError::Service(CreateInvalidationError::MissingBody(
parsed_error.message,
))
}
"NoSuchDistribution" => {
return RusotoError::Service(CreateInvalidationError::NoSuchDistribution(
parsed_error.message,
))
}
"TooManyInvalidationsInProgress" => {
return RusotoError::Service(
CreateInvalidationError::TooManyInvalidationsInProgress(
parsed_error.message,
),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for CreateInvalidationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateInvalidationError {
fn description(&self) -> &str {
match *self {
CreateInvalidationError::AccessDenied(ref cause) => cause,
CreateInvalidationError::BatchTooLarge(ref cause) => cause,
CreateInvalidationError::InconsistentQuantities(ref cause) => cause,
CreateInvalidationError::InvalidArgument(ref cause) => cause,
CreateInvalidationError::MissingBody(ref cause) => cause,
CreateInvalidationError::NoSuchDistribution(ref cause) => cause,
CreateInvalidationError::TooManyInvalidationsInProgress(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreatePublicKeyError {
InvalidArgument(String),
PublicKeyAlreadyExists(String),
TooManyPublicKeys(String),
}
impl CreatePublicKeyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreatePublicKeyError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"InvalidArgument" => {
return RusotoError::Service(CreatePublicKeyError::InvalidArgument(
parsed_error.message,
))
}
"PublicKeyAlreadyExists" => {
return RusotoError::Service(CreatePublicKeyError::PublicKeyAlreadyExists(
parsed_error.message,
))
}
"TooManyPublicKeys" => {
return RusotoError::Service(CreatePublicKeyError::TooManyPublicKeys(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for CreatePublicKeyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreatePublicKeyError {
fn description(&self) -> &str {
match *self {
CreatePublicKeyError::InvalidArgument(ref cause) => cause,
CreatePublicKeyError::PublicKeyAlreadyExists(ref cause) => cause,
CreatePublicKeyError::TooManyPublicKeys(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateStreamingDistributionError {
AccessDenied(String),
CNAMEAlreadyExists(String),
InconsistentQuantities(String),
InvalidArgument(String),
InvalidOrigin(String),
InvalidOriginAccessIdentity(String),
MissingBody(String),
StreamingDistributionAlreadyExists(String),
TooManyStreamingDistributionCNAMEs(String),
TooManyStreamingDistributions(String),
TooManyTrustedSigners(String),
TrustedSignerDoesNotExist(String),
}
impl CreateStreamingDistributionError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<CreateStreamingDistributionError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(
CreateStreamingDistributionError::AccessDenied(parsed_error.message),
)
}
"CNAMEAlreadyExists" => {
return RusotoError::Service(
CreateStreamingDistributionError::CNAMEAlreadyExists(
parsed_error.message,
),
)
}
"InconsistentQuantities" => {
return RusotoError::Service(
CreateStreamingDistributionError::InconsistentQuantities(
parsed_error.message,
),
)
}
"InvalidArgument" => {
return RusotoError::Service(
CreateStreamingDistributionError::InvalidArgument(parsed_error.message),
)
}
"InvalidOrigin" => {
return RusotoError::Service(
CreateStreamingDistributionError::InvalidOrigin(parsed_error.message),
)
}
"InvalidOriginAccessIdentity" => {
return RusotoError::Service(
CreateStreamingDistributionError::InvalidOriginAccessIdentity(
parsed_error.message,
),
)
}
"MissingBody" => {
return RusotoError::Service(CreateStreamingDistributionError::MissingBody(
parsed_error.message,
))
}
"StreamingDistributionAlreadyExists" => {
return RusotoError::Service(
CreateStreamingDistributionError::StreamingDistributionAlreadyExists(
parsed_error.message,
),
)
}
"TooManyStreamingDistributionCNAMEs" => {
return RusotoError::Service(
CreateStreamingDistributionError::TooManyStreamingDistributionCNAMEs(
parsed_error.message,
),
)
}
"TooManyStreamingDistributions" => {
return RusotoError::Service(
CreateStreamingDistributionError::TooManyStreamingDistributions(
parsed_error.message,
),
)
}
"TooManyTrustedSigners" => {
return RusotoError::Service(
CreateStreamingDistributionError::TooManyTrustedSigners(
parsed_error.message,
),
)
}
"TrustedSignerDoesNotExist" => {
return RusotoError::Service(
CreateStreamingDistributionError::TrustedSignerDoesNotExist(
parsed_error.message,
),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for CreateStreamingDistributionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateStreamingDistributionError {
fn description(&self) -> &str {
match *self {
CreateStreamingDistributionError::AccessDenied(ref cause) => cause,
CreateStreamingDistributionError::CNAMEAlreadyExists(ref cause) => cause,
CreateStreamingDistributionError::InconsistentQuantities(ref cause) => cause,
CreateStreamingDistributionError::InvalidArgument(ref cause) => cause,
CreateStreamingDistributionError::InvalidOrigin(ref cause) => cause,
CreateStreamingDistributionError::InvalidOriginAccessIdentity(ref cause) => cause,
CreateStreamingDistributionError::MissingBody(ref cause) => cause,
CreateStreamingDistributionError::StreamingDistributionAlreadyExists(ref cause) => {
cause
}
CreateStreamingDistributionError::TooManyStreamingDistributionCNAMEs(ref cause) => {
cause
}
CreateStreamingDistributionError::TooManyStreamingDistributions(ref cause) => cause,
CreateStreamingDistributionError::TooManyTrustedSigners(ref cause) => cause,
CreateStreamingDistributionError::TrustedSignerDoesNotExist(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateStreamingDistributionWithTagsError {
AccessDenied(String),
CNAMEAlreadyExists(String),
InconsistentQuantities(String),
InvalidArgument(String),
InvalidOrigin(String),
InvalidOriginAccessIdentity(String),
InvalidTagging(String),
MissingBody(String),
StreamingDistributionAlreadyExists(String),
TooManyStreamingDistributionCNAMEs(String),
TooManyStreamingDistributions(String),
TooManyTrustedSigners(String),
TrustedSignerDoesNotExist(String),
}
impl CreateStreamingDistributionWithTagsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<CreateStreamingDistributionWithTagsError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => return RusotoError::Service(CreateStreamingDistributionWithTagsError::AccessDenied(parsed_error.message)),"CNAMEAlreadyExists" => return RusotoError::Service(CreateStreamingDistributionWithTagsError::CNAMEAlreadyExists(parsed_error.message)),"InconsistentQuantities" => return RusotoError::Service(CreateStreamingDistributionWithTagsError::InconsistentQuantities(parsed_error.message)),"InvalidArgument" => return RusotoError::Service(CreateStreamingDistributionWithTagsError::InvalidArgument(parsed_error.message)),"InvalidOrigin" => return RusotoError::Service(CreateStreamingDistributionWithTagsError::InvalidOrigin(parsed_error.message)),"InvalidOriginAccessIdentity" => return RusotoError::Service(CreateStreamingDistributionWithTagsError::InvalidOriginAccessIdentity(parsed_error.message)),"InvalidTagging" => return RusotoError::Service(CreateStreamingDistributionWithTagsError::InvalidTagging(parsed_error.message)),"MissingBody" => return RusotoError::Service(CreateStreamingDistributionWithTagsError::MissingBody(parsed_error.message)),"StreamingDistributionAlreadyExists" => return RusotoError::Service(CreateStreamingDistributionWithTagsError::StreamingDistributionAlreadyExists(parsed_error.message)),"TooManyStreamingDistributionCNAMEs" => return RusotoError::Service(CreateStreamingDistributionWithTagsError::TooManyStreamingDistributionCNAMEs(parsed_error.message)),"TooManyStreamingDistributions" => return RusotoError::Service(CreateStreamingDistributionWithTagsError::TooManyStreamingDistributions(parsed_error.message)),"TooManyTrustedSigners" => return RusotoError::Service(CreateStreamingDistributionWithTagsError::TooManyTrustedSigners(parsed_error.message)),"TrustedSignerDoesNotExist" => return RusotoError::Service(CreateStreamingDistributionWithTagsError::TrustedSignerDoesNotExist(parsed_error.message)),_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for CreateStreamingDistributionWithTagsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateStreamingDistributionWithTagsError {
fn description(&self) -> &str {
match *self {
CreateStreamingDistributionWithTagsError::AccessDenied(ref cause) => cause,
CreateStreamingDistributionWithTagsError::CNAMEAlreadyExists(ref cause) => cause,
CreateStreamingDistributionWithTagsError::InconsistentQuantities(ref cause) => cause,
CreateStreamingDistributionWithTagsError::InvalidArgument(ref cause) => cause,
CreateStreamingDistributionWithTagsError::InvalidOrigin(ref cause) => cause,
CreateStreamingDistributionWithTagsError::InvalidOriginAccessIdentity(ref cause) => {
cause
}
CreateStreamingDistributionWithTagsError::InvalidTagging(ref cause) => cause,
CreateStreamingDistributionWithTagsError::MissingBody(ref cause) => cause,
CreateStreamingDistributionWithTagsError::StreamingDistributionAlreadyExists(
ref cause,
) => cause,
CreateStreamingDistributionWithTagsError::TooManyStreamingDistributionCNAMEs(
ref cause,
) => cause,
CreateStreamingDistributionWithTagsError::TooManyStreamingDistributions(ref cause) => {
cause
}
CreateStreamingDistributionWithTagsError::TooManyTrustedSigners(ref cause) => cause,
CreateStreamingDistributionWithTagsError::TrustedSignerDoesNotExist(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteCloudFrontOriginAccessIdentityError {
AccessDenied(String),
CloudFrontOriginAccessIdentityInUse(String),
InvalidIfMatchVersion(String),
NoSuchCloudFrontOriginAccessIdentity(String),
PreconditionFailed(String),
}
impl DeleteCloudFrontOriginAccessIdentityError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DeleteCloudFrontOriginAccessIdentityError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => return RusotoError::Service(DeleteCloudFrontOriginAccessIdentityError::AccessDenied(parsed_error.message)),"CloudFrontOriginAccessIdentityInUse" => return RusotoError::Service(DeleteCloudFrontOriginAccessIdentityError::CloudFrontOriginAccessIdentityInUse(parsed_error.message)),"InvalidIfMatchVersion" => return RusotoError::Service(DeleteCloudFrontOriginAccessIdentityError::InvalidIfMatchVersion(parsed_error.message)),"NoSuchCloudFrontOriginAccessIdentity" => return RusotoError::Service(DeleteCloudFrontOriginAccessIdentityError::NoSuchCloudFrontOriginAccessIdentity(parsed_error.message)),"PreconditionFailed" => return RusotoError::Service(DeleteCloudFrontOriginAccessIdentityError::PreconditionFailed(parsed_error.message)),_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DeleteCloudFrontOriginAccessIdentityError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteCloudFrontOriginAccessIdentityError {
fn description(&self) -> &str {
match *self {
DeleteCloudFrontOriginAccessIdentityError::AccessDenied(ref cause) => cause,
DeleteCloudFrontOriginAccessIdentityError::CloudFrontOriginAccessIdentityInUse(
ref cause,
) => cause,
DeleteCloudFrontOriginAccessIdentityError::InvalidIfMatchVersion(ref cause) => cause,
DeleteCloudFrontOriginAccessIdentityError::NoSuchCloudFrontOriginAccessIdentity(
ref cause,
) => cause,
DeleteCloudFrontOriginAccessIdentityError::PreconditionFailed(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteDistributionError {
AccessDenied(String),
DistributionNotDisabled(String),
InvalidIfMatchVersion(String),
NoSuchDistribution(String),
PreconditionFailed(String),
}
impl DeleteDistributionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteDistributionError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(DeleteDistributionError::AccessDenied(
parsed_error.message,
))
}
"DistributionNotDisabled" => {
return RusotoError::Service(
DeleteDistributionError::DistributionNotDisabled(parsed_error.message),
)
}
"InvalidIfMatchVersion" => {
return RusotoError::Service(
DeleteDistributionError::InvalidIfMatchVersion(parsed_error.message),
)
}
"NoSuchDistribution" => {
return RusotoError::Service(DeleteDistributionError::NoSuchDistribution(
parsed_error.message,
))
}
"PreconditionFailed" => {
return RusotoError::Service(DeleteDistributionError::PreconditionFailed(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DeleteDistributionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteDistributionError {
fn description(&self) -> &str {
match *self {
DeleteDistributionError::AccessDenied(ref cause) => cause,
DeleteDistributionError::DistributionNotDisabled(ref cause) => cause,
DeleteDistributionError::InvalidIfMatchVersion(ref cause) => cause,
DeleteDistributionError::NoSuchDistribution(ref cause) => cause,
DeleteDistributionError::PreconditionFailed(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteFieldLevelEncryptionConfigError {
AccessDenied(String),
FieldLevelEncryptionConfigInUse(String),
InvalidIfMatchVersion(String),
NoSuchFieldLevelEncryptionConfig(String),
PreconditionFailed(String),
}
impl DeleteFieldLevelEncryptionConfigError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DeleteFieldLevelEncryptionConfigError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(
DeleteFieldLevelEncryptionConfigError::AccessDenied(
parsed_error.message,
),
)
}
"FieldLevelEncryptionConfigInUse" => {
return RusotoError::Service(
DeleteFieldLevelEncryptionConfigError::FieldLevelEncryptionConfigInUse(
parsed_error.message,
),
)
}
"InvalidIfMatchVersion" => {
return RusotoError::Service(
DeleteFieldLevelEncryptionConfigError::InvalidIfMatchVersion(
parsed_error.message,
),
)
}
"NoSuchFieldLevelEncryptionConfig" => {
return RusotoError::Service(
DeleteFieldLevelEncryptionConfigError::NoSuchFieldLevelEncryptionConfig(
parsed_error.message,
),
)
}
"PreconditionFailed" => {
return RusotoError::Service(
DeleteFieldLevelEncryptionConfigError::PreconditionFailed(
parsed_error.message,
),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DeleteFieldLevelEncryptionConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteFieldLevelEncryptionConfigError {
fn description(&self) -> &str {
match *self {
DeleteFieldLevelEncryptionConfigError::AccessDenied(ref cause) => cause,
DeleteFieldLevelEncryptionConfigError::FieldLevelEncryptionConfigInUse(ref cause) => {
cause
}
DeleteFieldLevelEncryptionConfigError::InvalidIfMatchVersion(ref cause) => cause,
DeleteFieldLevelEncryptionConfigError::NoSuchFieldLevelEncryptionConfig(ref cause) => {
cause
}
DeleteFieldLevelEncryptionConfigError::PreconditionFailed(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteFieldLevelEncryptionProfileError {
AccessDenied(String),
FieldLevelEncryptionProfileInUse(String),
InvalidIfMatchVersion(String),
NoSuchFieldLevelEncryptionProfile(String),
PreconditionFailed(String),
}
impl DeleteFieldLevelEncryptionProfileError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DeleteFieldLevelEncryptionProfileError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(
DeleteFieldLevelEncryptionProfileError::AccessDenied(
parsed_error.message,
),
)
}
"FieldLevelEncryptionProfileInUse" => return RusotoError::Service(
DeleteFieldLevelEncryptionProfileError::FieldLevelEncryptionProfileInUse(
parsed_error.message,
),
),
"InvalidIfMatchVersion" => {
return RusotoError::Service(
DeleteFieldLevelEncryptionProfileError::InvalidIfMatchVersion(
parsed_error.message,
),
)
}
"NoSuchFieldLevelEncryptionProfile" => return RusotoError::Service(
DeleteFieldLevelEncryptionProfileError::NoSuchFieldLevelEncryptionProfile(
parsed_error.message,
),
),
"PreconditionFailed" => {
return RusotoError::Service(
DeleteFieldLevelEncryptionProfileError::PreconditionFailed(
parsed_error.message,
),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DeleteFieldLevelEncryptionProfileError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteFieldLevelEncryptionProfileError {
fn description(&self) -> &str {
match *self {
DeleteFieldLevelEncryptionProfileError::AccessDenied(ref cause) => cause,
DeleteFieldLevelEncryptionProfileError::FieldLevelEncryptionProfileInUse(ref cause) => {
cause
}
DeleteFieldLevelEncryptionProfileError::InvalidIfMatchVersion(ref cause) => cause,
DeleteFieldLevelEncryptionProfileError::NoSuchFieldLevelEncryptionProfile(
ref cause,
) => cause,
DeleteFieldLevelEncryptionProfileError::PreconditionFailed(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeletePublicKeyError {
AccessDenied(String),
InvalidIfMatchVersion(String),
NoSuchPublicKey(String),
PreconditionFailed(String),
PublicKeyInUse(String),
}
impl DeletePublicKeyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeletePublicKeyError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(DeletePublicKeyError::AccessDenied(
parsed_error.message,
))
}
"InvalidIfMatchVersion" => {
return RusotoError::Service(DeletePublicKeyError::InvalidIfMatchVersion(
parsed_error.message,
))
}
"NoSuchPublicKey" => {
return RusotoError::Service(DeletePublicKeyError::NoSuchPublicKey(
parsed_error.message,
))
}
"PreconditionFailed" => {
return RusotoError::Service(DeletePublicKeyError::PreconditionFailed(
parsed_error.message,
))
}
"PublicKeyInUse" => {
return RusotoError::Service(DeletePublicKeyError::PublicKeyInUse(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DeletePublicKeyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeletePublicKeyError {
fn description(&self) -> &str {
match *self {
DeletePublicKeyError::AccessDenied(ref cause) => cause,
DeletePublicKeyError::InvalidIfMatchVersion(ref cause) => cause,
DeletePublicKeyError::NoSuchPublicKey(ref cause) => cause,
DeletePublicKeyError::PreconditionFailed(ref cause) => cause,
DeletePublicKeyError::PublicKeyInUse(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteStreamingDistributionError {
AccessDenied(String),
InvalidIfMatchVersion(String),
NoSuchStreamingDistribution(String),
PreconditionFailed(String),
StreamingDistributionNotDisabled(String),
}
impl DeleteStreamingDistributionError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DeleteStreamingDistributionError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(
DeleteStreamingDistributionError::AccessDenied(parsed_error.message),
)
}
"InvalidIfMatchVersion" => {
return RusotoError::Service(
DeleteStreamingDistributionError::InvalidIfMatchVersion(
parsed_error.message,
),
)
}
"NoSuchStreamingDistribution" => {
return RusotoError::Service(
DeleteStreamingDistributionError::NoSuchStreamingDistribution(
parsed_error.message,
),
)
}
"PreconditionFailed" => {
return RusotoError::Service(
DeleteStreamingDistributionError::PreconditionFailed(
parsed_error.message,
),
)
}
"StreamingDistributionNotDisabled" => {
return RusotoError::Service(
DeleteStreamingDistributionError::StreamingDistributionNotDisabled(
parsed_error.message,
),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DeleteStreamingDistributionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteStreamingDistributionError {
fn description(&self) -> &str {
match *self {
DeleteStreamingDistributionError::AccessDenied(ref cause) => cause,
DeleteStreamingDistributionError::InvalidIfMatchVersion(ref cause) => cause,
DeleteStreamingDistributionError::NoSuchStreamingDistribution(ref cause) => cause,
DeleteStreamingDistributionError::PreconditionFailed(ref cause) => cause,
DeleteStreamingDistributionError::StreamingDistributionNotDisabled(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetCloudFrontOriginAccessIdentityError {
AccessDenied(String),
NoSuchCloudFrontOriginAccessIdentity(String),
}
impl GetCloudFrontOriginAccessIdentityError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<GetCloudFrontOriginAccessIdentityError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => return RusotoError::Service(GetCloudFrontOriginAccessIdentityError::AccessDenied(parsed_error.message)),"NoSuchCloudFrontOriginAccessIdentity" => return RusotoError::Service(GetCloudFrontOriginAccessIdentityError::NoSuchCloudFrontOriginAccessIdentity(parsed_error.message)),_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for GetCloudFrontOriginAccessIdentityError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetCloudFrontOriginAccessIdentityError {
fn description(&self) -> &str {
match *self {
GetCloudFrontOriginAccessIdentityError::AccessDenied(ref cause) => cause,
GetCloudFrontOriginAccessIdentityError::NoSuchCloudFrontOriginAccessIdentity(
ref cause,
) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetCloudFrontOriginAccessIdentityConfigError {
AccessDenied(String),
NoSuchCloudFrontOriginAccessIdentity(String),
}
impl GetCloudFrontOriginAccessIdentityConfigError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<GetCloudFrontOriginAccessIdentityConfigError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => return RusotoError::Service(GetCloudFrontOriginAccessIdentityConfigError::AccessDenied(parsed_error.message)),"NoSuchCloudFrontOriginAccessIdentity" => return RusotoError::Service(GetCloudFrontOriginAccessIdentityConfigError::NoSuchCloudFrontOriginAccessIdentity(parsed_error.message)),_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for GetCloudFrontOriginAccessIdentityConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetCloudFrontOriginAccessIdentityConfigError {
fn description(&self) -> &str {
match *self {
GetCloudFrontOriginAccessIdentityConfigError::AccessDenied(ref cause) => cause,
GetCloudFrontOriginAccessIdentityConfigError::NoSuchCloudFrontOriginAccessIdentity(
ref cause,
) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDistributionError {
AccessDenied(String),
NoSuchDistribution(String),
}
impl GetDistributionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDistributionError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(GetDistributionError::AccessDenied(
parsed_error.message,
))
}
"NoSuchDistribution" => {
return RusotoError::Service(GetDistributionError::NoSuchDistribution(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for GetDistributionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDistributionError {
fn description(&self) -> &str {
match *self {
GetDistributionError::AccessDenied(ref cause) => cause,
GetDistributionError::NoSuchDistribution(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDistributionConfigError {
AccessDenied(String),
NoSuchDistribution(String),
}
impl GetDistributionConfigError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDistributionConfigError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(GetDistributionConfigError::AccessDenied(
parsed_error.message,
))
}
"NoSuchDistribution" => {
return RusotoError::Service(
GetDistributionConfigError::NoSuchDistribution(parsed_error.message),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for GetDistributionConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDistributionConfigError {
fn description(&self) -> &str {
match *self {
GetDistributionConfigError::AccessDenied(ref cause) => cause,
GetDistributionConfigError::NoSuchDistribution(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetFieldLevelEncryptionError {
AccessDenied(String),
NoSuchFieldLevelEncryptionConfig(String),
}
impl GetFieldLevelEncryptionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetFieldLevelEncryptionError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(GetFieldLevelEncryptionError::AccessDenied(
parsed_error.message,
))
}
"NoSuchFieldLevelEncryptionConfig" => {
return RusotoError::Service(
GetFieldLevelEncryptionError::NoSuchFieldLevelEncryptionConfig(
parsed_error.message,
),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for GetFieldLevelEncryptionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetFieldLevelEncryptionError {
fn description(&self) -> &str {
match *self {
GetFieldLevelEncryptionError::AccessDenied(ref cause) => cause,
GetFieldLevelEncryptionError::NoSuchFieldLevelEncryptionConfig(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetFieldLevelEncryptionConfigError {
AccessDenied(String),
NoSuchFieldLevelEncryptionConfig(String),
}
impl GetFieldLevelEncryptionConfigError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<GetFieldLevelEncryptionConfigError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(
GetFieldLevelEncryptionConfigError::AccessDenied(parsed_error.message),
)
}
"NoSuchFieldLevelEncryptionConfig" => {
return RusotoError::Service(
GetFieldLevelEncryptionConfigError::NoSuchFieldLevelEncryptionConfig(
parsed_error.message,
),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for GetFieldLevelEncryptionConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetFieldLevelEncryptionConfigError {
fn description(&self) -> &str {
match *self {
GetFieldLevelEncryptionConfigError::AccessDenied(ref cause) => cause,
GetFieldLevelEncryptionConfigError::NoSuchFieldLevelEncryptionConfig(ref cause) => {
cause
}
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetFieldLevelEncryptionProfileError {
AccessDenied(String),
NoSuchFieldLevelEncryptionProfile(String),
}
impl GetFieldLevelEncryptionProfileError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<GetFieldLevelEncryptionProfileError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(
GetFieldLevelEncryptionProfileError::AccessDenied(parsed_error.message),
)
}
"NoSuchFieldLevelEncryptionProfile" => {
return RusotoError::Service(
GetFieldLevelEncryptionProfileError::NoSuchFieldLevelEncryptionProfile(
parsed_error.message,
),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for GetFieldLevelEncryptionProfileError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetFieldLevelEncryptionProfileError {
fn description(&self) -> &str {
match *self {
GetFieldLevelEncryptionProfileError::AccessDenied(ref cause) => cause,
GetFieldLevelEncryptionProfileError::NoSuchFieldLevelEncryptionProfile(ref cause) => {
cause
}
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetFieldLevelEncryptionProfileConfigError {
AccessDenied(String),
NoSuchFieldLevelEncryptionProfile(String),
}
impl GetFieldLevelEncryptionProfileConfigError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<GetFieldLevelEncryptionProfileConfigError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => return RusotoError::Service(GetFieldLevelEncryptionProfileConfigError::AccessDenied(parsed_error.message)),"NoSuchFieldLevelEncryptionProfile" => return RusotoError::Service(GetFieldLevelEncryptionProfileConfigError::NoSuchFieldLevelEncryptionProfile(parsed_error.message)),_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for GetFieldLevelEncryptionProfileConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetFieldLevelEncryptionProfileConfigError {
fn description(&self) -> &str {
match *self {
GetFieldLevelEncryptionProfileConfigError::AccessDenied(ref cause) => cause,
GetFieldLevelEncryptionProfileConfigError::NoSuchFieldLevelEncryptionProfile(
ref cause,
) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetInvalidationError {
AccessDenied(String),
NoSuchDistribution(String),
NoSuchInvalidation(String),
}
impl GetInvalidationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetInvalidationError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(GetInvalidationError::AccessDenied(
parsed_error.message,
))
}
"NoSuchDistribution" => {
return RusotoError::Service(GetInvalidationError::NoSuchDistribution(
parsed_error.message,
))
}
"NoSuchInvalidation" => {
return RusotoError::Service(GetInvalidationError::NoSuchInvalidation(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for GetInvalidationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetInvalidationError {
fn description(&self) -> &str {
match *self {
GetInvalidationError::AccessDenied(ref cause) => cause,
GetInvalidationError::NoSuchDistribution(ref cause) => cause,
GetInvalidationError::NoSuchInvalidation(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetPublicKeyError {
AccessDenied(String),
NoSuchPublicKey(String),
}
impl GetPublicKeyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetPublicKeyError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(GetPublicKeyError::AccessDenied(
parsed_error.message,
))
}
"NoSuchPublicKey" => {
return RusotoError::Service(GetPublicKeyError::NoSuchPublicKey(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for GetPublicKeyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetPublicKeyError {
fn description(&self) -> &str {
match *self {
GetPublicKeyError::AccessDenied(ref cause) => cause,
GetPublicKeyError::NoSuchPublicKey(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetPublicKeyConfigError {
AccessDenied(String),
NoSuchPublicKey(String),
}
impl GetPublicKeyConfigError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetPublicKeyConfigError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(GetPublicKeyConfigError::AccessDenied(
parsed_error.message,
))
}
"NoSuchPublicKey" => {
return RusotoError::Service(GetPublicKeyConfigError::NoSuchPublicKey(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for GetPublicKeyConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetPublicKeyConfigError {
fn description(&self) -> &str {
match *self {
GetPublicKeyConfigError::AccessDenied(ref cause) => cause,
GetPublicKeyConfigError::NoSuchPublicKey(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetStreamingDistributionError {
AccessDenied(String),
NoSuchStreamingDistribution(String),
}
impl GetStreamingDistributionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetStreamingDistributionError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(GetStreamingDistributionError::AccessDenied(
parsed_error.message,
))
}
"NoSuchStreamingDistribution" => {
return RusotoError::Service(
GetStreamingDistributionError::NoSuchStreamingDistribution(
parsed_error.message,
),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for GetStreamingDistributionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetStreamingDistributionError {
fn description(&self) -> &str {
match *self {
GetStreamingDistributionError::AccessDenied(ref cause) => cause,
GetStreamingDistributionError::NoSuchStreamingDistribution(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetStreamingDistributionConfigError {
AccessDenied(String),
NoSuchStreamingDistribution(String),
}
impl GetStreamingDistributionConfigError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<GetStreamingDistributionConfigError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(
GetStreamingDistributionConfigError::AccessDenied(parsed_error.message),
)
}
"NoSuchStreamingDistribution" => {
return RusotoError::Service(
GetStreamingDistributionConfigError::NoSuchStreamingDistribution(
parsed_error.message,
),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for GetStreamingDistributionConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetStreamingDistributionConfigError {
fn description(&self) -> &str {
match *self {
GetStreamingDistributionConfigError::AccessDenied(ref cause) => cause,
GetStreamingDistributionConfigError::NoSuchStreamingDistribution(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListCloudFrontOriginAccessIdentitiesError {
InvalidArgument(String),
}
impl ListCloudFrontOriginAccessIdentitiesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListCloudFrontOriginAccessIdentitiesError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"InvalidArgument" => {
return RusotoError::Service(
ListCloudFrontOriginAccessIdentitiesError::InvalidArgument(
parsed_error.message,
),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for ListCloudFrontOriginAccessIdentitiesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListCloudFrontOriginAccessIdentitiesError {
fn description(&self) -> &str {
match *self {
ListCloudFrontOriginAccessIdentitiesError::InvalidArgument(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListDistributionsError {
InvalidArgument(String),
}
impl ListDistributionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListDistributionsError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"InvalidArgument" => {
return RusotoError::Service(ListDistributionsError::InvalidArgument(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for ListDistributionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListDistributionsError {
fn description(&self) -> &str {
match *self {
ListDistributionsError::InvalidArgument(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListDistributionsByWebACLIdError {
InvalidArgument(String),
InvalidWebACLId(String),
}
impl ListDistributionsByWebACLIdError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListDistributionsByWebACLIdError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"InvalidArgument" => {
return RusotoError::Service(
ListDistributionsByWebACLIdError::InvalidArgument(parsed_error.message),
)
}
"InvalidWebACLId" => {
return RusotoError::Service(
ListDistributionsByWebACLIdError::InvalidWebACLId(parsed_error.message),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for ListDistributionsByWebACLIdError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListDistributionsByWebACLIdError {
fn description(&self) -> &str {
match *self {
ListDistributionsByWebACLIdError::InvalidArgument(ref cause) => cause,
ListDistributionsByWebACLIdError::InvalidWebACLId(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListFieldLevelEncryptionConfigsError {
InvalidArgument(String),
}
impl ListFieldLevelEncryptionConfigsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListFieldLevelEncryptionConfigsError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"InvalidArgument" => {
return RusotoError::Service(
ListFieldLevelEncryptionConfigsError::InvalidArgument(
parsed_error.message,
),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for ListFieldLevelEncryptionConfigsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListFieldLevelEncryptionConfigsError {
fn description(&self) -> &str {
match *self {
ListFieldLevelEncryptionConfigsError::InvalidArgument(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListFieldLevelEncryptionProfilesError {
InvalidArgument(String),
}
impl ListFieldLevelEncryptionProfilesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListFieldLevelEncryptionProfilesError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"InvalidArgument" => {
return RusotoError::Service(
ListFieldLevelEncryptionProfilesError::InvalidArgument(
parsed_error.message,
),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for ListFieldLevelEncryptionProfilesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListFieldLevelEncryptionProfilesError {
fn description(&self) -> &str {
match *self {
ListFieldLevelEncryptionProfilesError::InvalidArgument(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListInvalidationsError {
AccessDenied(String),
InvalidArgument(String),
NoSuchDistribution(String),
}
impl ListInvalidationsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListInvalidationsError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(ListInvalidationsError::AccessDenied(
parsed_error.message,
))
}
"InvalidArgument" => {
return RusotoError::Service(ListInvalidationsError::InvalidArgument(
parsed_error.message,
))
}
"NoSuchDistribution" => {
return RusotoError::Service(ListInvalidationsError::NoSuchDistribution(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for ListInvalidationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListInvalidationsError {
fn description(&self) -> &str {
match *self {
ListInvalidationsError::AccessDenied(ref cause) => cause,
ListInvalidationsError::InvalidArgument(ref cause) => cause,
ListInvalidationsError::NoSuchDistribution(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListPublicKeysError {
InvalidArgument(String),
}
impl ListPublicKeysError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListPublicKeysError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"InvalidArgument" => {
return RusotoError::Service(ListPublicKeysError::InvalidArgument(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for ListPublicKeysError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListPublicKeysError {
fn description(&self) -> &str {
match *self {
ListPublicKeysError::InvalidArgument(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListStreamingDistributionsError {
InvalidArgument(String),
}
impl ListStreamingDistributionsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListStreamingDistributionsError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"InvalidArgument" => {
return RusotoError::Service(
ListStreamingDistributionsError::InvalidArgument(parsed_error.message),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for ListStreamingDistributionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListStreamingDistributionsError {
fn description(&self) -> &str {
match *self {
ListStreamingDistributionsError::InvalidArgument(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTagsForResourceError {
AccessDenied(String),
InvalidArgument(String),
InvalidTagging(String),
NoSuchResource(String),
}
impl ListTagsForResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(ListTagsForResourceError::AccessDenied(
parsed_error.message,
))
}
"InvalidArgument" => {
return RusotoError::Service(ListTagsForResourceError::InvalidArgument(
parsed_error.message,
))
}
"InvalidTagging" => {
return RusotoError::Service(ListTagsForResourceError::InvalidTagging(
parsed_error.message,
))
}
"NoSuchResource" => {
return RusotoError::Service(ListTagsForResourceError::NoSuchResource(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for ListTagsForResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagsForResourceError {
fn description(&self) -> &str {
match *self {
ListTagsForResourceError::AccessDenied(ref cause) => cause,
ListTagsForResourceError::InvalidArgument(ref cause) => cause,
ListTagsForResourceError::InvalidTagging(ref cause) => cause,
ListTagsForResourceError::NoSuchResource(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum TagResourceError {
AccessDenied(String),
InvalidArgument(String),
InvalidTagging(String),
NoSuchResource(String),
}
impl TagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(TagResourceError::AccessDenied(
parsed_error.message,
))
}
"InvalidArgument" => {
return RusotoError::Service(TagResourceError::InvalidArgument(
parsed_error.message,
))
}
"InvalidTagging" => {
return RusotoError::Service(TagResourceError::InvalidTagging(
parsed_error.message,
))
}
"NoSuchResource" => {
return RusotoError::Service(TagResourceError::NoSuchResource(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for TagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TagResourceError {
fn description(&self) -> &str {
match *self {
TagResourceError::AccessDenied(ref cause) => cause,
TagResourceError::InvalidArgument(ref cause) => cause,
TagResourceError::InvalidTagging(ref cause) => cause,
TagResourceError::NoSuchResource(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UntagResourceError {
AccessDenied(String),
InvalidArgument(String),
InvalidTagging(String),
NoSuchResource(String),
}
impl UntagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(UntagResourceError::AccessDenied(
parsed_error.message,
))
}
"InvalidArgument" => {
return RusotoError::Service(UntagResourceError::InvalidArgument(
parsed_error.message,
))
}
"InvalidTagging" => {
return RusotoError::Service(UntagResourceError::InvalidTagging(
parsed_error.message,
))
}
"NoSuchResource" => {
return RusotoError::Service(UntagResourceError::NoSuchResource(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for UntagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UntagResourceError {
fn description(&self) -> &str {
match *self {
UntagResourceError::AccessDenied(ref cause) => cause,
UntagResourceError::InvalidArgument(ref cause) => cause,
UntagResourceError::InvalidTagging(ref cause) => cause,
UntagResourceError::NoSuchResource(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateCloudFrontOriginAccessIdentityError {
AccessDenied(String),
IllegalUpdate(String),
InconsistentQuantities(String),
InvalidArgument(String),
InvalidIfMatchVersion(String),
MissingBody(String),
NoSuchCloudFrontOriginAccessIdentity(String),
PreconditionFailed(String),
}
impl UpdateCloudFrontOriginAccessIdentityError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<UpdateCloudFrontOriginAccessIdentityError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => return RusotoError::Service(UpdateCloudFrontOriginAccessIdentityError::AccessDenied(parsed_error.message)),"IllegalUpdate" => return RusotoError::Service(UpdateCloudFrontOriginAccessIdentityError::IllegalUpdate(parsed_error.message)),"InconsistentQuantities" => return RusotoError::Service(UpdateCloudFrontOriginAccessIdentityError::InconsistentQuantities(parsed_error.message)),"InvalidArgument" => return RusotoError::Service(UpdateCloudFrontOriginAccessIdentityError::InvalidArgument(parsed_error.message)),"InvalidIfMatchVersion" => return RusotoError::Service(UpdateCloudFrontOriginAccessIdentityError::InvalidIfMatchVersion(parsed_error.message)),"MissingBody" => return RusotoError::Service(UpdateCloudFrontOriginAccessIdentityError::MissingBody(parsed_error.message)),"NoSuchCloudFrontOriginAccessIdentity" => return RusotoError::Service(UpdateCloudFrontOriginAccessIdentityError::NoSuchCloudFrontOriginAccessIdentity(parsed_error.message)),"PreconditionFailed" => return RusotoError::Service(UpdateCloudFrontOriginAccessIdentityError::PreconditionFailed(parsed_error.message)),_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for UpdateCloudFrontOriginAccessIdentityError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateCloudFrontOriginAccessIdentityError {
fn description(&self) -> &str {
match *self {
UpdateCloudFrontOriginAccessIdentityError::AccessDenied(ref cause) => cause,
UpdateCloudFrontOriginAccessIdentityError::IllegalUpdate(ref cause) => cause,
UpdateCloudFrontOriginAccessIdentityError::InconsistentQuantities(ref cause) => cause,
UpdateCloudFrontOriginAccessIdentityError::InvalidArgument(ref cause) => cause,
UpdateCloudFrontOriginAccessIdentityError::InvalidIfMatchVersion(ref cause) => cause,
UpdateCloudFrontOriginAccessIdentityError::MissingBody(ref cause) => cause,
UpdateCloudFrontOriginAccessIdentityError::NoSuchCloudFrontOriginAccessIdentity(
ref cause,
) => cause,
UpdateCloudFrontOriginAccessIdentityError::PreconditionFailed(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateDistributionError {
AccessDenied(String),
CNAMEAlreadyExists(String),
IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior(String),
IllegalUpdate(String),
InconsistentQuantities(String),
InvalidArgument(String),
InvalidDefaultRootObject(String),
InvalidErrorCode(String),
InvalidForwardCookies(String),
InvalidGeoRestrictionParameter(String),
InvalidHeadersForS3Origin(String),
InvalidIfMatchVersion(String),
InvalidLambdaFunctionAssociation(String),
InvalidLocationCode(String),
InvalidMinimumProtocolVersion(String),
InvalidOriginAccessIdentity(String),
InvalidOriginKeepaliveTimeout(String),
InvalidOriginReadTimeout(String),
InvalidQueryStringParameters(String),
InvalidRelativePath(String),
InvalidRequiredProtocol(String),
InvalidResponseCode(String),
InvalidTTLOrder(String),
InvalidViewerCertificate(String),
InvalidWebACLId(String),
MissingBody(String),
NoSuchDistribution(String),
NoSuchFieldLevelEncryptionConfig(String),
NoSuchOrigin(String),
PreconditionFailed(String),
TooManyCacheBehaviors(String),
TooManyCertificates(String),
TooManyCookieNamesInWhiteList(String),
TooManyDistributionCNAMEs(String),
TooManyDistributionsAssociatedToFieldLevelEncryptionConfig(String),
TooManyDistributionsWithLambdaAssociations(String),
TooManyHeadersInForwardedValues(String),
TooManyLambdaFunctionAssociations(String),
TooManyOriginCustomHeaders(String),
TooManyOriginGroupsPerDistribution(String),
TooManyOrigins(String),
TooManyQueryStringParameters(String),
TooManyTrustedSigners(String),
TrustedSignerDoesNotExist(String),
}
impl UpdateDistributionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateDistributionError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => return RusotoError::Service(UpdateDistributionError::AccessDenied(parsed_error.message)),"CNAMEAlreadyExists" => return RusotoError::Service(UpdateDistributionError::CNAMEAlreadyExists(parsed_error.message)),"IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior" => return RusotoError::Service(UpdateDistributionError::IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior(parsed_error.message)),"IllegalUpdate" => return RusotoError::Service(UpdateDistributionError::IllegalUpdate(parsed_error.message)),"InconsistentQuantities" => return RusotoError::Service(UpdateDistributionError::InconsistentQuantities(parsed_error.message)),"InvalidArgument" => return RusotoError::Service(UpdateDistributionError::InvalidArgument(parsed_error.message)),"InvalidDefaultRootObject" => return RusotoError::Service(UpdateDistributionError::InvalidDefaultRootObject(parsed_error.message)),"InvalidErrorCode" => return RusotoError::Service(UpdateDistributionError::InvalidErrorCode(parsed_error.message)),"InvalidForwardCookies" => return RusotoError::Service(UpdateDistributionError::InvalidForwardCookies(parsed_error.message)),"InvalidGeoRestrictionParameter" => return RusotoError::Service(UpdateDistributionError::InvalidGeoRestrictionParameter(parsed_error.message)),"InvalidHeadersForS3Origin" => return RusotoError::Service(UpdateDistributionError::InvalidHeadersForS3Origin(parsed_error.message)),"InvalidIfMatchVersion" => return RusotoError::Service(UpdateDistributionError::InvalidIfMatchVersion(parsed_error.message)),"InvalidLambdaFunctionAssociation" => return RusotoError::Service(UpdateDistributionError::InvalidLambdaFunctionAssociation(parsed_error.message)),"InvalidLocationCode" => return RusotoError::Service(UpdateDistributionError::InvalidLocationCode(parsed_error.message)),"InvalidMinimumProtocolVersion" => return RusotoError::Service(UpdateDistributionError::InvalidMinimumProtocolVersion(parsed_error.message)),"InvalidOriginAccessIdentity" => return RusotoError::Service(UpdateDistributionError::InvalidOriginAccessIdentity(parsed_error.message)),"InvalidOriginKeepaliveTimeout" => return RusotoError::Service(UpdateDistributionError::InvalidOriginKeepaliveTimeout(parsed_error.message)),"InvalidOriginReadTimeout" => return RusotoError::Service(UpdateDistributionError::InvalidOriginReadTimeout(parsed_error.message)),"InvalidQueryStringParameters" => return RusotoError::Service(UpdateDistributionError::InvalidQueryStringParameters(parsed_error.message)),"InvalidRelativePath" => return RusotoError::Service(UpdateDistributionError::InvalidRelativePath(parsed_error.message)),"InvalidRequiredProtocol" => return RusotoError::Service(UpdateDistributionError::InvalidRequiredProtocol(parsed_error.message)),"InvalidResponseCode" => return RusotoError::Service(UpdateDistributionError::InvalidResponseCode(parsed_error.message)),"InvalidTTLOrder" => return RusotoError::Service(UpdateDistributionError::InvalidTTLOrder(parsed_error.message)),"InvalidViewerCertificate" => return RusotoError::Service(UpdateDistributionError::InvalidViewerCertificate(parsed_error.message)),"InvalidWebACLId" => return RusotoError::Service(UpdateDistributionError::InvalidWebACLId(parsed_error.message)),"MissingBody" => return RusotoError::Service(UpdateDistributionError::MissingBody(parsed_error.message)),"NoSuchDistribution" => return RusotoError::Service(UpdateDistributionError::NoSuchDistribution(parsed_error.message)),"NoSuchFieldLevelEncryptionConfig" => return RusotoError::Service(UpdateDistributionError::NoSuchFieldLevelEncryptionConfig(parsed_error.message)),"NoSuchOrigin" => return RusotoError::Service(UpdateDistributionError::NoSuchOrigin(parsed_error.message)),"PreconditionFailed" => return RusotoError::Service(UpdateDistributionError::PreconditionFailed(parsed_error.message)),"TooManyCacheBehaviors" => return RusotoError::Service(UpdateDistributionError::TooManyCacheBehaviors(parsed_error.message)),"TooManyCertificates" => return RusotoError::Service(UpdateDistributionError::TooManyCertificates(parsed_error.message)),"TooManyCookieNamesInWhiteList" => return RusotoError::Service(UpdateDistributionError::TooManyCookieNamesInWhiteList(parsed_error.message)),"TooManyDistributionCNAMEs" => return RusotoError::Service(UpdateDistributionError::TooManyDistributionCNAMEs(parsed_error.message)),"TooManyDistributionsAssociatedToFieldLevelEncryptionConfig" => return RusotoError::Service(UpdateDistributionError::TooManyDistributionsAssociatedToFieldLevelEncryptionConfig(parsed_error.message)),"TooManyDistributionsWithLambdaAssociations" => return RusotoError::Service(UpdateDistributionError::TooManyDistributionsWithLambdaAssociations(parsed_error.message)),"TooManyHeadersInForwardedValues" => return RusotoError::Service(UpdateDistributionError::TooManyHeadersInForwardedValues(parsed_error.message)),"TooManyLambdaFunctionAssociations" => return RusotoError::Service(UpdateDistributionError::TooManyLambdaFunctionAssociations(parsed_error.message)),"TooManyOriginCustomHeaders" => return RusotoError::Service(UpdateDistributionError::TooManyOriginCustomHeaders(parsed_error.message)),"TooManyOriginGroupsPerDistribution" => return RusotoError::Service(UpdateDistributionError::TooManyOriginGroupsPerDistribution(parsed_error.message)),"TooManyOrigins" => return RusotoError::Service(UpdateDistributionError::TooManyOrigins(parsed_error.message)),"TooManyQueryStringParameters" => return RusotoError::Service(UpdateDistributionError::TooManyQueryStringParameters(parsed_error.message)),"TooManyTrustedSigners" => return RusotoError::Service(UpdateDistributionError::TooManyTrustedSigners(parsed_error.message)),"TrustedSignerDoesNotExist" => return RusotoError::Service(UpdateDistributionError::TrustedSignerDoesNotExist(parsed_error.message)),_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for UpdateDistributionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateDistributionError {
fn description(&self) -> &str {
match *self {
UpdateDistributionError::AccessDenied(ref cause) => cause,
UpdateDistributionError::CNAMEAlreadyExists(ref cause) => cause,
UpdateDistributionError::IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior(ref cause) => cause,
UpdateDistributionError::IllegalUpdate(ref cause) => cause,
UpdateDistributionError::InconsistentQuantities(ref cause) => cause,
UpdateDistributionError::InvalidArgument(ref cause) => cause,
UpdateDistributionError::InvalidDefaultRootObject(ref cause) => cause,
UpdateDistributionError::InvalidErrorCode(ref cause) => cause,
UpdateDistributionError::InvalidForwardCookies(ref cause) => cause,
UpdateDistributionError::InvalidGeoRestrictionParameter(ref cause) => cause,
UpdateDistributionError::InvalidHeadersForS3Origin(ref cause) => cause,
UpdateDistributionError::InvalidIfMatchVersion(ref cause) => cause,
UpdateDistributionError::InvalidLambdaFunctionAssociation(ref cause) => cause,
UpdateDistributionError::InvalidLocationCode(ref cause) => cause,
UpdateDistributionError::InvalidMinimumProtocolVersion(ref cause) => cause,
UpdateDistributionError::InvalidOriginAccessIdentity(ref cause) => cause,
UpdateDistributionError::InvalidOriginKeepaliveTimeout(ref cause) => cause,
UpdateDistributionError::InvalidOriginReadTimeout(ref cause) => cause,
UpdateDistributionError::InvalidQueryStringParameters(ref cause) => cause,
UpdateDistributionError::InvalidRelativePath(ref cause) => cause,
UpdateDistributionError::InvalidRequiredProtocol(ref cause) => cause,
UpdateDistributionError::InvalidResponseCode(ref cause) => cause,
UpdateDistributionError::InvalidTTLOrder(ref cause) => cause,
UpdateDistributionError::InvalidViewerCertificate(ref cause) => cause,
UpdateDistributionError::InvalidWebACLId(ref cause) => cause,
UpdateDistributionError::MissingBody(ref cause) => cause,
UpdateDistributionError::NoSuchDistribution(ref cause) => cause,
UpdateDistributionError::NoSuchFieldLevelEncryptionConfig(ref cause) => cause,
UpdateDistributionError::NoSuchOrigin(ref cause) => cause,
UpdateDistributionError::PreconditionFailed(ref cause) => cause,
UpdateDistributionError::TooManyCacheBehaviors(ref cause) => cause,
UpdateDistributionError::TooManyCertificates(ref cause) => cause,
UpdateDistributionError::TooManyCookieNamesInWhiteList(ref cause) => cause,
UpdateDistributionError::TooManyDistributionCNAMEs(ref cause) => cause,
UpdateDistributionError::TooManyDistributionsAssociatedToFieldLevelEncryptionConfig(ref cause) => cause,
UpdateDistributionError::TooManyDistributionsWithLambdaAssociations(ref cause) => cause,
UpdateDistributionError::TooManyHeadersInForwardedValues(ref cause) => cause,
UpdateDistributionError::TooManyLambdaFunctionAssociations(ref cause) => cause,
UpdateDistributionError::TooManyOriginCustomHeaders(ref cause) => cause,
UpdateDistributionError::TooManyOriginGroupsPerDistribution(ref cause) => cause,
UpdateDistributionError::TooManyOrigins(ref cause) => cause,
UpdateDistributionError::TooManyQueryStringParameters(ref cause) => cause,
UpdateDistributionError::TooManyTrustedSigners(ref cause) => cause,
UpdateDistributionError::TrustedSignerDoesNotExist(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateFieldLevelEncryptionConfigError {
AccessDenied(String),
IllegalUpdate(String),
InconsistentQuantities(String),
InvalidArgument(String),
InvalidIfMatchVersion(String),
NoSuchFieldLevelEncryptionConfig(String),
NoSuchFieldLevelEncryptionProfile(String),
PreconditionFailed(String),
QueryArgProfileEmpty(String),
TooManyFieldLevelEncryptionContentTypeProfiles(String),
TooManyFieldLevelEncryptionQueryArgProfiles(String),
}
impl UpdateFieldLevelEncryptionConfigError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<UpdateFieldLevelEncryptionConfigError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => return RusotoError::Service(UpdateFieldLevelEncryptionConfigError::AccessDenied(parsed_error.message)),"IllegalUpdate" => return RusotoError::Service(UpdateFieldLevelEncryptionConfigError::IllegalUpdate(parsed_error.message)),"InconsistentQuantities" => return RusotoError::Service(UpdateFieldLevelEncryptionConfigError::InconsistentQuantities(parsed_error.message)),"InvalidArgument" => return RusotoError::Service(UpdateFieldLevelEncryptionConfigError::InvalidArgument(parsed_error.message)),"InvalidIfMatchVersion" => return RusotoError::Service(UpdateFieldLevelEncryptionConfigError::InvalidIfMatchVersion(parsed_error.message)),"NoSuchFieldLevelEncryptionConfig" => return RusotoError::Service(UpdateFieldLevelEncryptionConfigError::NoSuchFieldLevelEncryptionConfig(parsed_error.message)),"NoSuchFieldLevelEncryptionProfile" => return RusotoError::Service(UpdateFieldLevelEncryptionConfigError::NoSuchFieldLevelEncryptionProfile(parsed_error.message)),"PreconditionFailed" => return RusotoError::Service(UpdateFieldLevelEncryptionConfigError::PreconditionFailed(parsed_error.message)),"QueryArgProfileEmpty" => return RusotoError::Service(UpdateFieldLevelEncryptionConfigError::QueryArgProfileEmpty(parsed_error.message)),"TooManyFieldLevelEncryptionContentTypeProfiles" => return RusotoError::Service(UpdateFieldLevelEncryptionConfigError::TooManyFieldLevelEncryptionContentTypeProfiles(parsed_error.message)),"TooManyFieldLevelEncryptionQueryArgProfiles" => return RusotoError::Service(UpdateFieldLevelEncryptionConfigError::TooManyFieldLevelEncryptionQueryArgProfiles(parsed_error.message)),_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for UpdateFieldLevelEncryptionConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateFieldLevelEncryptionConfigError {
fn description(&self) -> &str {
match *self {
UpdateFieldLevelEncryptionConfigError::AccessDenied(ref cause) => cause,
UpdateFieldLevelEncryptionConfigError::IllegalUpdate(ref cause) => cause,
UpdateFieldLevelEncryptionConfigError::InconsistentQuantities(ref cause) => cause,
UpdateFieldLevelEncryptionConfigError::InvalidArgument(ref cause) => cause,
UpdateFieldLevelEncryptionConfigError::InvalidIfMatchVersion(ref cause) => cause,
UpdateFieldLevelEncryptionConfigError::NoSuchFieldLevelEncryptionConfig(ref cause) => cause,
UpdateFieldLevelEncryptionConfigError::NoSuchFieldLevelEncryptionProfile(ref cause) => cause,
UpdateFieldLevelEncryptionConfigError::PreconditionFailed(ref cause) => cause,
UpdateFieldLevelEncryptionConfigError::QueryArgProfileEmpty(ref cause) => cause,
UpdateFieldLevelEncryptionConfigError::TooManyFieldLevelEncryptionContentTypeProfiles(ref cause) => cause,
UpdateFieldLevelEncryptionConfigError::TooManyFieldLevelEncryptionQueryArgProfiles(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateFieldLevelEncryptionProfileError {
AccessDenied(String),
FieldLevelEncryptionProfileAlreadyExists(String),
FieldLevelEncryptionProfileSizeExceeded(String),
IllegalUpdate(String),
InconsistentQuantities(String),
InvalidArgument(String),
InvalidIfMatchVersion(String),
NoSuchFieldLevelEncryptionProfile(String),
NoSuchPublicKey(String),
PreconditionFailed(String),
TooManyFieldLevelEncryptionEncryptionEntities(String),
TooManyFieldLevelEncryptionFieldPatterns(String),
}
impl UpdateFieldLevelEncryptionProfileError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<UpdateFieldLevelEncryptionProfileError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => return RusotoError::Service(UpdateFieldLevelEncryptionProfileError::AccessDenied(parsed_error.message)),"FieldLevelEncryptionProfileAlreadyExists" => return RusotoError::Service(UpdateFieldLevelEncryptionProfileError::FieldLevelEncryptionProfileAlreadyExists(parsed_error.message)),"FieldLevelEncryptionProfileSizeExceeded" => return RusotoError::Service(UpdateFieldLevelEncryptionProfileError::FieldLevelEncryptionProfileSizeExceeded(parsed_error.message)),"IllegalUpdate" => return RusotoError::Service(UpdateFieldLevelEncryptionProfileError::IllegalUpdate(parsed_error.message)),"InconsistentQuantities" => return RusotoError::Service(UpdateFieldLevelEncryptionProfileError::InconsistentQuantities(parsed_error.message)),"InvalidArgument" => return RusotoError::Service(UpdateFieldLevelEncryptionProfileError::InvalidArgument(parsed_error.message)),"InvalidIfMatchVersion" => return RusotoError::Service(UpdateFieldLevelEncryptionProfileError::InvalidIfMatchVersion(parsed_error.message)),"NoSuchFieldLevelEncryptionProfile" => return RusotoError::Service(UpdateFieldLevelEncryptionProfileError::NoSuchFieldLevelEncryptionProfile(parsed_error.message)),"NoSuchPublicKey" => return RusotoError::Service(UpdateFieldLevelEncryptionProfileError::NoSuchPublicKey(parsed_error.message)),"PreconditionFailed" => return RusotoError::Service(UpdateFieldLevelEncryptionProfileError::PreconditionFailed(parsed_error.message)),"TooManyFieldLevelEncryptionEncryptionEntities" => return RusotoError::Service(UpdateFieldLevelEncryptionProfileError::TooManyFieldLevelEncryptionEncryptionEntities(parsed_error.message)),"TooManyFieldLevelEncryptionFieldPatterns" => return RusotoError::Service(UpdateFieldLevelEncryptionProfileError::TooManyFieldLevelEncryptionFieldPatterns(parsed_error.message)),_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for UpdateFieldLevelEncryptionProfileError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateFieldLevelEncryptionProfileError {
fn description(&self) -> &str {
match *self {
UpdateFieldLevelEncryptionProfileError::AccessDenied(ref cause) => cause,
UpdateFieldLevelEncryptionProfileError::FieldLevelEncryptionProfileAlreadyExists(ref cause) => cause,
UpdateFieldLevelEncryptionProfileError::FieldLevelEncryptionProfileSizeExceeded(ref cause) => cause,
UpdateFieldLevelEncryptionProfileError::IllegalUpdate(ref cause) => cause,
UpdateFieldLevelEncryptionProfileError::InconsistentQuantities(ref cause) => cause,
UpdateFieldLevelEncryptionProfileError::InvalidArgument(ref cause) => cause,
UpdateFieldLevelEncryptionProfileError::InvalidIfMatchVersion(ref cause) => cause,
UpdateFieldLevelEncryptionProfileError::NoSuchFieldLevelEncryptionProfile(ref cause) => cause,
UpdateFieldLevelEncryptionProfileError::NoSuchPublicKey(ref cause) => cause,
UpdateFieldLevelEncryptionProfileError::PreconditionFailed(ref cause) => cause,
UpdateFieldLevelEncryptionProfileError::TooManyFieldLevelEncryptionEncryptionEntities(ref cause) => cause,
UpdateFieldLevelEncryptionProfileError::TooManyFieldLevelEncryptionFieldPatterns(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdatePublicKeyError {
AccessDenied(String),
CannotChangeImmutablePublicKeyFields(String),
IllegalUpdate(String),
InvalidArgument(String),
InvalidIfMatchVersion(String),
NoSuchPublicKey(String),
PreconditionFailed(String),
}
impl UpdatePublicKeyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdatePublicKeyError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(UpdatePublicKeyError::AccessDenied(
parsed_error.message,
))
}
"CannotChangeImmutablePublicKeyFields" => {
return RusotoError::Service(
UpdatePublicKeyError::CannotChangeImmutablePublicKeyFields(
parsed_error.message,
),
)
}
"IllegalUpdate" => {
return RusotoError::Service(UpdatePublicKeyError::IllegalUpdate(
parsed_error.message,
))
}
"InvalidArgument" => {
return RusotoError::Service(UpdatePublicKeyError::InvalidArgument(
parsed_error.message,
))
}
"InvalidIfMatchVersion" => {
return RusotoError::Service(UpdatePublicKeyError::InvalidIfMatchVersion(
parsed_error.message,
))
}
"NoSuchPublicKey" => {
return RusotoError::Service(UpdatePublicKeyError::NoSuchPublicKey(
parsed_error.message,
))
}
"PreconditionFailed" => {
return RusotoError::Service(UpdatePublicKeyError::PreconditionFailed(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for UpdatePublicKeyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdatePublicKeyError {
fn description(&self) -> &str {
match *self {
UpdatePublicKeyError::AccessDenied(ref cause) => cause,
UpdatePublicKeyError::CannotChangeImmutablePublicKeyFields(ref cause) => cause,
UpdatePublicKeyError::IllegalUpdate(ref cause) => cause,
UpdatePublicKeyError::InvalidArgument(ref cause) => cause,
UpdatePublicKeyError::InvalidIfMatchVersion(ref cause) => cause,
UpdatePublicKeyError::NoSuchPublicKey(ref cause) => cause,
UpdatePublicKeyError::PreconditionFailed(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateStreamingDistributionError {
AccessDenied(String),
CNAMEAlreadyExists(String),
IllegalUpdate(String),
InconsistentQuantities(String),
InvalidArgument(String),
InvalidIfMatchVersion(String),
InvalidOriginAccessIdentity(String),
MissingBody(String),
NoSuchStreamingDistribution(String),
PreconditionFailed(String),
TooManyStreamingDistributionCNAMEs(String),
TooManyTrustedSigners(String),
TrustedSignerDoesNotExist(String),
}
impl UpdateStreamingDistributionError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<UpdateStreamingDistributionError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"AccessDenied" => {
return RusotoError::Service(
UpdateStreamingDistributionError::AccessDenied(parsed_error.message),
)
}
"CNAMEAlreadyExists" => {
return RusotoError::Service(
UpdateStreamingDistributionError::CNAMEAlreadyExists(
parsed_error.message,
),
)
}
"IllegalUpdate" => {
return RusotoError::Service(
UpdateStreamingDistributionError::IllegalUpdate(parsed_error.message),
)
}
"InconsistentQuantities" => {
return RusotoError::Service(
UpdateStreamingDistributionError::InconsistentQuantities(
parsed_error.message,
),
)
}
"InvalidArgument" => {
return RusotoError::Service(
UpdateStreamingDistributionError::InvalidArgument(parsed_error.message),
)
}
"InvalidIfMatchVersion" => {
return RusotoError::Service(
UpdateStreamingDistributionError::InvalidIfMatchVersion(
parsed_error.message,
),
)
}
"InvalidOriginAccessIdentity" => {
return RusotoError::Service(
UpdateStreamingDistributionError::InvalidOriginAccessIdentity(
parsed_error.message,
),
)
}
"MissingBody" => {
return RusotoError::Service(UpdateStreamingDistributionError::MissingBody(
parsed_error.message,
))
}
"NoSuchStreamingDistribution" => {
return RusotoError::Service(
UpdateStreamingDistributionError::NoSuchStreamingDistribution(
parsed_error.message,
),
)
}
"PreconditionFailed" => {
return RusotoError::Service(
UpdateStreamingDistributionError::PreconditionFailed(
parsed_error.message,
),
)
}
"TooManyStreamingDistributionCNAMEs" => {
return RusotoError::Service(
UpdateStreamingDistributionError::TooManyStreamingDistributionCNAMEs(
parsed_error.message,
),
)
}
"TooManyTrustedSigners" => {
return RusotoError::Service(
UpdateStreamingDistributionError::TooManyTrustedSigners(
parsed_error.message,
),
)
}
"TrustedSignerDoesNotExist" => {
return RusotoError::Service(
UpdateStreamingDistributionError::TrustedSignerDoesNotExist(
parsed_error.message,
),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for UpdateStreamingDistributionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateStreamingDistributionError {
fn description(&self) -> &str {
match *self {
UpdateStreamingDistributionError::AccessDenied(ref cause) => cause,
UpdateStreamingDistributionError::CNAMEAlreadyExists(ref cause) => cause,
UpdateStreamingDistributionError::IllegalUpdate(ref cause) => cause,
UpdateStreamingDistributionError::InconsistentQuantities(ref cause) => cause,
UpdateStreamingDistributionError::InvalidArgument(ref cause) => cause,
UpdateStreamingDistributionError::InvalidIfMatchVersion(ref cause) => cause,
UpdateStreamingDistributionError::InvalidOriginAccessIdentity(ref cause) => cause,
UpdateStreamingDistributionError::MissingBody(ref cause) => cause,
UpdateStreamingDistributionError::NoSuchStreamingDistribution(ref cause) => cause,
UpdateStreamingDistributionError::PreconditionFailed(ref cause) => cause,
UpdateStreamingDistributionError::TooManyStreamingDistributionCNAMEs(ref cause) => {
cause
}
UpdateStreamingDistributionError::TooManyTrustedSigners(ref cause) => cause,
UpdateStreamingDistributionError::TrustedSignerDoesNotExist(ref cause) => cause,
}
}
}
pub trait CloudFront {
fn create_cloud_front_origin_access_identity(
&self,
input: CreateCloudFrontOriginAccessIdentityRequest,
) -> RusotoFuture<
CreateCloudFrontOriginAccessIdentityResult,
CreateCloudFrontOriginAccessIdentityError,
>;
fn create_distribution(
&self,
input: CreateDistributionRequest,
) -> RusotoFuture<CreateDistributionResult, CreateDistributionError>;
fn create_distribution_with_tags(
&self,
input: CreateDistributionWithTagsRequest,
) -> RusotoFuture<CreateDistributionWithTagsResult, CreateDistributionWithTagsError>;
fn create_field_level_encryption_config(
&self,
input: CreateFieldLevelEncryptionConfigRequest,
) -> RusotoFuture<CreateFieldLevelEncryptionConfigResult, CreateFieldLevelEncryptionConfigError>;
fn create_field_level_encryption_profile(
&self,
input: CreateFieldLevelEncryptionProfileRequest,
) -> RusotoFuture<CreateFieldLevelEncryptionProfileResult, CreateFieldLevelEncryptionProfileError>;
fn create_invalidation(
&self,
input: CreateInvalidationRequest,
) -> RusotoFuture<CreateInvalidationResult, CreateInvalidationError>;
fn create_public_key(
&self,
input: CreatePublicKeyRequest,
) -> RusotoFuture<CreatePublicKeyResult, CreatePublicKeyError>;
fn create_streaming_distribution(
&self,
input: CreateStreamingDistributionRequest,
) -> RusotoFuture<CreateStreamingDistributionResult, CreateStreamingDistributionError>;
fn create_streaming_distribution_with_tags(
&self,
input: CreateStreamingDistributionWithTagsRequest,
) -> RusotoFuture<
CreateStreamingDistributionWithTagsResult,
CreateStreamingDistributionWithTagsError,
>;
fn delete_cloud_front_origin_access_identity(
&self,
input: DeleteCloudFrontOriginAccessIdentityRequest,
) -> RusotoFuture<(), DeleteCloudFrontOriginAccessIdentityError>;
fn delete_distribution(
&self,
input: DeleteDistributionRequest,
) -> RusotoFuture<(), DeleteDistributionError>;
fn delete_field_level_encryption_config(
&self,
input: DeleteFieldLevelEncryptionConfigRequest,
) -> RusotoFuture<(), DeleteFieldLevelEncryptionConfigError>;
fn delete_field_level_encryption_profile(
&self,
input: DeleteFieldLevelEncryptionProfileRequest,
) -> RusotoFuture<(), DeleteFieldLevelEncryptionProfileError>;
fn delete_public_key(
&self,
input: DeletePublicKeyRequest,
) -> RusotoFuture<(), DeletePublicKeyError>;
fn delete_streaming_distribution(
&self,
input: DeleteStreamingDistributionRequest,
) -> RusotoFuture<(), DeleteStreamingDistributionError>;
fn get_cloud_front_origin_access_identity(
&self,
input: GetCloudFrontOriginAccessIdentityRequest,
) -> RusotoFuture<GetCloudFrontOriginAccessIdentityResult, GetCloudFrontOriginAccessIdentityError>;
fn get_cloud_front_origin_access_identity_config(
&self,
input: GetCloudFrontOriginAccessIdentityConfigRequest,
) -> RusotoFuture<
GetCloudFrontOriginAccessIdentityConfigResult,
GetCloudFrontOriginAccessIdentityConfigError,
>;
fn get_distribution(
&self,
input: GetDistributionRequest,
) -> RusotoFuture<GetDistributionResult, GetDistributionError>;
fn get_distribution_config(
&self,
input: GetDistributionConfigRequest,
) -> RusotoFuture<GetDistributionConfigResult, GetDistributionConfigError>;
fn get_field_level_encryption(
&self,
input: GetFieldLevelEncryptionRequest,
) -> RusotoFuture<GetFieldLevelEncryptionResult, GetFieldLevelEncryptionError>;
fn get_field_level_encryption_config(
&self,
input: GetFieldLevelEncryptionConfigRequest,
) -> RusotoFuture<GetFieldLevelEncryptionConfigResult, GetFieldLevelEncryptionConfigError>;
fn get_field_level_encryption_profile(
&self,
input: GetFieldLevelEncryptionProfileRequest,
) -> RusotoFuture<GetFieldLevelEncryptionProfileResult, GetFieldLevelEncryptionProfileError>;
fn get_field_level_encryption_profile_config(
&self,
input: GetFieldLevelEncryptionProfileConfigRequest,
) -> RusotoFuture<
GetFieldLevelEncryptionProfileConfigResult,
GetFieldLevelEncryptionProfileConfigError,
>;
fn get_invalidation(
&self,
input: GetInvalidationRequest,
) -> RusotoFuture<GetInvalidationResult, GetInvalidationError>;
fn get_public_key(
&self,
input: GetPublicKeyRequest,
) -> RusotoFuture<GetPublicKeyResult, GetPublicKeyError>;
fn get_public_key_config(
&self,
input: GetPublicKeyConfigRequest,
) -> RusotoFuture<GetPublicKeyConfigResult, GetPublicKeyConfigError>;
fn get_streaming_distribution(
&self,
input: GetStreamingDistributionRequest,
) -> RusotoFuture<GetStreamingDistributionResult, GetStreamingDistributionError>;
fn get_streaming_distribution_config(
&self,
input: GetStreamingDistributionConfigRequest,
) -> RusotoFuture<GetStreamingDistributionConfigResult, GetStreamingDistributionConfigError>;
fn list_cloud_front_origin_access_identities(
&self,
input: ListCloudFrontOriginAccessIdentitiesRequest,
) -> RusotoFuture<
ListCloudFrontOriginAccessIdentitiesResult,
ListCloudFrontOriginAccessIdentitiesError,
>;
fn list_distributions(
&self,
input: ListDistributionsRequest,
) -> RusotoFuture<ListDistributionsResult, ListDistributionsError>;
fn list_distributions_by_web_acl_id(
&self,
input: ListDistributionsByWebACLIdRequest,
) -> RusotoFuture<ListDistributionsByWebACLIdResult, ListDistributionsByWebACLIdError>;
fn list_field_level_encryption_configs(
&self,
input: ListFieldLevelEncryptionConfigsRequest,
) -> RusotoFuture<ListFieldLevelEncryptionConfigsResult, ListFieldLevelEncryptionConfigsError>;
fn list_field_level_encryption_profiles(
&self,
input: ListFieldLevelEncryptionProfilesRequest,
) -> RusotoFuture<ListFieldLevelEncryptionProfilesResult, ListFieldLevelEncryptionProfilesError>;
fn list_invalidations(
&self,
input: ListInvalidationsRequest,
) -> RusotoFuture<ListInvalidationsResult, ListInvalidationsError>;
fn list_public_keys(
&self,
input: ListPublicKeysRequest,
) -> RusotoFuture<ListPublicKeysResult, ListPublicKeysError>;
fn list_streaming_distributions(
&self,
input: ListStreamingDistributionsRequest,
) -> RusotoFuture<ListStreamingDistributionsResult, ListStreamingDistributionsError>;
fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> RusotoFuture<ListTagsForResourceResult, ListTagsForResourceError>;
fn tag_resource(&self, input: TagResourceRequest) -> RusotoFuture<(), TagResourceError>;
fn untag_resource(&self, input: UntagResourceRequest) -> RusotoFuture<(), UntagResourceError>;
fn update_cloud_front_origin_access_identity(
&self,
input: UpdateCloudFrontOriginAccessIdentityRequest,
) -> RusotoFuture<
UpdateCloudFrontOriginAccessIdentityResult,
UpdateCloudFrontOriginAccessIdentityError,
>;
fn update_distribution(
&self,
input: UpdateDistributionRequest,
) -> RusotoFuture<UpdateDistributionResult, UpdateDistributionError>;
fn update_field_level_encryption_config(
&self,
input: UpdateFieldLevelEncryptionConfigRequest,
) -> RusotoFuture<UpdateFieldLevelEncryptionConfigResult, UpdateFieldLevelEncryptionConfigError>;
fn update_field_level_encryption_profile(
&self,
input: UpdateFieldLevelEncryptionProfileRequest,
) -> RusotoFuture<UpdateFieldLevelEncryptionProfileResult, UpdateFieldLevelEncryptionProfileError>;
fn update_public_key(
&self,
input: UpdatePublicKeyRequest,
) -> RusotoFuture<UpdatePublicKeyResult, UpdatePublicKeyError>;
fn update_streaming_distribution(
&self,
input: UpdateStreamingDistributionRequest,
) -> RusotoFuture<UpdateStreamingDistributionResult, UpdateStreamingDistributionError>;
}
#[derive(Clone)]
pub struct CloudFrontClient {
client: Client,
region: region::Region,
}
impl CloudFrontClient {
pub fn new(region: region::Region) -> CloudFrontClient {
CloudFrontClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> CloudFrontClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
CloudFrontClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl CloudFront for CloudFrontClient {
#[allow(unused_variables, warnings)]
fn create_cloud_front_origin_access_identity(
&self,
input: CreateCloudFrontOriginAccessIdentityRequest,
) -> RusotoFuture<
CreateCloudFrontOriginAccessIdentityResult,
CreateCloudFrontOriginAccessIdentityError,
> {
let request_uri = "/2018-11-05/origin-access-identity/cloudfront";
let mut request = SignedRequest::new("POST", "cloudfront", &self.region, &request_uri);
let mut writer = EventWriter::new(Vec::new());
CloudFrontOriginAccessIdentityConfigSerializer::serialize(
&mut writer,
"CloudFrontOriginAccessIdentityConfig",
&input.cloud_front_origin_access_identity_config,
);
request.set_payload(Some(writer.into_inner()));
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateCloudFrontOriginAccessIdentityError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = CreateCloudFrontOriginAccessIdentityResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = CreateCloudFrontOriginAccessIdentityResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
if let Some(location) = response.headers.get("Location") {
let value = location.to_owned();
result.location = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn create_distribution(
&self,
input: CreateDistributionRequest,
) -> RusotoFuture<CreateDistributionResult, CreateDistributionError> {
let request_uri = "/2018-11-05/distribution";
let mut request = SignedRequest::new("POST", "cloudfront", &self.region, &request_uri);
let mut writer = EventWriter::new(Vec::new());
DistributionConfigSerializer::serialize(
&mut writer,
"DistributionConfig",
&input.distribution_config,
);
request.set_payload(Some(writer.into_inner()));
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateDistributionError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = CreateDistributionResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = CreateDistributionResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
if let Some(location) = response.headers.get("Location") {
let value = location.to_owned();
result.location = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn create_distribution_with_tags(
&self,
input: CreateDistributionWithTagsRequest,
) -> RusotoFuture<CreateDistributionWithTagsResult, CreateDistributionWithTagsError> {
let request_uri = "/2018-11-05/distribution";
let mut request = SignedRequest::new("POST", "cloudfront", &self.region, &request_uri);
let mut params = Params::new();
params.put_key("WithTags");
request.set_params(params);
let mut writer = EventWriter::new(Vec::new());
DistributionConfigWithTagsSerializer::serialize(
&mut writer,
"DistributionConfigWithTags",
&input.distribution_config_with_tags,
);
request.set_payload(Some(writer.into_inner()));
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateDistributionWithTagsError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = CreateDistributionWithTagsResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = CreateDistributionWithTagsResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
if let Some(location) = response.headers.get("Location") {
let value = location.to_owned();
result.location = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn create_field_level_encryption_config(
&self,
input: CreateFieldLevelEncryptionConfigRequest,
) -> RusotoFuture<CreateFieldLevelEncryptionConfigResult, CreateFieldLevelEncryptionConfigError>
{
let request_uri = "/2018-11-05/field-level-encryption";
let mut request = SignedRequest::new("POST", "cloudfront", &self.region, &request_uri);
let mut writer = EventWriter::new(Vec::new());
FieldLevelEncryptionConfigSerializer::serialize(
&mut writer,
"FieldLevelEncryptionConfig",
&input.field_level_encryption_config,
);
request.set_payload(Some(writer.into_inner()));
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateFieldLevelEncryptionConfigError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = CreateFieldLevelEncryptionConfigResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = CreateFieldLevelEncryptionConfigResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
if let Some(location) = response.headers.get("Location") {
let value = location.to_owned();
result.location = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn create_field_level_encryption_profile(
&self,
input: CreateFieldLevelEncryptionProfileRequest,
) -> RusotoFuture<CreateFieldLevelEncryptionProfileResult, CreateFieldLevelEncryptionProfileError>
{
let request_uri = "/2018-11-05/field-level-encryption-profile";
let mut request = SignedRequest::new("POST", "cloudfront", &self.region, &request_uri);
let mut writer = EventWriter::new(Vec::new());
FieldLevelEncryptionProfileConfigSerializer::serialize(
&mut writer,
"FieldLevelEncryptionProfileConfig",
&input.field_level_encryption_profile_config,
);
request.set_payload(Some(writer.into_inner()));
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateFieldLevelEncryptionProfileError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = CreateFieldLevelEncryptionProfileResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = CreateFieldLevelEncryptionProfileResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
if let Some(location) = response.headers.get("Location") {
let value = location.to_owned();
result.location = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn create_invalidation(
&self,
input: CreateInvalidationRequest,
) -> RusotoFuture<CreateInvalidationResult, CreateInvalidationError> {
let request_uri = format!(
"/2018-11-05/distribution/{distribution_id}/invalidation",
distribution_id = input.distribution_id
);
let mut request = SignedRequest::new("POST", "cloudfront", &self.region, &request_uri);
let mut writer = EventWriter::new(Vec::new());
InvalidationBatchSerializer::serialize(
&mut writer,
"InvalidationBatch",
&input.invalidation_batch,
);
request.set_payload(Some(writer.into_inner()));
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateInvalidationError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = CreateInvalidationResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = CreateInvalidationResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(location) = response.headers.get("Location") {
let value = location.to_owned();
result.location = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn create_public_key(
&self,
input: CreatePublicKeyRequest,
) -> RusotoFuture<CreatePublicKeyResult, CreatePublicKeyError> {
let request_uri = "/2018-11-05/public-key";
let mut request = SignedRequest::new("POST", "cloudfront", &self.region, &request_uri);
let mut writer = EventWriter::new(Vec::new());
PublicKeyConfigSerializer::serialize(
&mut writer,
"PublicKeyConfig",
&input.public_key_config,
);
request.set_payload(Some(writer.into_inner()));
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreatePublicKeyError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = CreatePublicKeyResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = CreatePublicKeyResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
if let Some(location) = response.headers.get("Location") {
let value = location.to_owned();
result.location = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn create_streaming_distribution(
&self,
input: CreateStreamingDistributionRequest,
) -> RusotoFuture<CreateStreamingDistributionResult, CreateStreamingDistributionError> {
let request_uri = "/2018-11-05/streaming-distribution";
let mut request = SignedRequest::new("POST", "cloudfront", &self.region, &request_uri);
let mut writer = EventWriter::new(Vec::new());
StreamingDistributionConfigSerializer::serialize(
&mut writer,
"StreamingDistributionConfig",
&input.streaming_distribution_config,
);
request.set_payload(Some(writer.into_inner()));
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateStreamingDistributionError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = CreateStreamingDistributionResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = CreateStreamingDistributionResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
if let Some(location) = response.headers.get("Location") {
let value = location.to_owned();
result.location = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn create_streaming_distribution_with_tags(
&self,
input: CreateStreamingDistributionWithTagsRequest,
) -> RusotoFuture<
CreateStreamingDistributionWithTagsResult,
CreateStreamingDistributionWithTagsError,
> {
let request_uri = "/2018-11-05/streaming-distribution";
let mut request = SignedRequest::new("POST", "cloudfront", &self.region, &request_uri);
let mut params = Params::new();
params.put_key("WithTags");
request.set_params(params);
let mut writer = EventWriter::new(Vec::new());
StreamingDistributionConfigWithTagsSerializer::serialize(
&mut writer,
"StreamingDistributionConfigWithTags",
&input.streaming_distribution_config_with_tags,
);
request.set_payload(Some(writer.into_inner()));
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateStreamingDistributionWithTagsError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = CreateStreamingDistributionWithTagsResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = CreateStreamingDistributionWithTagsResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
if let Some(location) = response.headers.get("Location") {
let value = location.to_owned();
result.location = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn delete_cloud_front_origin_access_identity(
&self,
input: DeleteCloudFrontOriginAccessIdentityRequest,
) -> RusotoFuture<(), DeleteCloudFrontOriginAccessIdentityError> {
let request_uri = format!(
"/2018-11-05/origin-access-identity/cloudfront/{id}",
id = input.id
);
let mut request = SignedRequest::new("DELETE", "cloudfront", &self.region, &request_uri);
if let Some(ref if_match) = input.if_match {
request.add_header("If-Match", &if_match.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteCloudFrontOriginAccessIdentityError::from_response(
response,
))
}));
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
#[allow(unused_variables, warnings)]
fn delete_distribution(
&self,
input: DeleteDistributionRequest,
) -> RusotoFuture<(), DeleteDistributionError> {
let request_uri = format!("/2018-11-05/distribution/{id}", id = input.id);
let mut request = SignedRequest::new("DELETE", "cloudfront", &self.region, &request_uri);
if let Some(ref if_match) = input.if_match {
request.add_header("If-Match", &if_match.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteDistributionError::from_response(response))),
);
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
#[allow(unused_variables, warnings)]
fn delete_field_level_encryption_config(
&self,
input: DeleteFieldLevelEncryptionConfigRequest,
) -> RusotoFuture<(), DeleteFieldLevelEncryptionConfigError> {
let request_uri = format!("/2018-11-05/field-level-encryption/{id}", id = input.id);
let mut request = SignedRequest::new("DELETE", "cloudfront", &self.region, &request_uri);
if let Some(ref if_match) = input.if_match {
request.add_header("If-Match", &if_match.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteFieldLevelEncryptionConfigError::from_response(
response,
))
}));
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
#[allow(unused_variables, warnings)]
fn delete_field_level_encryption_profile(
&self,
input: DeleteFieldLevelEncryptionProfileRequest,
) -> RusotoFuture<(), DeleteFieldLevelEncryptionProfileError> {
let request_uri = format!(
"/2018-11-05/field-level-encryption-profile/{id}",
id = input.id
);
let mut request = SignedRequest::new("DELETE", "cloudfront", &self.region, &request_uri);
if let Some(ref if_match) = input.if_match {
request.add_header("If-Match", &if_match.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteFieldLevelEncryptionProfileError::from_response(
response,
))
}));
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
#[allow(unused_variables, warnings)]
fn delete_public_key(
&self,
input: DeletePublicKeyRequest,
) -> RusotoFuture<(), DeletePublicKeyError> {
let request_uri = format!("/2018-11-05/public-key/{id}", id = input.id);
let mut request = SignedRequest::new("DELETE", "cloudfront", &self.region, &request_uri);
if let Some(ref if_match) = input.if_match {
request.add_header("If-Match", &if_match.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeletePublicKeyError::from_response(response))),
);
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
#[allow(unused_variables, warnings)]
fn delete_streaming_distribution(
&self,
input: DeleteStreamingDistributionRequest,
) -> RusotoFuture<(), DeleteStreamingDistributionError> {
let request_uri = format!("/2018-11-05/streaming-distribution/{id}", id = input.id);
let mut request = SignedRequest::new("DELETE", "cloudfront", &self.region, &request_uri);
if let Some(ref if_match) = input.if_match {
request.add_header("If-Match", &if_match.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteStreamingDistributionError::from_response(response))
}));
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
#[allow(unused_variables, warnings)]
fn get_cloud_front_origin_access_identity(
&self,
input: GetCloudFrontOriginAccessIdentityRequest,
) -> RusotoFuture<GetCloudFrontOriginAccessIdentityResult, GetCloudFrontOriginAccessIdentityError>
{
let request_uri = format!(
"/2018-11-05/origin-access-identity/cloudfront/{id}",
id = input.id
);
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(GetCloudFrontOriginAccessIdentityError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = GetCloudFrontOriginAccessIdentityResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = GetCloudFrontOriginAccessIdentityResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn get_cloud_front_origin_access_identity_config(
&self,
input: GetCloudFrontOriginAccessIdentityConfigRequest,
) -> RusotoFuture<
GetCloudFrontOriginAccessIdentityConfigResult,
GetCloudFrontOriginAccessIdentityConfigError,
> {
let request_uri = format!(
"/2018-11-05/origin-access-identity/cloudfront/{id}/config",
id = input.id
);
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(GetCloudFrontOriginAccessIdentityConfigError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = GetCloudFrontOriginAccessIdentityConfigResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result =
GetCloudFrontOriginAccessIdentityConfigResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn get_distribution(
&self,
input: GetDistributionRequest,
) -> RusotoFuture<GetDistributionResult, GetDistributionError> {
let request_uri = format!("/2018-11-05/distribution/{id}", id = input.id);
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetDistributionError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = GetDistributionResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = GetDistributionResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn get_distribution_config(
&self,
input: GetDistributionConfigRequest,
) -> RusotoFuture<GetDistributionConfigResult, GetDistributionConfigError> {
let request_uri = format!("/2018-11-05/distribution/{id}/config", id = input.id);
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(GetDistributionConfigError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = GetDistributionConfigResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = GetDistributionConfigResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn get_field_level_encryption(
&self,
input: GetFieldLevelEncryptionRequest,
) -> RusotoFuture<GetFieldLevelEncryptionResult, GetFieldLevelEncryptionError> {
let request_uri = format!("/2018-11-05/field-level-encryption/{id}", id = input.id);
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(GetFieldLevelEncryptionError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = GetFieldLevelEncryptionResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = GetFieldLevelEncryptionResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn get_field_level_encryption_config(
&self,
input: GetFieldLevelEncryptionConfigRequest,
) -> RusotoFuture<GetFieldLevelEncryptionConfigResult, GetFieldLevelEncryptionConfigError> {
let request_uri = format!(
"/2018-11-05/field-level-encryption/{id}/config",
id = input.id
);
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(GetFieldLevelEncryptionConfigError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = GetFieldLevelEncryptionConfigResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = GetFieldLevelEncryptionConfigResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn get_field_level_encryption_profile(
&self,
input: GetFieldLevelEncryptionProfileRequest,
) -> RusotoFuture<GetFieldLevelEncryptionProfileResult, GetFieldLevelEncryptionProfileError>
{
let request_uri = format!(
"/2018-11-05/field-level-encryption-profile/{id}",
id = input.id
);
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(GetFieldLevelEncryptionProfileError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = GetFieldLevelEncryptionProfileResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = GetFieldLevelEncryptionProfileResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn get_field_level_encryption_profile_config(
&self,
input: GetFieldLevelEncryptionProfileConfigRequest,
) -> RusotoFuture<
GetFieldLevelEncryptionProfileConfigResult,
GetFieldLevelEncryptionProfileConfigError,
> {
let request_uri = format!(
"/2018-11-05/field-level-encryption-profile/{id}/config",
id = input.id
);
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(GetFieldLevelEncryptionProfileConfigError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = GetFieldLevelEncryptionProfileConfigResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = GetFieldLevelEncryptionProfileConfigResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn get_invalidation(
&self,
input: GetInvalidationRequest,
) -> RusotoFuture<GetInvalidationResult, GetInvalidationError> {
let request_uri = format!(
"/2018-11-05/distribution/{distribution_id}/invalidation/{id}",
distribution_id = input.distribution_id,
id = input.id
);
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetInvalidationError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = GetInvalidationResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = GetInvalidationResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn get_public_key(
&self,
input: GetPublicKeyRequest,
) -> RusotoFuture<GetPublicKeyResult, GetPublicKeyError> {
let request_uri = format!("/2018-11-05/public-key/{id}", id = input.id);
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetPublicKeyError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = GetPublicKeyResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result =
GetPublicKeyResultDeserializer::deserialize(&actual_tag_name, &mut stack)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn get_public_key_config(
&self,
input: GetPublicKeyConfigRequest,
) -> RusotoFuture<GetPublicKeyConfigResult, GetPublicKeyConfigError> {
let request_uri = format!("/2018-11-05/public-key/{id}/config", id = input.id);
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetPublicKeyConfigError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = GetPublicKeyConfigResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = GetPublicKeyConfigResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn get_streaming_distribution(
&self,
input: GetStreamingDistributionRequest,
) -> RusotoFuture<GetStreamingDistributionResult, GetStreamingDistributionError> {
let request_uri = format!("/2018-11-05/streaming-distribution/{id}", id = input.id);
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(GetStreamingDistributionError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = GetStreamingDistributionResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = GetStreamingDistributionResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn get_streaming_distribution_config(
&self,
input: GetStreamingDistributionConfigRequest,
) -> RusotoFuture<GetStreamingDistributionConfigResult, GetStreamingDistributionConfigError>
{
let request_uri = format!(
"/2018-11-05/streaming-distribution/{id}/config",
id = input.id
);
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(GetStreamingDistributionConfigError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = GetStreamingDistributionConfigResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = GetStreamingDistributionConfigResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn list_cloud_front_origin_access_identities(
&self,
input: ListCloudFrontOriginAccessIdentitiesRequest,
) -> RusotoFuture<
ListCloudFrontOriginAccessIdentitiesResult,
ListCloudFrontOriginAccessIdentitiesError,
> {
let request_uri = "/2018-11-05/origin-access-identity/cloudfront";
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
let mut params = Params::new();
if let Some(ref x) = input.marker {
params.put("Marker", x);
}
if let Some(ref x) = input.max_items {
params.put("MaxItems", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(ListCloudFrontOriginAccessIdentitiesError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = ListCloudFrontOriginAccessIdentitiesResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = ListCloudFrontOriginAccessIdentitiesResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn list_distributions(
&self,
input: ListDistributionsRequest,
) -> RusotoFuture<ListDistributionsResult, ListDistributionsError> {
let request_uri = "/2018-11-05/distribution";
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
let mut params = Params::new();
if let Some(ref x) = input.marker {
params.put("Marker", x);
}
if let Some(ref x) = input.max_items {
params.put("MaxItems", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListDistributionsError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = ListDistributionsResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = ListDistributionsResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn list_distributions_by_web_acl_id(
&self,
input: ListDistributionsByWebACLIdRequest,
) -> RusotoFuture<ListDistributionsByWebACLIdResult, ListDistributionsByWebACLIdError> {
let request_uri = format!(
"/2018-11-05/distributionsByWebACLId/{web_acl_id}",
web_acl_id = input.web_acl_id
);
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
let mut params = Params::new();
if let Some(ref x) = input.marker {
params.put("Marker", x);
}
if let Some(ref x) = input.max_items {
params.put("MaxItems", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(ListDistributionsByWebACLIdError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = ListDistributionsByWebACLIdResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = ListDistributionsByWebACLIdResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn list_field_level_encryption_configs(
&self,
input: ListFieldLevelEncryptionConfigsRequest,
) -> RusotoFuture<ListFieldLevelEncryptionConfigsResult, ListFieldLevelEncryptionConfigsError>
{
let request_uri = "/2018-11-05/field-level-encryption";
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
let mut params = Params::new();
if let Some(ref x) = input.marker {
params.put("Marker", x);
}
if let Some(ref x) = input.max_items {
params.put("MaxItems", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(ListFieldLevelEncryptionConfigsError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = ListFieldLevelEncryptionConfigsResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = ListFieldLevelEncryptionConfigsResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn list_field_level_encryption_profiles(
&self,
input: ListFieldLevelEncryptionProfilesRequest,
) -> RusotoFuture<ListFieldLevelEncryptionProfilesResult, ListFieldLevelEncryptionProfilesError>
{
let request_uri = "/2018-11-05/field-level-encryption-profile";
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
let mut params = Params::new();
if let Some(ref x) = input.marker {
params.put("Marker", x);
}
if let Some(ref x) = input.max_items {
params.put("MaxItems", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(ListFieldLevelEncryptionProfilesError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = ListFieldLevelEncryptionProfilesResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = ListFieldLevelEncryptionProfilesResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn list_invalidations(
&self,
input: ListInvalidationsRequest,
) -> RusotoFuture<ListInvalidationsResult, ListInvalidationsError> {
let request_uri = format!(
"/2018-11-05/distribution/{distribution_id}/invalidation",
distribution_id = input.distribution_id
);
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
let mut params = Params::new();
if let Some(ref x) = input.marker {
params.put("Marker", x);
}
if let Some(ref x) = input.max_items {
params.put("MaxItems", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListInvalidationsError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = ListInvalidationsResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = ListInvalidationsResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn list_public_keys(
&self,
input: ListPublicKeysRequest,
) -> RusotoFuture<ListPublicKeysResult, ListPublicKeysError> {
let request_uri = "/2018-11-05/public-key";
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
let mut params = Params::new();
if let Some(ref x) = input.marker {
params.put("Marker", x);
}
if let Some(ref x) = input.max_items {
params.put("MaxItems", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListPublicKeysError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = ListPublicKeysResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = ListPublicKeysResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn list_streaming_distributions(
&self,
input: ListStreamingDistributionsRequest,
) -> RusotoFuture<ListStreamingDistributionsResult, ListStreamingDistributionsError> {
let request_uri = "/2018-11-05/streaming-distribution";
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
let mut params = Params::new();
if let Some(ref x) = input.marker {
params.put("Marker", x);
}
if let Some(ref x) = input.max_items {
params.put("MaxItems", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(ListStreamingDistributionsError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = ListStreamingDistributionsResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = ListStreamingDistributionsResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> RusotoFuture<ListTagsForResourceResult, ListTagsForResourceError> {
let request_uri = "/2018-11-05/tagging";
let mut request = SignedRequest::new("GET", "cloudfront", &self.region, &request_uri);
let mut params = Params::new();
params.put("Resource", &input.resource);
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListTagsForResourceError::from_response(response))
}),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = ListTagsForResourceResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = ListTagsForResourceResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn tag_resource(&self, input: TagResourceRequest) -> RusotoFuture<(), TagResourceError> {
let request_uri = "/2018-11-05/tagging";
let mut request = SignedRequest::new("POST", "cloudfront", &self.region, &request_uri);
let mut params = Params::new();
params.put("Resource", &input.resource);
params.put("Operation", "Tag");
request.set_params(params);
let mut writer = EventWriter::new(Vec::new());
TagsSerializer::serialize(&mut writer, "Tags", &input.tags);
request.set_payload(Some(writer.into_inner()));
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(TagResourceError::from_response(response))),
);
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
#[allow(unused_variables, warnings)]
fn untag_resource(&self, input: UntagResourceRequest) -> RusotoFuture<(), UntagResourceError> {
let request_uri = "/2018-11-05/tagging";
let mut request = SignedRequest::new("POST", "cloudfront", &self.region, &request_uri);
let mut params = Params::new();
params.put("Resource", &input.resource);
params.put("Operation", "Untag");
request.set_params(params);
let mut writer = EventWriter::new(Vec::new());
TagKeysSerializer::serialize(&mut writer, "TagKeys", &input.tag_keys);
request.set_payload(Some(writer.into_inner()));
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UntagResourceError::from_response(response))),
);
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
#[allow(unused_variables, warnings)]
fn update_cloud_front_origin_access_identity(
&self,
input: UpdateCloudFrontOriginAccessIdentityRequest,
) -> RusotoFuture<
UpdateCloudFrontOriginAccessIdentityResult,
UpdateCloudFrontOriginAccessIdentityError,
> {
let request_uri = format!(
"/2018-11-05/origin-access-identity/cloudfront/{id}/config",
id = input.id
);
let mut request = SignedRequest::new("PUT", "cloudfront", &self.region, &request_uri);
if let Some(ref if_match) = input.if_match {
request.add_header("If-Match", &if_match.to_string());
}
let mut writer = EventWriter::new(Vec::new());
CloudFrontOriginAccessIdentityConfigSerializer::serialize(
&mut writer,
"CloudFrontOriginAccessIdentityConfig",
&input.cloud_front_origin_access_identity_config,
);
request.set_payload(Some(writer.into_inner()));
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateCloudFrontOriginAccessIdentityError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = UpdateCloudFrontOriginAccessIdentityResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = UpdateCloudFrontOriginAccessIdentityResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn update_distribution(
&self,
input: UpdateDistributionRequest,
) -> RusotoFuture<UpdateDistributionResult, UpdateDistributionError> {
let request_uri = format!("/2018-11-05/distribution/{id}/config", id = input.id);
let mut request = SignedRequest::new("PUT", "cloudfront", &self.region, &request_uri);
if let Some(ref if_match) = input.if_match {
request.add_header("If-Match", &if_match.to_string());
}
let mut writer = EventWriter::new(Vec::new());
DistributionConfigSerializer::serialize(
&mut writer,
"DistributionConfig",
&input.distribution_config,
);
request.set_payload(Some(writer.into_inner()));
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateDistributionError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = UpdateDistributionResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = UpdateDistributionResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn update_field_level_encryption_config(
&self,
input: UpdateFieldLevelEncryptionConfigRequest,
) -> RusotoFuture<UpdateFieldLevelEncryptionConfigResult, UpdateFieldLevelEncryptionConfigError>
{
let request_uri = format!(
"/2018-11-05/field-level-encryption/{id}/config",
id = input.id
);
let mut request = SignedRequest::new("PUT", "cloudfront", &self.region, &request_uri);
if let Some(ref if_match) = input.if_match {
request.add_header("If-Match", &if_match.to_string());
}
let mut writer = EventWriter::new(Vec::new());
FieldLevelEncryptionConfigSerializer::serialize(
&mut writer,
"FieldLevelEncryptionConfig",
&input.field_level_encryption_config,
);
request.set_payload(Some(writer.into_inner()));
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateFieldLevelEncryptionConfigError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = UpdateFieldLevelEncryptionConfigResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = UpdateFieldLevelEncryptionConfigResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn update_field_level_encryption_profile(
&self,
input: UpdateFieldLevelEncryptionProfileRequest,
) -> RusotoFuture<UpdateFieldLevelEncryptionProfileResult, UpdateFieldLevelEncryptionProfileError>
{
let request_uri = format!(
"/2018-11-05/field-level-encryption-profile/{id}/config",
id = input.id
);
let mut request = SignedRequest::new("PUT", "cloudfront", &self.region, &request_uri);
if let Some(ref if_match) = input.if_match {
request.add_header("If-Match", &if_match.to_string());
}
let mut writer = EventWriter::new(Vec::new());
FieldLevelEncryptionProfileConfigSerializer::serialize(
&mut writer,
"FieldLevelEncryptionProfileConfig",
&input.field_level_encryption_profile_config,
);
request.set_payload(Some(writer.into_inner()));
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateFieldLevelEncryptionProfileError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = UpdateFieldLevelEncryptionProfileResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = UpdateFieldLevelEncryptionProfileResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn update_public_key(
&self,
input: UpdatePublicKeyRequest,
) -> RusotoFuture<UpdatePublicKeyResult, UpdatePublicKeyError> {
let request_uri = format!("/2018-11-05/public-key/{id}/config", id = input.id);
let mut request = SignedRequest::new("PUT", "cloudfront", &self.region, &request_uri);
if let Some(ref if_match) = input.if_match {
request.add_header("If-Match", &if_match.to_string());
}
let mut writer = EventWriter::new(Vec::new());
PublicKeyConfigSerializer::serialize(
&mut writer,
"PublicKeyConfig",
&input.public_key_config,
);
request.set_payload(Some(writer.into_inner()));
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdatePublicKeyError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = UpdatePublicKeyResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = UpdatePublicKeyResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
Ok(result)
}))
})
}
#[allow(unused_variables, warnings)]
fn update_streaming_distribution(
&self,
input: UpdateStreamingDistributionRequest,
) -> RusotoFuture<UpdateStreamingDistributionResult, UpdateStreamingDistributionError> {
let request_uri = format!(
"/2018-11-05/streaming-distribution/{id}/config",
id = input.id
);
let mut request = SignedRequest::new("PUT", "cloudfront", &self.region, &request_uri);
if let Some(ref if_match) = input.if_match {
request.add_header("If-Match", &if_match.to_string());
}
let mut writer = EventWriter::new(Vec::new());
StreamingDistributionConfigSerializer::serialize(
&mut writer,
"StreamingDistributionConfig",
&input.streaming_distribution_config,
);
request.set_payload(Some(writer.into_inner()));
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateStreamingDistributionError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let mut result;
if response.body.is_empty() {
result = UpdateStreamingDistributionResult::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
result = UpdateStreamingDistributionResultDeserializer::deserialize(
&actual_tag_name,
&mut stack,
)?;
}
if let Some(e_tag) = response.headers.get("ETag") {
let value = e_tag.to_owned();
result.e_tag = Some(value)
};
Ok(result)
}))
})
}
}
#[cfg(test)]
mod protocol_tests {
extern crate rusoto_mock;
use self::rusoto_mock::*;
use super::*;
use rusoto_core::Region as rusoto_region;
#[test]
fn test_parse_valid_cloudfront_get_cloud_front_origin_access_identity() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"cloudfront-get-cloud-front-origin-access-identity.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
CloudFrontClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let request = GetCloudFrontOriginAccessIdentityRequest::default();
let result = client
.get_cloud_front_origin_access_identity(request)
.sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_cloudfront_get_distribution() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"cloudfront-get-distribution.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
CloudFrontClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let request = GetDistributionRequest::default();
let result = client.get_distribution(request).sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_cloudfront_get_invalidation() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"cloudfront-get-invalidation.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
CloudFrontClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let request = GetInvalidationRequest::default();
let result = client.get_invalidation(request).sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_cloudfront_get_streaming_distribution() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"cloudfront-get-streaming-distribution.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
CloudFrontClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let request = GetStreamingDistributionRequest::default();
let result = client.get_streaming_distribution(request).sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_cloudfront_list_cloud_front_origin_access_identities() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"cloudfront-list-cloud-front-origin-access-identities.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
CloudFrontClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let request = ListCloudFrontOriginAccessIdentitiesRequest::default();
let result = client
.list_cloud_front_origin_access_identities(request)
.sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_cloudfront_list_distributions() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"cloudfront-list-distributions.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
CloudFrontClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let request = ListDistributionsRequest::default();
let result = client.list_distributions(request).sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_cloudfront_list_invalidations() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"cloudfront-list-invalidations.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
CloudFrontClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let request = ListInvalidationsRequest::default();
let result = client.list_invalidations(request).sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_cloudfront_list_streaming_distributions() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"cloudfront-list-streaming-distributions.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
CloudFrontClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let request = ListStreamingDistributionsRequest::default();
let result = client.list_streaming_distributions(request).sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
}