#![allow(unused_variables)]
#![allow(dead_code)]
use std::str::FromStr;
use std::str;
use aws::common::params::{Params, ServiceParams};
use aws::common::xmlutil::*;
use aws::common::common::*;
use aws::errors::http::*;
use aws::errors::s3::*;
use aws::s3::header::*;
use aws::s3::bucket::*;
use aws::s3::acl::*;
use aws::s3::grant::*;
use aws::s3::writeparse::*;
pub type TagSet = Vec<Tag>;
pub type Parts = Vec<Part>;
pub type PartNumber = i32;
pub type UploadIdMarker = String;
pub type NextUploadIdMarker = String;
pub type MultipartUploadList = Vec<MultipartUpload>;
pub type PartNumberMarker = i32;
pub type NextPartNumberMarker = i32;
pub type MaxParts = i32;
pub type MaxUploads = i32;
pub type Expires = String;
pub type ObjectMetadataList = Vec<ObjectMetadata>;
pub type ObjectIdentifierList = Vec<ObjectIdentifier>;
pub type ObjectKey = String;
pub type ObjectVersionStorageClass = String;
pub type ObjectVersionId = String;
pub type DeleteMarkerVersionId = String;
pub type DeletedObjects = Vec<DeletedObject>;
pub type ObjectStorageClass = String;
pub type DeleteMarkers = Vec<DeleteMarkerEntry>;
pub type NextVersionIdMarker = String;
pub type Prefix = String;
pub struct TagParser;
pub struct TagWriter;
pub struct TagSetParser;
pub struct TagSetWriter;
pub struct PartNumberParser;
pub struct PartNumberWriter;
pub struct PartParser;
pub struct PartWriter;
pub struct MultipartUploadParser;
pub struct MultipartUploadWriter;
pub struct UploadIdMarkerParser;
pub struct UploadIdMarkerWriter;
pub struct NextUploadIdMarkerParser;
pub struct NextUploadIdMarkerWriter;
pub struct MultipartUploadListParser;
pub struct MultipartUploadListWriter;
pub struct MultipartUploadListOutputParser;
pub struct MultipartUploadListOutputWriter;
pub struct MultipartUploadListPartsOutputParser;
pub struct MultipartUploadListPartsOutputWriter;
pub struct MultipartUploadListPartsRequestParser;
pub struct MultipartUploadListPartsRequestWriter;
pub struct MultipartUploadCompleteOutputParser;
pub struct MultipartUploadCompleteOutputWriter;
pub struct GetObjectRequestParser;
pub struct GetObjectRequestWriter;
pub struct PutObjectOutputParser;
pub struct PutObjectOutputWriter;
pub struct MaxUploadsParser;
pub struct MaxUploadsWriter;
pub struct ExpiresParser;
pub struct ExpiresWriter;
pub struct ListObjectsOutputParser;
pub struct ListObjectsOutputWriter;
pub struct ObjectMetadataListParser;
pub struct ObjectMetadataListWriter;
pub struct ObjectMetadataParser;
pub struct ObjectMetadataWriter;
pub struct NextPartNumberMarkerParser;
pub struct NextPartNumberMarkerWriter;
pub struct MaxPartsParser;
pub struct MaxPartsWriter;
pub struct PartNumberMarkerParser;
pub struct PartNumberMarkerWriter;
pub struct PartsParser;
pub struct PartsWriter;
pub struct MultipartUploadAbortOutputWriter;
pub struct MultipartUploadAbortRequestParser;
pub struct MultipartUploadAbortRequestWriter;
pub struct MultipartUploadListRequestParser;
pub struct MultipartUploadListRequestWriter;
pub struct ObjectIdentifierListParser;
pub struct ObjectIdentifierListWriter;
pub struct DeleteParser;
pub struct DeleteWriter;
pub struct ObjectIdentifierParser;
pub struct ObjectIdentifierWriter;
pub struct DeleteObjectsRequestParser;
pub struct DeleteObjectsRequestWriter;
pub struct ObjectVersionParser;
pub struct ObjectVersionWriter;
pub struct ObjectKeyParser;
pub struct ObjectKeyWriter;
pub struct ObjectVersionStorageClassParser;
pub struct ObjectVersionStorageClassWriter;
pub struct CopyObjectResultParser;
pub struct CopyObjectResultWriter;
pub struct ObjectVersionIdParser;
pub struct ObjectVersionIdWriter;
pub struct DeletedObjectParser;
pub struct DeletedObjectWriter;
pub struct DeleteMarkerVersionIdParser;
pub struct DeleteMarkerVersionIdWriter;
pub struct DeletedObjectsParser;
pub struct DeletedObjectsWriter;
pub struct DeleteObjectOutputParser;
pub struct DeleteObjectOutputWriter;
pub struct DeleteObjectRequestParser;
pub struct DeleteObjectRequestWriter;
pub struct RestoreRequestParser;
pub struct RestoreRequestWriter;
pub struct RestoreObjectRequestParser;
pub struct RestoreObjectRequestWriter;
pub struct RestoreObjectOutputParser;
pub struct RestoreObjectOutputWriter;
pub struct CopyObjectOutputParser;
pub struct CopyObjectOutputWriter;
pub struct HeadObjectOutputParser;
pub struct HeadObjectOutputWriter;
pub struct ObjectVersionListParser;
pub struct ObjectVersionListWriter;
pub struct ObjectStorageClassParser;
pub struct ObjectStorageClassWriter;
pub struct CopyObjectRequestParser;
pub struct CopyObjectRequestWriter;
pub struct DeleteObjectsOutputParser;
pub struct DeleteObjectsOutputWriter;
pub struct GetObjectOutputParser;
pub struct GetObjectOutputWriter;
pub struct MultipartUploadCreateRequestParser;
pub struct MultipartUploadCreateRequestWriter;
pub struct GetObjectTorrentRequestParser;
pub struct GetObjectTorrentRequestWriter;
pub struct DeleteMarkerEntryParser;
pub struct DeleteMarkerEntryWriter;
pub struct DeleteMarkersParser;
pub struct DeleteMarkersWriter;
pub struct ListObjectsRequestParser;
pub struct ListObjectsRequestWriter;
pub struct NextVersionIdMarkerParser;
pub struct NextVersionIdMarkerWriter;
pub struct ListVersionsResultParser;
pub struct ListVersionsResultWriter;
pub struct ListObjectVersionsRequestParser;
pub struct ListObjectVersionsRequestWriter;
pub struct MultipartUploadCreateOutputParser;
pub struct MultipartUploadCreateOutputWriter;
struct HeadObjectRequestWriter;
struct HeadObjectRequestParser;
pub struct PrefixParser;
pub struct PrefixWriter;
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct ObjectVersion {
pub last_modified: LastModified,
pub version_id: ObjectVersionId,
pub e_tag: ETag,
pub storage_class: ObjectVersionStorageClass,
pub key: ObjectKey,
pub owner: Owner,
pub is_latest: IsLatest,
pub size: Size,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct ObjectMetadata {
pub last_modified: LastModified,
pub e_tag: ETag,
pub storage_class: ObjectStorageClass,
pub key: ObjectKey,
pub owner: Owner,
pub size: Size,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct Delete {
pub objects: ObjectIdentifierList,
pub quiet: Option<Quiet>,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct GetObjectOutput {
pub last_modified: LastModified,
pub content_range: ContentRange,
pub request_charged: RequestCharged,
pub content_encoding: ContentEncoding,
pub replication_status: ReplicationStatus,
pub storage_class: StorageClass,
pub server_side_encryption: ServerSideEncryption,
pub ssekms_key_id: SSEKMSKeyId,
pub content_disposition: ContentDisposition,
pub metadata: Metadata,
pub body: Body,
pub body_buffer: Vec<u8>,
pub is_body: bool,
pub accept_ranges: AcceptRanges,
pub website_redirect_location: WebsiteRedirectLocation,
pub expires: Expires,
pub delete_marker: DeleteMarker,
pub cache_control: CacheControl,
pub content_length: ContentLength,
pub expiration: Expiration,
pub missing_meta: MissingMeta,
pub restore: Restore,
pub sse_customer_algorithm: SSECustomerAlgorithm,
pub content_type: ContentType,
pub content_language: ContentLanguage,
pub version_id: ObjectVersionId,
pub e_tag: ETag,
pub sse_customer_key_md5: SSECustomerKeyMD5,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct RestoreObjectOutput {
pub request_charged: RequestCharged,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct RestoreObjectRequest {
pub version_id: Option<ObjectVersionId>,
pub restore_request: Option<RestoreRequest>,
pub bucket: BucketName,
pub request_payer: Option<RequestPayer>,
pub key: ObjectKey,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct RestoreRequest {
pub days: Days,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct DeleteObjectRequest {
pub mfa: Option<MFA>,
pub version_id: Option<ObjectVersionId>,
pub bucket: BucketName,
pub request_payer: Option<RequestPayer>,
pub key: ObjectKey,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct DeleteObjectOutput {
pub version_id: ObjectVersionId,
pub request_charged: RequestCharged,
pub delete_marker: DeleteMarker,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct DeleteObjectsOutput {
pub deleted: DeletedObjects,
pub errors: Errors,
pub request_charged: RequestCharged,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct DeletedObject {
pub version_id: ObjectVersionId,
pub delete_marker_version_id: DeleteMarkerVersionId,
pub key: ObjectKey,
pub delete_marker: DeleteMarker,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct PutObjectOutput {
pub sse_customer_algorithm: SSECustomerAlgorithm,
pub request_charged: RequestCharged,
pub version_id: ObjectVersionId,
pub e_tag: ETag,
pub expiration: Expiration,
pub server_side_encryption: ServerSideEncryption,
pub sse_customer_key_md5: SSECustomerKeyMD5,
pub ssekms_key_id: SSEKMSKeyId,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct TopicConfiguration {
pub id: Option<NotificationId>,
pub topic_arn: TopicArn,
pub events: EventList,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct QueueConfiguration {
pub id: Option<NotificationId>,
pub queue_arn: QueueArn,
pub events: EventList,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct ObjectIdentifier {
pub version_id: Option<ObjectVersionId>,
pub key: ObjectKey,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct MultipartUploadCreateRequest {
pub request_payer: Option<RequestPayer>,
pub content_encoding: Option<ContentEncoding>,
pub storage_class: Option<StorageClass>,
pub grant_read_acp: Option<GrantReadACP>,
pub server_side_encryption: Option<ServerSideEncryption>,
pub ssekms_key_id: Option<SSEKMSKeyId>,
pub content_disposition: Option<ContentDisposition>,
pub metadata: Option<Metadata>,
pub sse_customer_key: Option<SSECustomerKey>,
pub website_redirect_location: Option<WebsiteRedirectLocation>,
pub expires: Option<Expires>,
pub key: ObjectKey,
pub cache_control: Option<CacheControl>,
pub bucket: BucketName,
pub grant_read: Option<GrantRead>,
pub grant_write_acp: Option<GrantWriteACP>,
pub acl: Option<ObjectCannedACL>,
pub grant_full_control: Option<GrantFullControl>,
pub sse_customer_algorithm: Option<SSECustomerAlgorithm>,
pub content_type: Option<ContentType>,
pub content_language: Option<ContentLanguage>,
pub sse_customer_key_md5: Option<SSECustomerKeyMD5>,
}
#[derive(Debug, Default, RustcEncodable)]
pub struct MultipartUploadCompleteRequest <'a> {
pub multipart_upload: Option<&'a [u8]>,
pub upload_id: MultipartUploadId,
pub bucket: BucketName,
pub request_payer: Option<RequestPayer>,
pub key: ObjectKey,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct MultipartUploadAbortRequest {
pub upload_id: MultipartUploadId,
pub bucket: BucketName,
pub request_payer: Option<RequestPayer>,
pub key: ObjectKey,
}
#[derive(Debug, Default, RustcEncodable)]
pub struct MultipartUploadPartRequest <'a> {
pub body: Option<&'a [u8]>,
pub sse_customer_algorithm: Option<SSECustomerAlgorithm>,
pub request_payer: Option<RequestPayer>,
pub content_length: Option<ContentLength>,
pub content_md5: Option<ContentMD5>,
pub bucket: BucketName,
pub sse_customer_key: Option<SSECustomerKey>,
pub upload_id: MultipartUploadId,
pub key: ObjectKey,
pub sse_customer_key_md5: Option<SSECustomerKeyMD5>,
pub part_number: PartNumber,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct Part {
pub last_modified: LastModified,
pub part_number: PartNumber,
pub e_tag: ETag,
pub size: Size,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct MultipartUploadListPartsOutput {
pub initiator: Initiator,
pub bucket: BucketName,
pub next_part_number_marker: NextPartNumberMarker,
pub parts: Parts,
pub upload_id: MultipartUploadId,
pub storage_class: StorageClass,
pub key: ObjectKey,
pub request_charged: RequestCharged,
pub owner: Owner,
pub max_parts: MaxParts,
pub is_truncated: IsTruncated,
pub part_number_marker: PartNumberMarker,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct MultipartUploadListPartsRequest {
pub request_payer: Option<RequestPayer>,
pub bucket: BucketName,
pub upload_id: MultipartUploadId,
pub key: ObjectKey,
pub max_parts: Option<MaxParts>,
pub part_number_marker: Option<PartNumberMarker>,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct MultipartUploadListRequest {
pub upload_id_marker: Option<UploadIdMarker>,
pub bucket: BucketName,
pub delimiter: Option<Delimiter>,
pub prefix: Option<Prefix>,
pub key_marker: Option<KeyMarker>,
pub max_uploads: Option<MaxUploads>,
pub encoding_type: Option<EncodingType>,
}
#[derive(Debug, Default, RustcEncodable)]
pub struct PutObjectRequest<'a> {
pub request_payer: Option<RequestPayer>,
pub content_encoding: Option<ContentEncoding>,
pub storage_class: Option<StorageClass>,
pub grant_read_acp: Option<GrantReadACP>,
pub server_side_encryption: Option<ServerSideEncryption>,
pub ssekms_key_id: Option<SSEKMSKeyId>,
pub content_disposition: Option<ContentDisposition>,
pub metadata: Option<Metadata>,
pub body: Option<&'a [u8]>,
pub sse_customer_key: Option<SSECustomerKey>,
pub website_redirect_location: Option<WebsiteRedirectLocation>,
pub expires: Option<Expires>,
pub key: ObjectKey,
pub cache_control: Option<CacheControl>,
pub content_length: Option<ContentLength>,
pub bucket: BucketName,
pub grant_read: Option<GrantRead>,
pub grant_write_acp: Option<GrantWriteACP>,
pub acl: Option<CannedAcl>,
pub grant_full_control: Option<GrantFullControl>,
pub sse_customer_algorithm: Option<SSECustomerAlgorithm>,
pub content_type: Option<ContentType>,
pub content_language: Option<ContentLanguage>,
pub content_md5: Option<ContentMD5>,
pub sse_customer_key_md5: Option<SSECustomerKeyMD5>,
}
#[derive(Debug, Default, Clone, RustcDecodable, RustcEncodable)]
pub struct GetObjectRequest {
pub response_content_encoding: Option<ResponseContentEncoding>,
pub response_content_language: Option<ResponseContentLanguage>,
pub sse_customer_algorithm: Option<SSECustomerAlgorithm>,
pub response_content_type: Option<ResponseContentType>,
pub if_unmodified_since: Option<IfUnmodifiedSince>,
pub version_id: Option<ObjectVersionId>,
pub request_payer: Option<RequestPayer>,
pub response_cache_control: Option<ResponseCacheControl>,
pub sse_customer_key: Option<SSECustomerKey>,
pub bucket: BucketName,
pub if_none_match: Option<IfNoneMatch>,
pub response_content_disposition: Option<ResponseContentDisposition>,
pub range: Option<Range>,
pub key: ObjectKey,
pub if_match: Option<IfMatch>,
pub response_expires: Option<ResponseExpires>,
pub if_modified_since: Option<IfModifiedSince>,
pub sse_customer_key_md5: Option<SSECustomerKeyMD5>,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct Initiator {
pub display_name: DisplayName,
pub id: ID,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct GetObjectTorrentRequest {
pub bucket: BucketName,
pub request_payer: Option<RequestPayer>,
pub key: ObjectKey,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct Redirect {
pub replace_key_with: ReplaceKeyWith,
pub host_name: HostName,
pub protocol: Protocol,
pub replace_key_prefix_with: ReplaceKeyPrefixWith,
pub http_redirect_code: HttpRedirectCode,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct ErrorDocument {
pub key: ObjectKey,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct IndexDocument {
pub suffix: Suffix,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct RedirectAllRequestsTo {
pub host_name: HostName,
pub protocol: Option<Protocol>,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct LambdaFunctionConfiguration {
pub lambda_function_arn: LambdaFunctionArn,
pub id: Option<NotificationId>,
pub events: EventList,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct Tag {
pub value: Value,
pub key: ObjectKey,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct CopyObjectResult {
pub last_modified: LastModified,
pub e_tag: ETag,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct MultipartUploadListOutput {
pub upload_id_marker: UploadIdMarker,
pub common_prefixes: CommonPrefixList,
pub next_key_marker: NextKeyMarker,
pub bucket: BucketName,
pub delimiter: Delimiter,
pub next_upload_id_marker: NextUploadIdMarker,
pub prefix: Prefix,
pub uploads: MultipartUploadList,
pub key_marker: KeyMarker,
pub max_uploads: MaxUploads,
pub encoding_type: EncodingType,
pub is_truncated: IsTruncated,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct MultipartUploadCreateOutput {
pub sse_customer_algorithm: SSECustomerAlgorithm,
pub request_charged: RequestCharged,
pub bucket: BucketName,
pub upload_id: MultipartUploadId,
pub key: ObjectKey,
pub server_side_encryption: ServerSideEncryption,
pub sse_customer_key_md5: SSECustomerKeyMD5,
pub ssekms_key_id: SSEKMSKeyId,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct MultipartUploadCompleteOutput {
pub request_charged: RequestCharged,
pub bucket: BucketName,
pub version_id: ObjectVersionId,
pub e_tag: ETag,
pub location: Location,
pub key: ObjectKey,
pub server_side_encryption: ServerSideEncryption,
pub ssekms_key_id: SSEKMSKeyId,
pub expiration: Expiration,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct MultipartUploadAbortOutput {
pub request_charged: RequestCharged,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct NoncurrentVersionExpiration {
pub noncurrent_days: Days,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct ReplicationRule {
pub status: ReplicationRuleStatus,
pub prefix: Prefix,
pub destination: Destination,
pub id: Option<ID>,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct ListObjectsRequest {
pub bucket: BucketName,
pub version: Option<i32>,
pub prefix: Option<Prefix>,
pub max_keys: Option<MaxKeys>,
pub delimiter: Option<Delimiter>,
pub marker: Option<Marker>,
pub encoding_type: Option<EncodingType>,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct ListObjectsOutput {
pub name: BucketName,
pub next_marker: NextMarker,
pub delimiter: Delimiter,
pub max_keys: MaxKeys,
pub prefix: Prefix,
pub marker: Marker,
pub encoding_type: EncodingType,
pub is_truncated: IsTruncated,
pub contents: ObjectMetadataList,
pub common_prefixes: CommonPrefixList,
pub continuation_token: ContinuationToken,
pub next_continuation_token: ContinuationToken,
pub key_count: KeyCount,
pub start_after: StartAfter,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct ListObjectVersionsRequest {
pub bucket: BucketName,
pub prefix: Option<Prefix>,
pub max_keys: Option<MaxKeys>,
pub delimiter: Option<Delimiter>,
pub key_marker: Option<KeyMarker>,
pub encoding_type: Option<EncodingType>,
pub version_id_marker: Option<VersionIdMarker>,
pub start_after: Option<StartAfter>,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct ListVersionsResult {
pub name: BucketName,
pub prefix: Prefix,
pub key_marker: KeyMarker,
pub delete_markers: DeleteMarkers,
pub max_keys: MaxKeys,
pub is_truncated: IsTruncated,
pub versions: ObjectVersionList,
pub next_key_marker: NextKeyMarker,
pub delimiter: Delimiter,
pub next_version_id_marker: NextVersionIdMarker,
pub encoding_type: EncodingType,
pub version_id_marker: VersionIdMarker,
pub common_prefixes: CommonPrefixList,
}
pub type ObjectVersionList = Vec<ObjectVersion>;
#[derive(Debug, Default)]
pub struct ListObjectVersionsOutput {
pub name: BucketName,
pub versions: ObjectVersionList,
pub delete_markers: DeleteMarkers,
pub next_key_marker: NextKeyMarker,
pub delimiter: Delimiter,
pub max_keys: MaxKeys,
pub prefix: Prefix,
pub key_marker: KeyMarker,
pub next_version_id_marker: NextVersionIdMarker,
pub encoding_type: EncodingType,
pub is_truncated: IsTruncated,
pub version_id_marker: VersionIdMarker,
pub common_prefixes: CommonPrefixList,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct DeleteMarkerEntry {
pub owner: Owner,
pub is_latest: IsLatest,
pub version_id: ObjectVersionId,
pub key: ObjectKey,
pub last_modified: LastModified,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct HeadObjectOutput {
pub last_modified: LastModified,
pub request_charged: RequestCharged,
pub content_encoding: ContentEncoding,
pub replication_status: ReplicationStatus,
pub storage_class: StorageClass,
pub server_side_encryption: ServerSideEncryption,
pub ssekms_key_id: SSEKMSKeyId,
pub content_disposition: ContentDisposition,
pub metadata: Metadata,
pub accept_ranges: AcceptRanges,
pub website_redirect_location: WebsiteRedirectLocation,
pub expires: Expires,
pub delete_marker: DeleteMarker,
pub cache_control: CacheControl,
pub content_length: ContentLength,
pub expiration: Expiration,
pub missing_meta: MissingMeta,
pub restore: Restore,
pub sse_customer_algorithm: SSECustomerAlgorithm,
pub content_type: ContentType,
pub content_language: ContentLanguage,
pub version_id: ObjectVersionId,
pub e_tag: ETag,
pub sse_customer_key_md5: SSECustomerKeyMD5,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct CopyObjectOutput {
pub sse_customer_algorithm: SSECustomerAlgorithm,
pub copy_source_version_id: CopySourceVersionId,
pub server_side_encryption: ServerSideEncryption,
pub request_charged: RequestCharged,
pub expiration: Expiration,
pub sse_customer_key_md5: SSECustomerKeyMD5,
pub copy_object_result: CopyObjectResult,
pub ssekms_key_id: SSEKMSKeyId,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct CopyObjectRequest {
pub request_payer: Option<RequestPayer>,
pub copy_source_if_modified_since: Option<CopySourceIfModifiedSince>,
pub copy_source_if_unmodified_since: Option<CopySourceIfUnmodifiedSince>,
pub content_encoding: Option<ContentEncoding>,
pub copy_source_sse_customer_key: Option<CopySourceSSECustomerKey>,
pub storage_class: Option<StorageClass>,
pub grant_read_acp: Option<GrantReadACP>,
pub server_side_encryption: Option<ServerSideEncryption>,
pub ssekms_key_id: Option<SSEKMSKeyId>,
pub content_disposition: Option<ContentDisposition>,
pub metadata: Option<Metadata>,
pub sse_customer_key: Option<SSECustomerKey>,
pub website_redirect_location: Option<WebsiteRedirectLocation>,
pub copy_source: CopySource,
pub expires: Option<Expires>,
pub key: ObjectKey,
pub cache_control: Option<CacheControl>,
pub copy_source_sse_customer_algorithm: Option<CopySourceSSECustomerAlgorithm>,
pub bucket: BucketName,
pub grant_read: Option<GrantRead>,
pub grant_write_acp: Option<GrantWriteACP>,
pub copy_source_sse_customer_key_md5: Option<CopySourceSSECustomerKeyMD5>,
pub acl: Option<CannedAcl>,
pub grant_full_control: Option<GrantFullControl>,
pub copy_source_if_match: Option<CopySourceIfMatch>,
pub sse_customer_algorithm: Option<SSECustomerAlgorithm>,
pub content_type: Option<ContentType>,
pub content_language: Option<ContentLanguage>,
pub metadata_directive: Option<MetadataDirective>,
pub copy_source_if_none_match: Option<CopySourceIfNoneMatch>,
pub sse_customer_key_md5: Option<SSECustomerKeyMD5>,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct DeleteObjectsRequest {
pub mfa: Option<MFA>,
pub bucket: BucketName,
pub request_payer: Option<RequestPayer>,
pub delete: Delete,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct MultipartUpload {
pub initiator: Initiator,
pub initiated: Initiated,
pub upload_id: MultipartUploadId,
pub storage_class: StorageClass,
pub key: ObjectKey,
pub owner: Owner,
}
#[derive(Debug, Default, RustcDecodable, RustcEncodable)]
pub struct HeadObjectRequest {
pub sse_customer_algorithm: Option<SSECustomerAlgorithm>,
pub sse_customer_key: Option<SSECustomerKey>,
pub if_unmodified_since: Option<IfUnmodifiedSince>,
pub version_id: Option<ObjectVersionId>,
pub request_payer: Option<RequestPayer>,
pub bucket: BucketName,
pub if_none_match: Option<IfNoneMatch>,
pub range: Option<Range>,
pub key: ObjectKey,
pub if_match: Option<IfMatch>,
pub sse_customer_key_md5: Option<SSECustomerKeyMD5>,
pub if_modified_since: Option<IfModifiedSince>,
}
pub fn multipart_upload_finish_xml(parts: &[String]) -> Result<Vec<u8>, S3Error> {
if parts.len() < 1 {
return Err(S3Error::new("Can't finish upload. NO parts!"));
}
let mut response = String::from("<CompleteMultipartUpload>");
let mut part_number = 1;
for etag in parts {
response = response + &format!("<Part><PartNumber>{}</PartNumber><ETag>{}</ETag></Part>", part_number, etag);
part_number += 1;
}
response = response + "</CompleteMultipartUpload>";
Ok(response.into_bytes())
}
impl TagParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T)
-> Result<Tag, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = Tag::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "Value" {
obj.value = try!(ValueParser::parse_xml("Value", stack));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl TagWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &Tag) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
ValueWriter::write_params(params, &(prefix.to_string() + "Value"), &obj.value);
ObjectKeyWriter::write_params(params, &(prefix.to_string() + "Key"), &obj.key);
}
}
impl TagSetParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T)
-> Result<TagSet, XmlParseError> {
let mut obj = Vec::new();
while try!(peek_at_name(stack)) == "Tag" {
obj.push(try!(TagParser::parse_xml("Tag", stack)));
}
Ok(obj)
}
}
impl TagSetWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &TagSet) {
let mut index = 1;
for element in obj.iter() {
let key = &format!("{}.{}", name, index);
TagWriter::write_params(params, key, element);
index += 1;
}
}
}
impl PartNumberParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T)
-> Result<PartNumber, XmlParseError> {
try!(start_element(tag_name, stack));
let obj = i32::from_str(try!(characters(stack)).as_ref()).unwrap();
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl PartNumberWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &PartNumber) {
params.put(name, &obj.to_string());
}
}
impl PartParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T)
-> Result<Part, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = Part::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "LastModified" {
obj.last_modified = try!(LastModifiedParser::parse_xml("LastModified", stack));
continue;
}
if current_name == "PartNumber" {
obj.part_number = try!(PartNumberParser::parse_xml("PartNumber", stack));
continue;
}
if current_name == "ETag" {
obj.e_tag = try!(ETagParser::parse_xml("ETag", stack));
continue;
}
if current_name == "Size" {
obj.size = try!(SizeParser::parse_xml("Size", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl PartWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &Part) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
LastModifiedWriter::write_params(
params, &(prefix.to_string() + "LastModified"), &obj.last_modified);
PartNumberWriter::write_params(
params, &(prefix.to_string() + "PartNumber"), &obj.part_number);
ETagWriter::write_params(params, &(prefix.to_string() + "ETag"), &obj.e_tag);
SizeWriter::write_params(params, &(prefix.to_string() + "Size"), &obj.size);
}
}
impl MultipartUploadParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T)
-> Result<MultipartUpload, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = MultipartUpload::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "Initiator" {
obj.initiator = try!(InitiatorParser::parse_xml("Initiator", stack));
continue;
}
if current_name == "Initiated" {
obj.initiated = try!(InitiatedParser::parse_xml("Initiated", stack));
continue;
}
if current_name == "UploadId" {
obj.upload_id = try!(MultipartUploadIdParser::parse_xml("UploadId", stack));
continue;
}
if current_name == "StorageClass" {
obj.storage_class = try!(StorageClassParser::parse_xml("StorageClass", stack));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
if current_name == "Owner" {
obj.owner = try!(OwnerParser::parse_xml("Owner", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl MultipartUploadWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &MultipartUpload) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
InitiatorWriter::write_params(params, &(prefix.to_string() + "Initiator"), &obj.initiator);
InitiatedWriter::write_params(params, &(prefix.to_string() + "Initiated"), &obj.initiated);
MultipartUploadIdWriter::write_params(
params, &(prefix.to_string() + "UploadId"), &obj.upload_id);
StorageClassWriter::write_params(
params, &(prefix.to_string() + "StorageClass"), &obj.storage_class);
ObjectKeyWriter::write_params(params, &(prefix.to_string() + "Key"), &obj.key);
OwnerWriter::write_params(params, &(prefix.to_string() + "Owner"), &obj.owner);
}
}
impl UploadIdMarkerParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T)
-> Result<UploadIdMarker, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = UploadIdMarker::default();
match characters(stack) {
Err(why) => return Ok(obj),
Ok(chars) => obj = chars,
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl UploadIdMarkerWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &UploadIdMarker) {
params.put(name, obj);
}
}
impl NextUploadIdMarkerParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T)
-> Result<NextUploadIdMarker, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = NextUploadIdMarker::default();
match characters(stack) {
Err(why) => return Ok(obj),
Ok(chars) => obj = chars,
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl NextUploadIdMarkerWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &NextUploadIdMarker) {
params.put(name, obj);
}
}
impl MultipartUploadListParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T)
-> Result<MultipartUploadList, XmlParseError> {
let mut obj = Vec::new();
while try!(peek_at_name(stack)) == "MultipartUpload" {
obj.push(try!(MultipartUploadParser::parse_xml("MultipartUpload", stack)));
}
Ok(obj)
}
}
impl MultipartUploadListWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &MultipartUploadList) {
let mut index = 1;
for element in obj.iter() {
let key = &format!("{}.{}", name, index);
MultipartUploadWriter::write_params(params, key, element);
index += 1;
}
}
}
impl MultipartUploadListOutputParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T)
-> Result<MultipartUploadListOutput, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = MultipartUploadListOutput::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "UploadIdMarker" {
obj.upload_id_marker = try!(UploadIdMarkerParser::parse_xml(
"UploadIdMarker", stack));
continue;
}
if current_name == "CommonPrefix" {
obj.common_prefixes = try!(CommonPrefixListParser::parse_xml(
"CommonPrefix", stack));
continue;
}
if current_name == "NextKeyMarker" {
obj.next_key_marker = try!(NextKeyMarkerParser::parse_xml(
"NextKeyMarker", stack));
continue;
}
if current_name == "Bucket" {
obj.bucket = try!(BucketNameParser::parse_xml("Bucket", stack));
continue;
}
if current_name == "Delimiter" {
obj.delimiter = try!(DelimiterParser::parse_xml("Delimiter", stack));
continue;
}
if current_name == "NextUploadIdMarker" {
obj.next_upload_id_marker = try!(NextUploadIdMarkerParser::parse_xml(
"NextUploadIdMarker", stack));
continue;
}
if current_name == "Prefix" {
obj.prefix = try!(PrefixParser::parse_xml("Prefix", stack));
continue;
}
if current_name == "MultipartUpload" {
obj.uploads = try!(MultipartUploadListParser::parse_xml(
"MultipartUpload", stack));
continue;
}
if current_name == "KeyMarker" {
obj.key_marker = try!(KeyMarkerParser::parse_xml("KeyMarker", stack));
continue;
}
if current_name == "MaxUploads" {
obj.max_uploads = try!(MaxUploadsParser::parse_xml("MaxUploads", stack));
continue;
}
if current_name == "EncodingType" {
obj.encoding_type = try!(EncodingTypeParser::parse_xml("EncodingType", stack));
continue;
}
if current_name == "IsTruncated" {
obj.is_truncated = try!(IsTruncatedParser::parse_xml("IsTruncated", stack));
continue;
}
if current_name == "Upload" {
obj.uploads.push(try!(MultipartUploadParser::parse_xml("Upload", stack)));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl MultipartUploadListOutputWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &MultipartUploadListOutput) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
UploadIdMarkerWriter::write_params(
params, &(prefix.to_string() + "UploadIdMarker"), &obj.upload_id_marker);
CommonPrefixListWriter::write_params(
params, &(prefix.to_string() + "CommonPrefix"), &obj.common_prefixes);
NextKeyMarkerWriter::write_params(
params, &(prefix.to_string() + "NextKeyMarker"), &obj.next_key_marker);
BucketNameWriter::write_params(
params, &(prefix.to_string() + "Bucket"), &obj.bucket);
DelimiterWriter::write_params(
params, &(prefix.to_string() + "Delimiter"), &obj.delimiter);
NextUploadIdMarkerWriter::write_params(
params, &(prefix.to_string() + "NextUploadIdMarker"), &obj.next_upload_id_marker);
PrefixWriter::write_params(
params, &(prefix.to_string() + "Prefix"), &obj.prefix);
MultipartUploadListWriter::write_params(
params, &(prefix.to_string() + "MultipartUpload"), &obj.uploads);
KeyMarkerWriter::write_params(
params, &(prefix.to_string() + "KeyMarker"), &obj.key_marker);
MaxUploadsWriter::write_params(
params, &(prefix.to_string() + "MaxUploads"), &obj.max_uploads);
EncodingTypeWriter::write_params(
params, &(prefix.to_string() + "EncodingType"), &obj.encoding_type);
IsTruncatedWriter::write_params(
params, &(prefix.to_string() + "IsTruncated"), &obj.is_truncated);
}
}
impl MultipartUploadCompleteOutputParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T)
-> Result<MultipartUploadCompleteOutput, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = MultipartUploadCompleteOutput::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "x-amz-request-charged" {
obj.request_charged = try!(RequestChargedParser::parse_xml(
"x-amz-request-charged", stack));
continue;
}
if current_name == "Bucket" {
obj.bucket = try!(BucketNameParser::parse_xml("Bucket", stack));
continue;
}
if current_name == "x-amz-version-id" {
obj.version_id = try!(ObjectVersionIdParser::parse_xml(
"x-amz-version-id", stack));
continue;
}
if current_name == "ETag" {
obj.e_tag = try!(ETagParser::parse_xml("ETag", stack));
continue;
}
if current_name == "Location" {
obj.location = try!(LocationParser::parse_xml("Location", stack));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
if current_name == "x-amz-server-side-encryption" {
obj.server_side_encryption = try!(ServerSideEncryptionParser::parse_xml(
"x-amz-server-side-encryption", stack));
continue;
}
if current_name == "x-amz-server-side-encryption-aws-kms-key-id" {
obj.ssekms_key_id = try!(SSEKMSKeyIdParser::parse_xml(
"x-amz-server-side-encryption-aws-kms-key-id", stack));
continue;
}
if current_name == "x-amz-expiration" {
obj.expiration = try!(ExpirationParser::parse_xml("x-amz-expiration", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl MultipartUploadCompleteOutputWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &MultipartUploadCompleteOutput) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
RequestChargedWriter::write_params(
params, &(prefix.to_string() + "x-amz-request-charged"), &obj.request_charged);
BucketNameWriter::write_params(
params, &(prefix.to_string() + "Bucket"), &obj.bucket);
ObjectVersionIdWriter::write_params(
params, &(prefix.to_string() + "x-amz-version-id"), &obj.version_id);
ETagWriter::write_params(
params, &(prefix.to_string() + "ETag"), &obj.e_tag);
LocationWriter::write_params(
params, &(prefix.to_string() + "Location"), &obj.location);
ObjectKeyWriter::write_params(
params, &(prefix.to_string() + "Key"), &obj.key);
ServerSideEncryptionWriter::write_params(
params,
&(prefix.to_string() + "x-amz-server-side-encryption"),
&obj.server_side_encryption);
SSEKMSKeyIdWriter::write_params(
params,
&(prefix.to_string() + "x-amz-server-side-encryption-aws-kms-key-id"),
&obj.ssekms_key_id);
ExpirationWriter::write_params(
params, &(prefix.to_string() + "x-amz-expiration"), &obj.expiration);
}
}
impl GetObjectRequestParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T)
-> Result<GetObjectRequest, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = GetObjectRequest::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "response-content-encoding" {
obj.response_content_encoding = Some(
try!(ResponseContentEncodingParser::parse_xml(
"response-content-encoding", stack)));
continue;
}
if current_name == "response-content-language" {
obj.response_content_language = Some(
try!(ResponseContentLanguageParser::parse_xml(
"response-content-language", stack)));
continue;
}
if current_name == "x-amz-server-side-encryption-customer-algorithm" {
obj.sse_customer_algorithm = Some(
try!(SSECustomerAlgorithmParser::parse_xml(
"x-amz-server-side-encryption-customer-algorithm",
stack)));
continue;
}
if current_name == "response-content-type" {
obj.response_content_type = Some(
try!(ResponseContentTypeParser::parse_xml(
"response-content-type", stack)));
continue;
}
if current_name == "If-Unmodified-Since" {
obj.if_unmodified_since = Some(
try!(IfUnmodifiedSinceParser::parse_xml(
"If-Unmodified-Since", stack)));
continue;
}
if current_name == "versionId" {
obj.version_id = Some(try!(ObjectVersionIdParser::parse_xml("versionId", stack)));
continue;
}
if current_name == "x-amz-request-payer" {
obj.request_payer = Some(
try!(RequestPayerParser::parse_xml(
"x-amz-request-payer", stack)));
continue;
}
if current_name == "response-cache-control" {
obj.response_cache_control = Some(
try!(ResponseCacheControlParser::parse_xml(
"response-cache-control", stack)));
continue;
}
if current_name == "x-amz-server-side-encryption-customer-key" {
obj.sse_customer_key = Some(
try!(SSECustomerKeyParser::parse_xml(
"x-amz-server-side-encryption-customer-key", stack)));
continue;
}
if current_name == "Bucket" {
obj.bucket = try!(BucketNameParser::parse_xml("Bucket", stack));
continue;
}
if current_name == "If-None-Match" {
obj.if_none_match = Some(try!(IfNoneMatchParser::parse_xml(
"If-None-Match", stack)));
continue;
}
if current_name == "response-content-disposition" {
obj.response_content_disposition = Some(
try!(ResponseContentDispositionParser::parse_xml(
"response-content-disposition", stack)));
continue;
}
if current_name == "Range" {
obj.range = Some(try!(RangeParser::parse_xml("Range", stack)));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
if current_name == "If-Match" {
obj.if_match = Some(try!(IfMatchParser::parse_xml("If-Match", stack)));
continue;
}
if current_name == "response-expires" {
obj.response_expires = Some(try!(ResponseExpiresParser::parse_xml(
"response-expires", stack)));
continue;
}
if current_name == "If-Modified-Since" {
obj.if_modified_since = Some(try!(IfModifiedSinceParser::parse_xml(
"If-Modified-Since", stack)));
continue;
}
if current_name == "x-amz-server-side-encryption-customer-key-MD5" {
obj.sse_customer_key_md5 = Some(try!(SSECustomerKeyMD5Parser::parse_xml(
"x-amz-server-side-encryption-customer-key-MD5",
stack)));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl GetObjectRequestWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &GetObjectRequest) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
if let Some(ref obj) = obj.response_content_encoding {
ResponseContentEncodingWriter::write_params(
params, &(prefix.to_string() + "response-content-encoding"), obj);
}
if let Some(ref obj) = obj.response_content_language {
ResponseContentLanguageWriter::write_params(
params, &(prefix.to_string() + "response-content-language"), obj);
}
if let Some(ref obj) = obj.sse_customer_algorithm {
SSECustomerAlgorithmWriter::write_params(
params,
&(prefix.to_string() + "x-amz-server-side-encryption-customer-algorithm"),
obj);
}
if let Some(ref obj) = obj.response_content_type {
ResponseContentTypeWriter::write_params(
params, &(prefix.to_string() + "response-content-type"), obj);
}
if let Some(ref obj) = obj.if_unmodified_since {
IfUnmodifiedSinceWriter::write_params(
params, &(prefix.to_string() + "If-Unmodified-Since"), obj);
}
if let Some(ref obj) = obj.version_id {
ObjectVersionIdWriter::write_params(
params, &(prefix.to_string() + "versionId"), obj);
}
if let Some(ref obj) = obj.request_payer {
RequestPayerWriter::write_params(
params, &(prefix.to_string() + "x-amz-request-payer"), obj);
}
if let Some(ref obj) = obj.response_cache_control {
ResponseCacheControlWriter::write_params(
params, &(prefix.to_string() + "response-cache-control"), obj);
}
if let Some(ref obj) = obj.sse_customer_key {
SSECustomerKeyWriter::write_params(
params,
&(prefix.to_string() + "x-amz-server-side-encryption-customer-key"),
obj);
}
BucketNameWriter::write_params(params, &(prefix.to_string() + "Bucket"), &obj.bucket);
if let Some(ref obj) = obj.if_none_match {
IfNoneMatchWriter::write_params(params, &(prefix.to_string() + "If-None-Match"), obj);
}
if let Some(ref obj) = obj.response_content_disposition {
ResponseContentDispositionWriter::write_params(
params, &(prefix.to_string() + "response-content-disposition"), obj);
}
if let Some(ref obj) = obj.range {
RangeWriter::write_params(params, &(prefix.to_string() + "Range"), obj);
}
ObjectKeyWriter::write_params(params, &(prefix.to_string() + "Key"), &obj.key);
if let Some(ref obj) = obj.if_match {
IfMatchWriter::write_params(params, &(prefix.to_string() + "If-Match"), obj);
}
if let Some(ref obj) = obj.response_expires {
ResponseExpiresWriter::write_params(
params, &(prefix.to_string() + "response-expires"), obj);
}
if let Some(ref obj) = obj.if_modified_since {
IfModifiedSinceWriter::write_params(
params, &(prefix.to_string() + "If-Modified-Since"), obj);
}
if let Some(ref obj) = obj.sse_customer_key_md5 {
SSECustomerKeyMD5Writer::write_params(
params,
&(prefix.to_string() + "x-amz-server-side-encryption-customer-key-MD5"),
obj);
}
}
}
impl PutObjectOutputParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T)
-> Result<PutObjectOutput, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = PutObjectOutput::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "x-amz-server-side-encryption-customer-algorithm" {
obj.sse_customer_algorithm = try!(SSECustomerAlgorithmParser::parse_xml(
"x-amz-server-side-encryption-customer-algorithm", stack));
continue;
}
if current_name == "x-amz-request-charged" {
obj.request_charged = try!(RequestChargedParser::parse_xml(
"x-amz-request-charged", stack));
continue;
}
if current_name == "x-amz-version-id" {
obj.version_id = try!(ObjectVersionIdParser::parse_xml(
"x-amz-version-id", stack));
continue;
}
if current_name == "ETag" {
obj.e_tag = try!(ETagParser::parse_xml("ETag", stack));
continue;
}
if current_name == "x-amz-expiration" {
obj.expiration = try!(ExpirationParser::parse_xml("x-amz-expiration", stack));
continue;
}
if current_name == "x-amz-server-side-encryption" {
obj.server_side_encryption = try!(ServerSideEncryptionParser::parse_xml(
"x-amz-server-side-encryption", stack));
continue;
}
if current_name == "x-amz-server-side-encryption-customer-key-MD5" {
obj.sse_customer_key_md5 = try!(SSECustomerKeyMD5Parser::parse_xml(
"x-amz-server-side-encryption-customer-key-MD5", stack));
continue;
}
if current_name == "x-amz-server-side-encryption-aws-kms-key-id" {
obj.ssekms_key_id = try!(SSEKMSKeyIdParser::parse_xml(
"x-amz-server-side-encryption-aws-kms-key-id", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl PutObjectOutputWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &PutObjectOutput) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
SSECustomerAlgorithmWriter::write_params(
params,
&(prefix.to_string() + "x-amz-server-side-encryption-customer-algorithm"),
&obj.sse_customer_algorithm);
RequestChargedWriter::write_params(
params, &(prefix.to_string() + "x-amz-request-charged"), &obj.request_charged);
ObjectVersionIdWriter::write_params(
params, &(prefix.to_string() + "x-amz-version-id"), &obj.version_id);
ETagWriter::write_params(params, &(prefix.to_string() + "ETag"), &obj.e_tag);
ExpirationWriter::write_params(
params, &(prefix.to_string() + "x-amz-expiration"), &obj.expiration);
ServerSideEncryptionWriter::write_params(
params,
&(prefix.to_string() + "x-amz-server-side-encryption"),
&obj.server_side_encryption);
SSECustomerKeyMD5Writer::write_params(
params,
&(prefix.to_string() + "x-amz-server-side-encryption-customer-key-MD5"),
&obj.sse_customer_key_md5);
SSEKMSKeyIdWriter::write_params(
params,
&(prefix.to_string() + "x-amz-server-side-encryption-aws-kms-key-id"),
&obj.ssekms_key_id);
}
}
impl MaxUploadsParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T)
-> Result<MaxUploads, XmlParseError> {
try!(start_element(tag_name, stack));
let obj = i32::from_str(try!(characters(stack)).as_ref()).unwrap();
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl MaxUploadsWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &MaxUploads) {
params.put(name, &obj.to_string());
}
}
impl ExpiresParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T)
-> Result<Expires, XmlParseError> {
try!(start_element(tag_name, stack));
let obj = try!(characters(stack));
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl ExpiresWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &Expires) {
params.put(name, obj);
}
}
impl ListObjectsOutputParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<ListObjectsOutput, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = ListObjectsOutput::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "Name" {
obj.name = try!(BucketNameParser::parse_xml("Name", stack));
continue;
}
if current_name == "NextMarker" {
obj.next_marker = try!(NextMarkerParser::parse_xml("NextMarker", stack));
continue;
}
if current_name == "Delimiter" {
obj.delimiter = try!(DelimiterParser::parse_xml("Delimiter", stack));
continue;
}
if current_name == "MaxKeys" {
obj.max_keys = try!(MaxKeysParser::parse_xml("MaxKeys", stack));
continue;
}
if current_name == "Prefix" {
obj.prefix = try!(PrefixParser::parse_xml("Prefix", stack));
continue;
}
if current_name == "Marker" {
obj.marker = try!(MarkerParser::parse_xml("Marker", stack));
continue;
}
if current_name == "EncodingType" {
obj.encoding_type = try!(EncodingTypeParser::parse_xml("EncodingType", stack));
continue;
}
if current_name == "IsTruncated" {
obj.is_truncated = try!(IsTruncatedParser::parse_xml("IsTruncated", stack));
continue;
}
if current_name == "Contents" {
obj.contents = try!(ObjectMetadataListParser::parse_xml("Contents", stack));
continue;
}
if current_name == "CommonPrefix" {
obj.common_prefixes = try!(CommonPrefixListParser::parse_xml("CommonPrefix", stack));
continue;
}
if current_name == "KeyCount" {
obj.key_count = try!(KeyCountParser::parse_xml("KeyCount", stack));
continue;
}
if current_name == "ContinuationToken" {
obj.continuation_token = try!(ContinuationTokenParser::parse_xml("ContinuationToken", stack));
continue;
}
if current_name == "NextContinuationToken" {
obj.next_continuation_token = try!(ContinuationTokenParser::parse_xml("NextContinuationToken", stack));
continue;
}
if current_name == "StartAfter" {
obj.start_after = try!(StartAfterParser::parse_xml("StartAfter", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl ListObjectsOutputWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &ListObjectsOutput) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
BucketNameWriter::write_params(params, &(prefix.to_string() + "Name"), &obj.name);
NextMarkerWriter::write_params(params, &(prefix.to_string() + "NextMarker"), &obj.next_marker);
DelimiterWriter::write_params(params, &(prefix.to_string() + "Delimiter"), &obj.delimiter);
MaxKeysWriter::write_params(params, &(prefix.to_string() + "MaxKeys"), &obj.max_keys);
PrefixWriter::write_params(params, &(prefix.to_string() + "Prefix"), &obj.prefix);
MarkerWriter::write_params(params, &(prefix.to_string() + "Marker"), &obj.marker);
EncodingTypeWriter::write_params(params, &(prefix.to_string() + "EncodingType"), &obj.encoding_type);
IsTruncatedWriter::write_params(params, &(prefix.to_string() + "IsTruncated"), &obj.is_truncated);
ObjectMetadataListWriter::write_params(params, &(prefix.to_string() + "Contents"), &obj.contents);
CommonPrefixListWriter::write_params(params, &(prefix.to_string() + "CommonPrefix"), &obj.common_prefixes);
}
}
impl ObjectMetadataListParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<ObjectMetadataList, XmlParseError> {
let mut obj = Vec::new();
while try!(peek_at_name(stack)) == tag_name {
obj.push(try!(ObjectMetadataParser::parse_xml(tag_name, stack)));
}
Ok(obj)
}
}
impl ObjectMetadataListWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &ObjectMetadataList) {
let mut index = 1;
for element in obj.iter() {
let key = &format!("{}.{}", name, index);
ObjectMetadataWriter::write_params(params, key, element);
index += 1;
}
}
}
impl ObjectMetadataParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<ObjectMetadata, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = ObjectMetadata::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "LastModified" {
obj.last_modified = try!(LastModifiedParser::parse_xml("LastModified", stack));
continue;
}
if current_name == "ETag" {
obj.e_tag = try!(ETagParser::parse_xml("ETag", stack));
continue;
}
if current_name == "StorageClass" {
obj.storage_class = try!(ObjectStorageClassParser::parse_xml("StorageClass", stack));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
if current_name == "Owner" {
obj.owner = try!(OwnerParser::parse_xml("Owner", stack));
continue;
}
if current_name == "Size" {
obj.size = try!(SizeParser::parse_xml("Size", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl ObjectMetadataWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &ObjectMetadata) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
LastModifiedWriter::write_params(params, &(prefix.to_string() + "LastModified"), &obj.last_modified);
ETagWriter::write_params(params, &(prefix.to_string() + "ETag"), &obj.e_tag);
ObjectStorageClassWriter::write_params(params, &(prefix.to_string() + "StorageClass"), &obj.storage_class);
ObjectKeyWriter::write_params(params, &(prefix.to_string() + "Key"), &obj.key);
OwnerWriter::write_params(params, &(prefix.to_string() + "Owner"), &obj.owner);
SizeWriter::write_params(params, &(prefix.to_string() + "Size"), &obj.size);
}
}
impl MultipartUploadListPartsOutputParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<MultipartUploadListPartsOutput, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = MultipartUploadListPartsOutput::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "Initiator" {
obj.initiator = try!(InitiatorParser::parse_xml("Initiator", stack));
continue;
}
if current_name == "Bucket" {
obj.bucket = try!(BucketNameParser::parse_xml("Bucket", stack));
continue;
}
if current_name == "NextPartNumberMarker" {
obj.next_part_number_marker = try!(NextPartNumberMarkerParser::parse_xml("NextPartNumberMarker", stack));
continue;
}
if current_name == "Part" {
obj.parts = try!(PartsParser::parse_xml("Part", stack));
continue;
}
if current_name == "UploadId" {
obj.upload_id = try!(MultipartUploadIdParser::parse_xml("UploadId", stack));
continue;
}
if current_name == "StorageClass" {
obj.storage_class = try!(StorageClassParser::parse_xml("StorageClass", stack));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
if current_name == "x-amz-request-charged" {
obj.request_charged = try!(RequestChargedParser::parse_xml("x-amz-request-charged", stack));
continue;
}
if current_name == "Owner" {
obj.owner = try!(OwnerParser::parse_xml("Owner", stack));
continue;
}
if current_name == "MaxParts" {
obj.max_parts = try!(MaxPartsParser::parse_xml("MaxParts", stack));
continue;
}
if current_name == "IsTruncated" {
obj.is_truncated = try!(IsTruncatedParser::parse_xml("IsTruncated", stack));
continue;
}
if current_name == "PartNumberMarker" {
obj.part_number_marker = try!(PartNumberMarkerParser::parse_xml("PartNumberMarker", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl MultipartUploadListPartsOutputWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &MultipartUploadListPartsOutput) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
InitiatorWriter::write_params(params, &(prefix.to_string() + "Initiator"), &obj.initiator);
BucketNameWriter::write_params(params, &(prefix.to_string() + "Bucket"), &obj.bucket);
NextPartNumberMarkerWriter::write_params(params, &(prefix.to_string() + "NextPartNumberMarker"), &obj.next_part_number_marker);
PartsWriter::write_params(params, &(prefix.to_string() + "Part"), &obj.parts);
MultipartUploadIdWriter::write_params(params, &(prefix.to_string() + "UploadId"), &obj.upload_id);
StorageClassWriter::write_params(params, &(prefix.to_string() + "StorageClass"), &obj.storage_class);
ObjectKeyWriter::write_params(params, &(prefix.to_string() + "Key"), &obj.key);
RequestChargedWriter::write_params(params, &(prefix.to_string() + "x-amz-request-charged"), &obj.request_charged);
OwnerWriter::write_params(params, &(prefix.to_string() + "Owner"), &obj.owner);
MaxPartsWriter::write_params(params, &(prefix.to_string() + "MaxParts"), &obj.max_parts);
IsTruncatedWriter::write_params(params, &(prefix.to_string() + "IsTruncated"), &obj.is_truncated);
PartNumberMarkerWriter::write_params(params, &(prefix.to_string() + "PartNumberMarker"), &obj.part_number_marker);
}
}
impl MultipartUploadListPartsRequestParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<MultipartUploadListPartsRequest, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = MultipartUploadListPartsRequest::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "x-amz-request-payer" {
obj.request_payer = Some(try!(RequestPayerParser::parse_xml("x-amz-request-payer", stack)));
continue;
}
if current_name == "Bucket" {
obj.bucket = try!(BucketNameParser::parse_xml("Bucket", stack));
continue;
}
if current_name == "uploadId" {
obj.upload_id = try!(MultipartUploadIdParser::parse_xml("uploadId", stack));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
if current_name == "max-parts" {
obj.max_parts = Some(try!(MaxPartsParser::parse_xml("max-parts", stack)));
continue;
}
if current_name == "part-number-marker" {
obj.part_number_marker = Some(try!(PartNumberMarkerParser::parse_xml("part-number-marker", stack)));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl MultipartUploadListPartsRequestWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &MultipartUploadListPartsRequest) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
if let Some(ref obj) = obj.request_payer {
RequestPayerWriter::write_params(params, &(prefix.to_string() + "x-amz-request-payer"), obj);
}
BucketNameWriter::write_params(params, &(prefix.to_string() + "Bucket"), &obj.bucket);
MultipartUploadIdWriter::write_params(params, &(prefix.to_string() + "uploadId"), &obj.upload_id);
ObjectKeyWriter::write_params(params, &(prefix.to_string() + "Key"), &obj.key);
if let Some(ref obj) = obj.max_parts {
MaxPartsWriter::write_params(params, &(prefix.to_string() + "max-parts"), obj);
}
if let Some(ref obj) = obj.part_number_marker {
PartNumberMarkerWriter::write_params(params, &(prefix.to_string() + "part-number-marker"), obj);
}
}
}
impl NextPartNumberMarkerParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<NextPartNumberMarker, XmlParseError> {
try!(start_element(tag_name, stack));
let obj = i32::from_str(try!(characters(stack)).as_ref()).unwrap();
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl NextPartNumberMarkerWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &NextPartNumberMarker) {
params.put(name, &obj.to_string());
}
}
impl MaxPartsParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<MaxParts, XmlParseError> {
try!(start_element(tag_name, stack));
let obj = i32::from_str(try!(characters(stack)).as_ref()).unwrap();
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl MaxPartsWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &MaxParts) {
params.put(name, &obj.to_string());
}
}
impl PartNumberMarkerParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<PartNumberMarker, XmlParseError> {
try!(start_element(tag_name, stack));
let obj = i32::from_str(try!(characters(stack)).as_ref()).unwrap();
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl PartNumberMarkerWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &PartNumberMarker) {
params.put(name, &obj.to_string());
}
}
impl PartsParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<Parts, XmlParseError> {
let mut obj = Vec::new();
while try!(peek_at_name(stack)) == "Part" {
obj.push(try!(PartParser::parse_xml("Part", stack)));
}
Ok(obj)
}
}
impl PartsWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &Parts) {
let mut index = 1;
for element in obj.iter() {
let key = &format!("{}.{}", name, index);
PartWriter::write_params(params, key, element);
index += 1;
}
}
}
impl MultipartUploadAbortOutputWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &MultipartUploadAbortOutput) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
RequestChargedWriter::write_params(params, &(prefix.to_string() + "x-amz-request-charged"), &obj.request_charged);
}
}
impl MultipartUploadAbortRequestParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<MultipartUploadAbortRequest, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = MultipartUploadAbortRequest::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "uploadId" {
obj.upload_id = try!(MultipartUploadIdParser::parse_xml("uploadId", stack));
continue;
}
if current_name == "Bucket" {
obj.bucket = try!(BucketNameParser::parse_xml("Bucket", stack));
continue;
}
if current_name == "x-amz-request-payer" {
obj.request_payer = Some(try!(RequestPayerParser::parse_xml("x-amz-request-payer", stack)));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl MultipartUploadAbortRequestWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &MultipartUploadAbortRequest) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
MultipartUploadIdWriter::write_params(params, &(prefix.to_string() + "uploadId"), &obj.upload_id);
BucketNameWriter::write_params(params, &(prefix.to_string() + "Bucket"), &obj.bucket);
if let Some(ref obj) = obj.request_payer {
RequestPayerWriter::write_params(params, &(prefix.to_string() + "x-amz-request-payer"), obj);
}
ObjectKeyWriter::write_params(params, &(prefix.to_string() + "Key"), &obj.key);
}
}
impl MultipartUploadListRequestParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<MultipartUploadListRequest, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = MultipartUploadListRequest::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "upload-id-marker" {
obj.upload_id_marker = Some(try!(UploadIdMarkerParser::parse_xml("upload-id-marker", stack)));
continue;
}
if current_name == "Bucket" {
obj.bucket = try!(BucketNameParser::parse_xml("Bucket", stack));
continue;
}
if current_name == "delimiter" {
obj.delimiter = Some(try!(DelimiterParser::parse_xml("delimiter", stack)));
continue;
}
if current_name == "prefix" {
obj.prefix = Some(try!(PrefixParser::parse_xml("prefix", stack)));
continue;
}
if current_name == "key-marker" {
obj.key_marker = Some(try!(KeyMarkerParser::parse_xml("key-marker", stack)));
continue;
}
if current_name == "max-uploads" {
obj.max_uploads = Some(try!(MaxUploadsParser::parse_xml("max-uploads", stack)));
continue;
}
if current_name == "encoding-type" {
obj.encoding_type = Some(try!(EncodingTypeParser::parse_xml("encoding-type", stack)));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl MultipartUploadListRequestWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &MultipartUploadListRequest) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
if let Some(ref obj) = obj.upload_id_marker {
UploadIdMarkerWriter::write_params(params, &(prefix.to_string() + "upload-id-marker"), obj);
}
BucketNameWriter::write_params(params, &(prefix.to_string() + "Bucket"), &obj.bucket);
if let Some(ref obj) = obj.delimiter {
DelimiterWriter::write_params(params, &(prefix.to_string() + "delimiter"), obj);
}
if let Some(ref obj) = obj.prefix {
PrefixWriter::write_params(params, &(prefix.to_string() + "prefix"), obj);
}
if let Some(ref obj) = obj.key_marker {
KeyMarkerWriter::write_params(params, &(prefix.to_string() + "key-marker"), obj);
}
if let Some(ref obj) = obj.max_uploads {
MaxUploadsWriter::write_params(params, &(prefix.to_string() + "max-uploads"), obj);
}
if let Some(ref obj) = obj.encoding_type {
EncodingTypeWriter::write_params(params, &(prefix.to_string() + "encoding-type"), obj);
}
}
}
impl ObjectIdentifierListParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<ObjectIdentifierList, XmlParseError> {
let mut obj = Vec::new();
while try!(peek_at_name(stack)) == "ObjectIdentifier" {
obj.push(try!(ObjectIdentifierParser::parse_xml("ObjectIdentifier", stack)));
}
Ok(obj)
}
}
impl ObjectIdentifierListWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &ObjectIdentifierList) {
let mut index = 1;
for element in obj.iter() {
let key = &format!("{}.{}", name, index);
ObjectIdentifierWriter::write_params(params, key, element);
index += 1;
}
}
}
impl DeleteParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<Delete, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = Delete::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "ObjectIdentifier" {
obj.objects = try!(ObjectIdentifierListParser::parse_xml("ObjectIdentifier", stack));
continue;
}
if current_name == "Quiet" {
obj.quiet = Some(try!(QuietParser::parse_xml("Quiet", stack)));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl DeleteWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &Delete) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
ObjectIdentifierListWriter::write_params(params, &(prefix.to_string() + "ObjectIdentifier"), &obj.objects);
if let Some(ref obj) = obj.quiet {
QuietWriter::write_params(params, &(prefix.to_string() + "Quiet"), obj);
}
}
}
impl ObjectIdentifierParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<ObjectIdentifier, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = ObjectIdentifier::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "VersionId" {
obj.version_id = Some(try!(ObjectVersionIdParser::parse_xml("VersionId", stack)));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl ObjectIdentifierWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &ObjectIdentifier) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
if let Some(ref obj) = obj.version_id {
ObjectVersionIdWriter::write_params(params, &(prefix.to_string() + "VersionId"), obj);
}
ObjectKeyWriter::write_params(params, &(prefix.to_string() + "Key"), &obj.key);
}
}
impl DeleteObjectsRequestParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<DeleteObjectsRequest, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = DeleteObjectsRequest::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "x-amz-mfa" {
obj.mfa = Some(try!(MFAParser::parse_xml("x-amz-mfa", stack)));
continue;
}
if current_name == "Bucket" {
obj.bucket = try!(BucketNameParser::parse_xml("Bucket", stack));
continue;
}
if current_name == "x-amz-request-payer" {
obj.request_payer = Some(try!(RequestPayerParser::parse_xml("x-amz-request-payer", stack)));
continue;
}
if current_name == "Delete" {
obj.delete = try!(DeleteParser::parse_xml("Delete", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl DeleteObjectsRequestWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &DeleteObjectsRequest) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
if let Some(ref obj) = obj.mfa {
MFAWriter::write_params(params, &(prefix.to_string() + "x-amz-mfa"), obj);
}
BucketNameWriter::write_params(params, &(prefix.to_string() + "Bucket"), &obj.bucket);
if let Some(ref obj) = obj.request_payer {
RequestPayerWriter::write_params(params, &(prefix.to_string() + "x-amz-request-payer"), obj);
}
DeleteWriter::write_params(params, &(prefix.to_string() + "Delete"), &obj.delete);
}
}
impl ObjectVersionParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<ObjectVersion, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = ObjectVersion::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "LastModified" {
obj.last_modified = try!(LastModifiedParser::parse_xml("LastModified", stack));
continue;
}
if current_name == "VersionId" {
obj.version_id = try!(ObjectVersionIdParser::parse_xml("VersionId", stack));
continue;
}
if current_name == "ETag" {
obj.e_tag = try!(ETagParser::parse_xml("ETag", stack));
continue;
}
if current_name == "StorageClass" {
obj.storage_class = try!(ObjectVersionStorageClassParser::parse_xml("StorageClass", stack));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
if current_name == "Owner" {
obj.owner = try!(OwnerParser::parse_xml("Owner", stack));
continue;
}
if current_name == "IsLatest" {
obj.is_latest = try!(IsLatestParser::parse_xml("IsLatest", stack));
continue;
}
if current_name == "Size" {
obj.size = try!(SizeParser::parse_xml("Size", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl ObjectVersionWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &ObjectVersion) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
LastModifiedWriter::write_params(params, &(prefix.to_string() + "LastModified"), &obj.last_modified);
ObjectVersionIdWriter::write_params(params, &(prefix.to_string() + "VersionId"), &obj.version_id);
ETagWriter::write_params(params, &(prefix.to_string() + "ETag"), &obj.e_tag);
ObjectVersionStorageClassWriter::write_params(params, &(prefix.to_string() + "StorageClass"), &obj.storage_class);
ObjectKeyWriter::write_params(params, &(prefix.to_string() + "Key"), &obj.key);
OwnerWriter::write_params(params, &(prefix.to_string() + "Owner"), &obj.owner);
IsLatestWriter::write_params(params, &(prefix.to_string() + "IsLatest"), &obj.is_latest);
SizeWriter::write_params(params, &(prefix.to_string() + "Size"), &obj.size);
}
}
impl ObjectKeyParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<ObjectKey, XmlParseError> {
try!(start_element(tag_name, stack));
let obj = try!(characters(stack));
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl ObjectKeyWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &ObjectKey) {
params.put(name, obj);
}
}
impl ObjectVersionStorageClassParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<ObjectVersionStorageClass, XmlParseError> {
try!(start_element(tag_name, stack));
let obj = try!(characters(stack));
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl ObjectVersionStorageClassWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &ObjectVersionStorageClass) {
params.put(name, obj);
}
}
impl CopyObjectResultParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<CopyObjectResult, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = CopyObjectResult::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "LastModified" {
obj.last_modified = try!(LastModifiedParser::parse_xml("LastModified", stack));
continue;
}
if current_name == "ETag" {
obj.e_tag = try!(ETagParser::parse_xml("ETag", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl CopyObjectResultWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &CopyObjectResult) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
LastModifiedWriter::write_params(params, &(prefix.to_string() + "LastModified"), &obj.last_modified);
ETagWriter::write_params(params, &(prefix.to_string() + "ETag"), &obj.e_tag);
}
}
impl ObjectVersionIdParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<ObjectVersionId, XmlParseError> {
try!(start_element(tag_name, stack));
let obj = try!(characters(stack));
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl ObjectVersionIdWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &ObjectVersionId) {
params.put(name, obj);
}
}
impl DeleteMarkerVersionIdParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T)
-> Result<DeleteMarkerVersionId, XmlParseError> {
try!(start_element(tag_name, stack));
let obj = try!(characters(stack));
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl DeleteMarkerVersionIdWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &DeleteMarkerVersionId) {
params.put(name, obj);
}
}
impl DeletedObjectParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<DeletedObject, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = DeletedObject::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "VersionId" {
obj.version_id = try!(ObjectVersionIdParser::parse_xml("VersionId", stack));
continue;
}
if current_name == "DeleteMarkerVersionId" {
obj.delete_marker_version_id = try!(DeleteMarkerVersionIdParser::parse_xml("DeleteMarkerVersionId", stack));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
if current_name == "DeleteMarker" {
obj.delete_marker = try!(DeleteMarkerParser::parse_xml("DeleteMarker", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl DeletedObjectWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &DeletedObject) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
ObjectVersionIdWriter::write_params(params, &(prefix.to_string() + "VersionId"), &obj.version_id);
DeleteMarkerVersionIdWriter::write_params(params, &(prefix.to_string() + "DeleteMarkerVersionId"), &obj.delete_marker_version_id);
ObjectKeyWriter::write_params(params, &(prefix.to_string() + "Key"), &obj.key);
DeleteMarkerWriter::write_params(params, &(prefix.to_string() + "DeleteMarker"), &obj.delete_marker);
}
}
impl DeletedObjectsParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<DeletedObjects, XmlParseError> {
let mut obj = Vec::new();
while try!(peek_at_name(stack)) == "DeletedObject" {
obj.push(try!(DeletedObjectParser::parse_xml("DeletedObject", stack)));
}
Ok(obj)
}
}
impl DeletedObjectsWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &DeletedObjects) {
let mut index = 1;
for element in obj.iter() {
let key = &format!("{}.{}", name, index);
DeletedObjectWriter::write_params(params, key, element);
index += 1;
}
}
}
impl DeleteObjectOutputParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<DeleteObjectOutput, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = DeleteObjectOutput::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "x-amz-version-id" {
obj.version_id = try!(ObjectVersionIdParser::parse_xml("x-amz-version-id", stack));
continue;
}
if current_name == "x-amz-request-charged" {
obj.request_charged = try!(RequestChargedParser::parse_xml("x-amz-request-charged", stack));
continue;
}
if current_name == "x-amz-delete-marker" {
obj.delete_marker = try!(DeleteMarkerParser::parse_xml("x-amz-delete-marker", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl DeleteObjectOutputWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &DeleteObjectOutput) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
ObjectVersionIdWriter::write_params(params, &(prefix.to_string() + "x-amz-version-id"), &obj.version_id);
RequestChargedWriter::write_params(params, &(prefix.to_string() + "x-amz-request-charged"), &obj.request_charged);
DeleteMarkerWriter::write_params(params, &(prefix.to_string() + "x-amz-delete-marker"), &obj.delete_marker);
}
}
impl DeleteObjectRequestParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<DeleteObjectRequest, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = DeleteObjectRequest::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "x-amz-mfa" {
obj.mfa = Some(try!(MFAParser::parse_xml("x-amz-mfa", stack)));
continue;
}
if current_name == "versionId" {
obj.version_id = Some(try!(ObjectVersionIdParser::parse_xml("versionId", stack)));
continue;
}
if current_name == "Bucket" {
obj.bucket = try!(BucketNameParser::parse_xml("Bucket", stack));
continue;
}
if current_name == "x-amz-request-payer" {
obj.request_payer = Some(try!(RequestPayerParser::parse_xml("x-amz-request-payer", stack)));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl DeleteObjectRequestWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &DeleteObjectRequest) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
if let Some(ref obj) = obj.mfa {
MFAWriter::write_params(params, &(prefix.to_string() + "x-amz-mfa"), obj);
}
if let Some(ref obj) = obj.version_id {
ObjectVersionIdWriter::write_params(params, &(prefix.to_string() + "versionId"), obj);
}
if let Some(ref obj) = obj.request_payer {
RequestPayerWriter::write_params(params, &(prefix.to_string() + "x-amz-request-payer"), obj);
}
}
}
impl RestoreRequestParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<RestoreRequest, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = RestoreRequest::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "Days" {
obj.days = try!(DaysParser::parse_xml("Days", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl RestoreRequestWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &RestoreRequest) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
DaysWriter::write_params(params, &(prefix.to_string() + "Days"), &obj.days);
}
}
impl RestoreObjectRequestParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<RestoreObjectRequest, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = RestoreObjectRequest::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "versionId" {
obj.version_id = Some(try!(ObjectVersionIdParser::parse_xml("versionId", stack)));
continue;
}
if current_name == "RestoreRequest" {
obj.restore_request = Some(try!(RestoreRequestParser::parse_xml("RestoreRequest", stack)));
continue;
}
if current_name == "Bucket" {
obj.bucket = try!(BucketNameParser::parse_xml("Bucket", stack));
continue;
}
if current_name == "x-amz-request-payer" {
obj.request_payer = Some(try!(RequestPayerParser::parse_xml("x-amz-request-payer", stack)));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl RestoreObjectRequestWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &RestoreObjectRequest) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
if let Some(ref obj) = obj.version_id {
ObjectVersionIdWriter::write_params(params, &(prefix.to_string() + "versionId"), obj);
}
if let Some(ref obj) = obj.restore_request {
RestoreRequestWriter::write_params(params, &(prefix.to_string() + "RestoreRequest"), obj);
}
BucketNameWriter::write_params(params, &(prefix.to_string() + "Bucket"), &obj.bucket);
if let Some(ref obj) = obj.request_payer {
RequestPayerWriter::write_params(params, &(prefix.to_string() + "x-amz-request-payer"), obj);
}
ObjectKeyWriter::write_params(params, &(prefix.to_string() + "Key"), &obj.key);
}
}
impl RestoreObjectOutputParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<RestoreObjectOutput, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = RestoreObjectOutput::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "x-amz-request-charged" {
obj.request_charged = try!(RequestChargedParser::parse_xml("x-amz-request-charged", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl RestoreObjectOutputWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &RestoreObjectOutput) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
RequestChargedWriter::write_params(params, &(prefix.to_string() + "x-amz-request-charged"), &obj.request_charged);
}
}
impl CopyObjectOutputParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<CopyObjectOutput, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = CopyObjectOutput::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "x-amz-server-side-encryption-customer-algorithm" {
obj.sse_customer_algorithm = try!(SSECustomerAlgorithmParser::parse_xml("x-amz-server-side-encryption-customer-algorithm", stack));
continue;
}
if current_name == "x-amz-copy-source-version-id" {
obj.copy_source_version_id = try!(CopySourceVersionIdParser::parse_xml("x-amz-copy-source-version-id", stack));
continue;
}
if current_name == "x-amz-server-side-encryption" {
obj.server_side_encryption = try!(ServerSideEncryptionParser::parse_xml("x-amz-server-side-encryption", stack));
continue;
}
if current_name == "x-amz-request-charged" {
obj.request_charged = try!(RequestChargedParser::parse_xml("x-amz-request-charged", stack));
continue;
}
if current_name == "x-amz-expiration" {
obj.expiration = try!(ExpirationParser::parse_xml("x-amz-expiration", stack));
continue;
}
if current_name == "x-amz-server-side-encryption-customer-key-MD5" {
obj.sse_customer_key_md5 = try!(SSECustomerKeyMD5Parser::parse_xml("x-amz-server-side-encryption-customer-key-MD5", stack));
continue;
}
if current_name == "CopyObjectResult" {
obj.copy_object_result = try!(CopyObjectResultParser::parse_xml("CopyObjectResult", stack));
continue;
}
if current_name == "x-amz-server-side-encryption-aws-kms-key-id" {
obj.ssekms_key_id = try!(SSEKMSKeyIdParser::parse_xml("x-amz-server-side-encryption-aws-kms-key-id", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl CopyObjectOutputWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &CopyObjectOutput) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
SSECustomerAlgorithmWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-customer-algorithm"), &obj.sse_customer_algorithm);
CopySourceVersionIdWriter::write_params(params, &(prefix.to_string() + "x-amz-copy-source-version-id"), &obj.copy_source_version_id);
ServerSideEncryptionWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption"), &obj.server_side_encryption);
RequestChargedWriter::write_params(params, &(prefix.to_string() + "x-amz-request-charged"), &obj.request_charged);
ExpirationWriter::write_params(params, &(prefix.to_string() + "x-amz-expiration"), &obj.expiration);
SSECustomerKeyMD5Writer::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-customer-key-MD5"), &obj.sse_customer_key_md5);
CopyObjectResultWriter::write_params(params, &(prefix.to_string() + "CopyObjectResult"), &obj.copy_object_result);
SSEKMSKeyIdWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-aws-kms-key-id"), &obj.ssekms_key_id);
}
}
impl HeadObjectOutputParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<HeadObjectOutput, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = HeadObjectOutput::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "Last-Modified" {
obj.last_modified = try!(LastModifiedParser::parse_xml("Last-Modified", stack));
continue;
}
if current_name == "x-amz-request-charged" {
obj.request_charged = try!(RequestChargedParser::parse_xml("x-amz-request-charged", stack));
continue;
}
if current_name == "Content-Encoding" {
obj.content_encoding = try!(ContentEncodingParser::parse_xml("Content-Encoding", stack));
continue;
}
if current_name == "x-amz-replication-status" {
obj.replication_status = try!(ReplicationStatusParser::parse_xml("x-amz-replication-status", stack));
continue;
}
if current_name == "x-amz-storage-class" {
obj.storage_class = try!(StorageClassParser::parse_xml("x-amz-storage-class", stack));
continue;
}
if current_name == "x-amz-server-side-encryption" {
obj.server_side_encryption = try!(ServerSideEncryptionParser::parse_xml("x-amz-server-side-encryption", stack));
continue;
}
if current_name == "x-amz-server-side-encryption-aws-kms-key-id" {
obj.ssekms_key_id = try!(SSEKMSKeyIdParser::parse_xml("x-amz-server-side-encryption-aws-kms-key-id", stack));
continue;
}
if current_name == "Content-Disposition" {
obj.content_disposition = try!(ContentDispositionParser::parse_xml("Content-Disposition", stack));
continue;
}
if current_name == "x-amz-meta-" {
obj.metadata = try!(MetadataParser::parse_xml("x-amz-meta-", stack));
continue;
}
if current_name == "accept-ranges" {
obj.accept_ranges = try!(AcceptRangesParser::parse_xml("accept-ranges", stack));
continue;
}
if current_name == "x-amz-website-redirect-location" {
obj.website_redirect_location = try!(WebsiteRedirectLocationParser::parse_xml("x-amz-website-redirect-location", stack));
continue;
}
if current_name == "Expires" {
obj.expires = try!(ExpiresParser::parse_xml("Expires", stack));
continue;
}
if current_name == "x-amz-delete-marker" {
obj.delete_marker = try!(DeleteMarkerParser::parse_xml("x-amz-delete-marker", stack));
continue;
}
if current_name == "Cache-Control" {
obj.cache_control = try!(CacheControlParser::parse_xml("Cache-Control", stack));
continue;
}
if current_name == "Content-Length" {
obj.content_length = try!(ContentLengthParser::parse_xml("Content-Length", stack));
continue;
}
if current_name == "x-amz-expiration" {
obj.expiration = try!(ExpirationParser::parse_xml("x-amz-expiration", stack));
continue;
}
if current_name == "x-amz-missing-meta" {
obj.missing_meta = try!(MissingMetaParser::parse_xml("x-amz-missing-meta", stack));
continue;
}
if current_name == "x-amz-restore" {
obj.restore = try!(RestoreParser::parse_xml("x-amz-restore", stack));
continue;
}
if current_name == "x-amz-server-side-encryption-customer-algorithm" {
obj.sse_customer_algorithm = try!(SSECustomerAlgorithmParser::parse_xml("x-amz-server-side-encryption-customer-algorithm", stack));
continue;
}
if current_name == "Content-Type" {
obj.content_type = try!(ContentTypeParser::parse_xml("Content-Type", stack));
continue;
}
if current_name == "Content-Language" {
obj.content_language = try!(ContentLanguageParser::parse_xml("Content-Language", stack));
continue;
}
if current_name == "x-amz-version-id" {
obj.version_id = try!(ObjectVersionIdParser::parse_xml("x-amz-version-id", stack));
continue;
}
if current_name == "ETag" {
obj.e_tag = try!(ETagParser::parse_xml("ETag", stack));
continue;
}
if current_name == "x-amz-server-side-encryption-customer-key-MD5" {
obj.sse_customer_key_md5 = try!(SSECustomerKeyMD5Parser::parse_xml("x-amz-server-side-encryption-customer-key-MD5", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl HeadObjectOutputWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &HeadObjectOutput) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
LastModifiedWriter::write_params(params, &(prefix.to_string() + "Last-Modified"), &obj.last_modified);
RequestChargedWriter::write_params(params, &(prefix.to_string() + "x-amz-request-charged"), &obj.request_charged);
ContentEncodingWriter::write_params(params, &(prefix.to_string() + "Content-Encoding"), &obj.content_encoding);
ReplicationStatusWriter::write_params(params, &(prefix.to_string() + "x-amz-replication-status"), &obj.replication_status);
StorageClassWriter::write_params(params, &(prefix.to_string() + "x-amz-storage-class"), &obj.storage_class);
ServerSideEncryptionWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption"), &obj.server_side_encryption);
SSEKMSKeyIdWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-aws-kms-key-id"), &obj.ssekms_key_id);
ContentDispositionWriter::write_params(params, &(prefix.to_string() + "Content-Disposition"), &obj.content_disposition);
MetadataWriter::write_params(params, &(prefix.to_string() + "x-amz-meta-"), &obj.metadata);
AcceptRangesWriter::write_params(params, &(prefix.to_string() + "accept-ranges"), &obj.accept_ranges);
WebsiteRedirectLocationWriter::write_params(params, &(prefix.to_string() + "x-amz-website-redirect-location"), &obj.website_redirect_location);
ExpiresWriter::write_params(params, &(prefix.to_string() + "Expires"), &obj.expires);
DeleteMarkerWriter::write_params(params, &(prefix.to_string() + "x-amz-delete-marker"), &obj.delete_marker);
CacheControlWriter::write_params(params, &(prefix.to_string() + "Cache-Control"), &obj.cache_control);
ContentLengthWriter::write_params(params, &(prefix.to_string() + "Content-Length"), &obj.content_length);
ExpirationWriter::write_params(params, &(prefix.to_string() + "x-amz-expiration"), &obj.expiration);
MissingMetaWriter::write_params(params, &(prefix.to_string() + "x-amz-missing-meta"), &obj.missing_meta);
RestoreWriter::write_params(params, &(prefix.to_string() + "x-amz-restore"), &obj.restore);
SSECustomerAlgorithmWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-customer-algorithm"), &obj.sse_customer_algorithm);
ContentTypeWriter::write_params(params, &(prefix.to_string() + "Content-Type"), &obj.content_type);
ContentLanguageWriter::write_params(params, &(prefix.to_string() + "Content-Language"), &obj.content_language);
ObjectVersionIdWriter::write_params(params, &(prefix.to_string() + "x-amz-version-id"), &obj.version_id);
ETagWriter::write_params(params, &(prefix.to_string() + "ETag"), &obj.e_tag);
SSECustomerKeyMD5Writer::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-customer-key-MD5"), &obj.sse_customer_key_md5);
}
}
impl ObjectVersionListParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<ObjectVersionList, XmlParseError> {
let mut obj = Vec::new();
while try!(peek_at_name(stack)) == "Version" {
obj.push(try!(ObjectVersionParser::parse_xml("Version", stack)));
}
Ok(obj)
}
}
impl ObjectVersionListWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &ObjectVersionList) {
let mut index = 1;
for element in obj.iter() {
let key = &format!("{}.{}", name, index);
ObjectVersionWriter::write_params(params, key, element);
index += 1;
}
}
}
impl ObjectStorageClassParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<ObjectStorageClass, XmlParseError> {
try!(start_element(tag_name, stack));
let obj = try!(characters(stack));
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl ObjectStorageClassWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &ObjectStorageClass) {
params.put(name, obj);
}
}
impl CopyObjectRequestParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<CopyObjectRequest, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = CopyObjectRequest::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "x-amz-request-payer" {
obj.request_payer = Some(try!(RequestPayerParser::parse_xml("x-amz-request-payer", stack)));
continue;
}
if current_name == "x-amz-copy-source-if-modified-since" {
obj.copy_source_if_modified_since = Some(try!(CopySourceIfModifiedSinceParser::parse_xml("x-amz-copy-source-if-modified-since", stack)));
continue;
}
if current_name == "x-amz-copy-source-if-unmodified-since" {
obj.copy_source_if_unmodified_since = Some(try!(CopySourceIfUnmodifiedSinceParser::parse_xml("x-amz-copy-source-if-unmodified-since", stack)));
continue;
}
if current_name == "Content-Encoding" {
obj.content_encoding = Some(try!(ContentEncodingParser::parse_xml("Content-Encoding", stack)));
continue;
}
if current_name == "x-amz-copy-source-server-side-encryption-customer-key" {
obj.copy_source_sse_customer_key = Some(try!(CopySourceSSECustomerKeyParser::parse_xml("x-amz-copy-source-server-side-encryption-customer-key", stack)));
continue;
}
if current_name == "x-amz-storage-class" {
obj.storage_class = Some(try!(StorageClassParser::parse_xml("x-amz-storage-class", stack)));
continue;
}
if current_name == "x-amz-grant-read-acp" {
obj.grant_read_acp = Some(try!(GrantReadACPParser::parse_xml("x-amz-grant-read-acp", stack)));
continue;
}
if current_name == "x-amz-server-side-encryption" {
obj.server_side_encryption = Some(try!(ServerSideEncryptionParser::parse_xml("x-amz-server-side-encryption", stack)));
continue;
}
if current_name == "x-amz-server-side-encryption-aws-kms-key-id" {
obj.ssekms_key_id = Some(try!(SSEKMSKeyIdParser::parse_xml("x-amz-server-side-encryption-aws-kms-key-id", stack)));
continue;
}
if current_name == "Content-Disposition" {
obj.content_disposition = Some(try!(ContentDispositionParser::parse_xml("Content-Disposition", stack)));
continue;
}
if current_name == "x-amz-meta-" {
obj.metadata = Some(try!(MetadataParser::parse_xml("x-amz-meta-", stack)));
continue;
}
if current_name == "x-amz-server-side-encryption-customer-key" {
obj.sse_customer_key = Some(try!(SSECustomerKeyParser::parse_xml("x-amz-server-side-encryption-customer-key", stack)));
continue;
}
if current_name == "x-amz-website-redirect-location" {
obj.website_redirect_location = Some(try!(WebsiteRedirectLocationParser::parse_xml("x-amz-website-redirect-location", stack)));
continue;
}
if current_name == "x-amz-copy-source" {
obj.copy_source = try!(CopySourceParser::parse_xml("x-amz-copy-source", stack));
continue;
}
if current_name == "Expires" {
obj.expires = Some(try!(ExpiresParser::parse_xml("Expires", stack)));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
if current_name == "Cache-Control" {
obj.cache_control = Some(try!(CacheControlParser::parse_xml("Cache-Control", stack)));
continue;
}
if current_name == "x-amz-copy-source-server-side-encryption-customer-algorithm" {
obj.copy_source_sse_customer_algorithm = Some(try!(CopySourceSSECustomerAlgorithmParser::parse_xml("x-amz-copy-source-server-side-encryption-customer-algorithm", stack)));
continue;
}
if current_name == "Bucket" {
obj.bucket = try!(BucketNameParser::parse_xml("Bucket", stack));
continue;
}
if current_name == "x-amz-grant-read" {
obj.grant_read = Some(try!(GrantReadParser::parse_xml("x-amz-grant-read", stack)));
continue;
}
if current_name == "x-amz-grant-write-acp" {
obj.grant_write_acp = Some(try!(GrantWriteACPParser::parse_xml("x-amz-grant-write-acp", stack)));
continue;
}
if current_name == "x-amz-copy-source-server-side-encryption-customer-key-MD5" {
obj.copy_source_sse_customer_key_md5 = Some(try!(CopySourceSSECustomerKeyMD5Parser::parse_xml("x-amz-copy-source-server-side-encryption-customer-key-MD5", stack)));
continue;
}
if current_name == "x-amz-grant-full-control" {
obj.grant_full_control = Some(try!(GrantFullControlParser::parse_xml("x-amz-grant-full-control", stack)));
continue;
}
if current_name == "x-amz-copy-source-if-match" {
obj.copy_source_if_match = Some(try!(CopySourceIfMatchParser::parse_xml("x-amz-copy-source-if-match", stack)));
continue;
}
if current_name == "x-amz-server-side-encryption-customer-algorithm" {
obj.sse_customer_algorithm = Some(try!(SSECustomerAlgorithmParser::parse_xml("x-amz-server-side-encryption-customer-algorithm", stack)));
continue;
}
if current_name == "Content-Type" {
obj.content_type = Some(try!(ContentTypeParser::parse_xml("Content-Type", stack)));
continue;
}
if current_name == "Content-Language" {
obj.content_language = Some(try!(ContentLanguageParser::parse_xml("Content-Language", stack)));
continue;
}
if current_name == "x-amz-metadata-directive" {
obj.metadata_directive = Some(try!(MetadataDirectiveParser::parse_xml("x-amz-metadata-directive", stack)));
continue;
}
if current_name == "x-amz-copy-source-if-none-match" {
obj.copy_source_if_none_match = Some(try!(CopySourceIfNoneMatchParser::parse_xml("x-amz-copy-source-if-none-match", stack)));
continue;
}
if current_name == "x-amz-server-side-encryption-customer-key-MD5" {
obj.sse_customer_key_md5 = Some(try!(SSECustomerKeyMD5Parser::parse_xml("x-amz-server-side-encryption-customer-key-MD5", stack)));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl CopyObjectRequestWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &CopyObjectRequest) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
if let Some(ref obj) = obj.request_payer {
RequestPayerWriter::write_params(params, &(prefix.to_string() + "x-amz-request-payer"), obj);
}
if let Some(ref obj) = obj.copy_source_if_modified_since {
CopySourceIfModifiedSinceWriter::write_params(params, &(prefix.to_string() + "x-amz-copy-source-if-modified-since"), obj);
}
if let Some(ref obj) = obj.copy_source_if_unmodified_since {
CopySourceIfUnmodifiedSinceWriter::write_params(params, &(prefix.to_string() + "x-amz-copy-source-if-unmodified-since"), obj);
}
if let Some(ref obj) = obj.content_encoding {
ContentEncodingWriter::write_params(params, &(prefix.to_string() + "Content-Encoding"), obj);
}
if let Some(ref obj) = obj.copy_source_sse_customer_key {
CopySourceSSECustomerKeyWriter::write_params(params, &(prefix.to_string() + "x-amz-copy-source-server-side-encryption-customer-key"), obj);
}
if let Some(ref obj) = obj.storage_class {
StorageClassWriter::write_params(params, &(prefix.to_string() + "x-amz-storage-class"), obj);
}
if let Some(ref obj) = obj.grant_read_acp {
GrantReadACPWriter::write_params(params, &(prefix.to_string() + "x-amz-grant-read-acp"), obj);
}
if let Some(ref obj) = obj.server_side_encryption {
ServerSideEncryptionWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption"), obj);
}
if let Some(ref obj) = obj.ssekms_key_id {
SSEKMSKeyIdWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-aws-kms-key-id"), obj);
}
if let Some(ref obj) = obj.content_disposition {
ContentDispositionWriter::write_params(params, &(prefix.to_string() + "Content-Disposition"), obj);
}
if let Some(ref obj) = obj.metadata {
MetadataWriter::write_params(params, &(prefix.to_string() + "x-amz-meta-"), obj);
}
if let Some(ref obj) = obj.sse_customer_key {
SSECustomerKeyWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-customer-key"), obj);
}
if let Some(ref obj) = obj.website_redirect_location {
WebsiteRedirectLocationWriter::write_params(params, &(prefix.to_string() + "x-amz-website-redirect-location"), obj);
}
CopySourceWriter::write_params(params, &(prefix.to_string() + "x-amz-copy-source"), &obj.copy_source);
if let Some(ref obj) = obj.expires {
ExpiresWriter::write_params(params, &(prefix.to_string() + "Expires"), obj);
}
ObjectKeyWriter::write_params(params, &(prefix.to_string() + "Key"), &obj.key);
if let Some(ref obj) = obj.cache_control {
CacheControlWriter::write_params(params, &(prefix.to_string() + "Cache-Control"), obj);
}
if let Some(ref obj) = obj.copy_source_sse_customer_algorithm {
CopySourceSSECustomerAlgorithmWriter::write_params(params, &(prefix.to_string() + "x-amz-copy-source-server-side-encryption-customer-algorithm"), obj);
}
BucketNameWriter::write_params(params, &(prefix.to_string() + "Bucket"), &obj.bucket);
if let Some(ref obj) = obj.grant_read {
GrantReadWriter::write_params(params, &(prefix.to_string() + "x-amz-grant-read"), obj);
}
if let Some(ref obj) = obj.grant_write_acp {
GrantWriteACPWriter::write_params(params, &(prefix.to_string() + "x-amz-grant-write-acp"), obj);
}
if let Some(ref obj) = obj.copy_source_sse_customer_key_md5 {
CopySourceSSECustomerKeyMD5Writer::write_params(params, &(prefix.to_string() + "x-amz-copy-source-server-side-encryption-customer-key-MD5"), obj);
}
if let Some(ref obj) = obj.grant_full_control {
GrantFullControlWriter::write_params(params, &(prefix.to_string() + "x-amz-grant-full-control"), obj);
}
if let Some(ref obj) = obj.copy_source_if_match {
CopySourceIfMatchWriter::write_params(params, &(prefix.to_string() + "x-amz-copy-source-if-match"), obj);
}
if let Some(ref obj) = obj.sse_customer_algorithm {
SSECustomerAlgorithmWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-customer-algorithm"), obj);
}
if let Some(ref obj) = obj.content_type {
ContentTypeWriter::write_params(params, &(prefix.to_string() + "Content-Type"), obj);
}
if let Some(ref obj) = obj.content_language {
ContentLanguageWriter::write_params(params, &(prefix.to_string() + "Content-Language"), obj);
}
if let Some(ref obj) = obj.metadata_directive {
MetadataDirectiveWriter::write_params(params, &(prefix.to_string() + "x-amz-metadata-directive"), obj);
}
if let Some(ref obj) = obj.copy_source_if_none_match {
CopySourceIfNoneMatchWriter::write_params(params, &(prefix.to_string() + "x-amz-copy-source-if-none-match"), obj);
}
if let Some(ref obj) = obj.sse_customer_key_md5 {
SSECustomerKeyMD5Writer::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-customer-key-MD5"), obj);
}
}
}
impl DeleteObjectsOutputParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<DeleteObjectsOutput, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = DeleteObjectsOutput::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "DeletedObject" {
obj.deleted = try!(DeletedObjectsParser::parse_xml("DeletedObject", stack));
continue;
}
if current_name == "Error" {
obj.errors = try!(ErrorsParser::parse_xml("Error", stack));
continue;
}
if current_name == "x-amz-request-charged" {
obj.request_charged = try!(RequestChargedParser::parse_xml("x-amz-request-charged", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl DeleteObjectsOutputWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &DeleteObjectsOutput) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
DeletedObjectsWriter::write_params(params, &(prefix.to_string() + "DeletedObject"), &obj.deleted);
ErrorsWriter::write_params(params, &(prefix.to_string() + "Error"), &obj.errors);
RequestChargedWriter::write_params(params, &(prefix.to_string() + "x-amz-request-charged"), &obj.request_charged);
}
}
impl GetObjectOutput {
pub fn get_body(&self) -> &[u8] {
if self.is_body {
return &self.body;
}
&self.body_buffer
}
}
impl GetObjectOutputParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<GetObjectOutput, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = GetObjectOutput::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "Last-Modified" {
obj.last_modified = try!(LastModifiedParser::parse_xml("Last-Modified", stack));
continue;
}
if current_name == "Content-Range" {
obj.content_range = try!(ContentRangeParser::parse_xml("Content-Range", stack));
continue;
}
if current_name == "x-amz-request-charged" {
obj.request_charged = try!(RequestChargedParser::parse_xml("x-amz-request-charged", stack));
continue;
}
if current_name == "Content-Encoding" {
obj.content_encoding = try!(ContentEncodingParser::parse_xml("Content-Encoding", stack));
continue;
}
if current_name == "x-amz-replication-status" {
obj.replication_status = try!(ReplicationStatusParser::parse_xml("x-amz-replication-status", stack));
continue;
}
if current_name == "x-amz-storage-class" {
obj.storage_class = try!(StorageClassParser::parse_xml("x-amz-storage-class", stack));
continue;
}
if current_name == "x-amz-server-side-encryption" {
obj.server_side_encryption = try!(ServerSideEncryptionParser::parse_xml("x-amz-server-side-encryption", stack));
continue;
}
if current_name == "x-amz-server-side-encryption-aws-kms-key-id" {
obj.ssekms_key_id = try!(SSEKMSKeyIdParser::parse_xml("x-amz-server-side-encryption-aws-kms-key-id", stack));
continue;
}
if current_name == "Content-Disposition" {
obj.content_disposition = try!(ContentDispositionParser::parse_xml("Content-Disposition", stack));
continue;
}
if current_name == "x-amz-meta-" {
obj.metadata = try!(MetadataParser::parse_xml("x-amz-meta-", stack));
continue;
}
if current_name == "Body" {
obj.body = try!(BodyParser::parse_xml("Body", stack));
continue;
}
if current_name == "accept-ranges" {
obj.accept_ranges = try!(AcceptRangesParser::parse_xml("accept-ranges", stack));
continue;
}
if current_name == "x-amz-website-redirect-location" {
obj.website_redirect_location = try!(WebsiteRedirectLocationParser::parse_xml("x-amz-website-redirect-location", stack));
continue;
}
if current_name == "Expires" {
obj.expires = try!(ExpiresParser::parse_xml("Expires", stack));
continue;
}
if current_name == "x-amz-delete-marker" {
obj.delete_marker = try!(DeleteMarkerParser::parse_xml("x-amz-delete-marker", stack));
continue;
}
if current_name == "Cache-Control" {
obj.cache_control = try!(CacheControlParser::parse_xml("Cache-Control", stack));
continue;
}
if current_name == "Content-Length" {
obj.content_length = try!(ContentLengthParser::parse_xml("Content-Length", stack));
continue;
}
if current_name == "x-amz-expiration" {
obj.expiration = try!(ExpirationParser::parse_xml("x-amz-expiration", stack));
continue;
}
if current_name == "x-amz-missing-meta" {
obj.missing_meta = try!(MissingMetaParser::parse_xml("x-amz-missing-meta", stack));
continue;
}
if current_name == "x-amz-restore" {
obj.restore = try!(RestoreParser::parse_xml("x-amz-restore", stack));
continue;
}
if current_name == "x-amz-server-side-encryption-customer-algorithm" {
obj.sse_customer_algorithm = try!(SSECustomerAlgorithmParser::parse_xml("x-amz-server-side-encryption-customer-algorithm", stack));
continue;
}
if current_name == "Content-Type" {
obj.content_type = try!(ContentTypeParser::parse_xml("Content-Type", stack));
continue;
}
if current_name == "Content-Language" {
obj.content_language = try!(ContentLanguageParser::parse_xml("Content-Language", stack));
continue;
}
if current_name == "x-amz-version-id" {
obj.version_id = try!(ObjectVersionIdParser::parse_xml("x-amz-version-id", stack));
continue;
}
if current_name == "ETag" {
obj.e_tag = try!(ETagParser::parse_xml("ETag", stack));
continue;
}
if current_name == "x-amz-server-side-encryption-customer-key-MD5" {
obj.sse_customer_key_md5 = try!(SSECustomerKeyMD5Parser::parse_xml("x-amz-server-side-encryption-customer-key-MD5", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl GetObjectOutputWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &GetObjectOutput) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
LastModifiedWriter::write_params(params, &(prefix.to_string() + "Last-Modified"), &obj.last_modified);
ContentRangeWriter::write_params(params, &(prefix.to_string() + "Content-Range"), &obj.content_range);
RequestChargedWriter::write_params(params, &(prefix.to_string() + "x-amz-request-charged"), &obj.request_charged);
ContentEncodingWriter::write_params(params, &(prefix.to_string() + "Content-Encoding"), &obj.content_encoding);
ReplicationStatusWriter::write_params(params, &(prefix.to_string() + "x-amz-replication-status"), &obj.replication_status);
StorageClassWriter::write_params(params, &(prefix.to_string() + "x-amz-storage-class"), &obj.storage_class);
ServerSideEncryptionWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption"), &obj.server_side_encryption);
SSEKMSKeyIdWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-aws-kms-key-id"), &obj.ssekms_key_id);
ContentDispositionWriter::write_params(params, &(prefix.to_string() + "Content-Disposition"), &obj.content_disposition);
MetadataWriter::write_params(params, &(prefix.to_string() + "x-amz-meta-"), &obj.metadata);
BodyWriter::write_params(params, &(prefix.to_string() + "Body"), &obj.body);
AcceptRangesWriter::write_params(params, &(prefix.to_string() + "accept-ranges"), &obj.accept_ranges);
WebsiteRedirectLocationWriter::write_params(params, &(prefix.to_string() + "x-amz-website-redirect-location"), &obj.website_redirect_location);
ExpiresWriter::write_params(params, &(prefix.to_string() + "Expires"), &obj.expires);
DeleteMarkerWriter::write_params(params, &(prefix.to_string() + "x-amz-delete-marker"), &obj.delete_marker);
CacheControlWriter::write_params(params, &(prefix.to_string() + "Cache-Control"), &obj.cache_control);
ContentLengthWriter::write_params(params, &(prefix.to_string() + "Content-Length"), &obj.content_length);
ExpirationWriter::write_params(params, &(prefix.to_string() + "x-amz-expiration"), &obj.expiration);
MissingMetaWriter::write_params(params, &(prefix.to_string() + "x-amz-missing-meta"), &obj.missing_meta);
RestoreWriter::write_params(params, &(prefix.to_string() + "x-amz-restore"), &obj.restore);
SSECustomerAlgorithmWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-customer-algorithm"), &obj.sse_customer_algorithm);
ContentTypeWriter::write_params(params, &(prefix.to_string() + "Content-Type"), &obj.content_type);
ContentLanguageWriter::write_params(params, &(prefix.to_string() + "Content-Language"), &obj.content_language);
ObjectVersionIdWriter::write_params(params, &(prefix.to_string() + "x-amz-version-id"), &obj.version_id);
ETagWriter::write_params(params, &(prefix.to_string() + "ETag"), &obj.e_tag);
SSECustomerKeyMD5Writer::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-customer-key-MD5"), &obj.sse_customer_key_md5);
}
}
impl MultipartUploadCreateRequestParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<MultipartUploadCreateRequest, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = MultipartUploadCreateRequest::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "x-amz-request-payer" {
obj.request_payer = Some(try!(RequestPayerParser::parse_xml("x-amz-request-payer", stack)));
continue;
}
if current_name == "Content-Encoding" {
obj.content_encoding = Some(try!(ContentEncodingParser::parse_xml("Content-Encoding", stack)));
continue;
}
if current_name == "x-amz-storage-class" {
obj.storage_class = Some(try!(StorageClassParser::parse_xml("x-amz-storage-class", stack)));
continue;
}
if current_name == "x-amz-grant-read-acp" {
obj.grant_read_acp = Some(try!(GrantReadACPParser::parse_xml("x-amz-grant-read-acp", stack)));
continue;
}
if current_name == "x-amz-server-side-encryption" {
obj.server_side_encryption = Some(try!(ServerSideEncryptionParser::parse_xml("x-amz-server-side-encryption", stack)));
continue;
}
if current_name == "x-amz-server-side-encryption-aws-kms-key-id" {
obj.ssekms_key_id = Some(try!(SSEKMSKeyIdParser::parse_xml("x-amz-server-side-encryption-aws-kms-key-id", stack)));
continue;
}
if current_name == "Content-Disposition" {
obj.content_disposition = Some(try!(ContentDispositionParser::parse_xml("Content-Disposition", stack)));
continue;
}
if current_name == "x-amz-meta-" {
obj.metadata = Some(try!(MetadataParser::parse_xml("x-amz-meta-", stack)));
continue;
}
if current_name == "x-amz-server-side-encryption-customer-key" {
obj.sse_customer_key = Some(try!(SSECustomerKeyParser::parse_xml("x-amz-server-side-encryption-customer-key", stack)));
continue;
}
if current_name == "x-amz-website-redirect-location" {
obj.website_redirect_location = Some(try!(WebsiteRedirectLocationParser::parse_xml("x-amz-website-redirect-location", stack)));
continue;
}
if current_name == "Expires" {
obj.expires = Some(try!(ExpiresParser::parse_xml("Expires", stack)));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
if current_name == "Cache-Control" {
obj.cache_control = Some(try!(CacheControlParser::parse_xml("Cache-Control", stack)));
continue;
}
if current_name == "Bucket" {
obj.bucket = try!(BucketNameParser::parse_xml("Bucket", stack));
continue;
}
if current_name == "x-amz-grant-read" {
obj.grant_read = Some(try!(GrantReadParser::parse_xml("x-amz-grant-read", stack)));
continue;
}
if current_name == "x-amz-grant-write-acp" {
obj.grant_write_acp = Some(try!(GrantWriteACPParser::parse_xml("x-amz-grant-write-acp", stack)));
continue;
}
if current_name == "x-amz-acl" {
obj.acl = Some(try!(ObjectCannedACLParser::parse_xml("x-amz-acl", stack)));
continue;
}
if current_name == "x-amz-grant-full-control" {
obj.grant_full_control = Some(try!(GrantFullControlParser::parse_xml("x-amz-grant-full-control", stack)));
continue;
}
if current_name == "x-amz-server-side-encryption-customer-algorithm" {
obj.sse_customer_algorithm = Some(try!(SSECustomerAlgorithmParser::parse_xml("x-amz-server-side-encryption-customer-algorithm", stack)));
continue;
}
if current_name == "Content-Type" {
obj.content_type = Some(try!(ContentTypeParser::parse_xml("Content-Type", stack)));
continue;
}
if current_name == "Content-Language" {
obj.content_language = Some(try!(ContentLanguageParser::parse_xml("Content-Language", stack)));
continue;
}
if current_name == "x-amz-server-side-encryption-customer-key-MD5" {
obj.sse_customer_key_md5 = Some(try!(SSECustomerKeyMD5Parser::parse_xml("x-amz-server-side-encryption-customer-key-MD5", stack)));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl MultipartUploadCreateRequestWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &MultipartUploadCreateRequest) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
if let Some(ref obj) = obj.request_payer {
RequestPayerWriter::write_params(params, &(prefix.to_string() + "x-amz-request-payer"), obj);
}
if let Some(ref obj) = obj.content_encoding {
ContentEncodingWriter::write_params(params, &(prefix.to_string() + "Content-Encoding"), obj);
}
if let Some(ref obj) = obj.storage_class {
StorageClassWriter::write_params(params, &(prefix.to_string() + "x-amz-storage-class"), obj);
}
if let Some(ref obj) = obj.grant_read_acp {
GrantReadACPWriter::write_params(params, &(prefix.to_string() + "x-amz-grant-read-acp"), obj);
}
if let Some(ref obj) = obj.server_side_encryption {
ServerSideEncryptionWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption"), obj);
}
if let Some(ref obj) = obj.ssekms_key_id {
SSEKMSKeyIdWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-aws-kms-key-id"), obj);
}
if let Some(ref obj) = obj.content_disposition {
ContentDispositionWriter::write_params(params, &(prefix.to_string() + "Content-Disposition"), obj);
}
if let Some(ref obj) = obj.metadata {
MetadataWriter::write_params(params, &(prefix.to_string() + "x-amz-meta-"), obj);
}
if let Some(ref obj) = obj.sse_customer_key {
SSECustomerKeyWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-customer-key"), obj);
}
if let Some(ref obj) = obj.website_redirect_location {
WebsiteRedirectLocationWriter::write_params(params, &(prefix.to_string() + "x-amz-website-redirect-location"), obj);
}
if let Some(ref obj) = obj.expires {
ExpiresWriter::write_params(params, &(prefix.to_string() + "Expires"), obj);
}
ObjectKeyWriter::write_params(params, &(prefix.to_string() + "Key"), &obj.key);
if let Some(ref obj) = obj.cache_control {
CacheControlWriter::write_params(params, &(prefix.to_string() + "Cache-Control"), obj);
}
BucketNameWriter::write_params(params, &(prefix.to_string() + "Bucket"), &obj.bucket);
if let Some(ref obj) = obj.grant_read {
GrantReadWriter::write_params(params, &(prefix.to_string() + "x-amz-grant-read"), obj);
}
if let Some(ref obj) = obj.grant_write_acp {
GrantWriteACPWriter::write_params(params, &(prefix.to_string() + "x-amz-grant-write-acp"), obj);
}
if let Some(ref obj) = obj.acl {
ObjectCannedACLWriter::write_params(params, &(prefix.to_string() + "x-amz-acl"), obj);
}
if let Some(ref obj) = obj.grant_full_control {
GrantFullControlWriter::write_params(params, &(prefix.to_string() + "x-amz-grant-full-control"), obj);
}
if let Some(ref obj) = obj.sse_customer_algorithm {
SSECustomerAlgorithmWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-customer-algorithm"), obj);
}
if let Some(ref obj) = obj.content_type {
ContentTypeWriter::write_params(params, &(prefix.to_string() + "Content-Type"), obj);
}
if let Some(ref obj) = obj.content_language {
ContentLanguageWriter::write_params(params, &(prefix.to_string() + "Content-Language"), obj);
}
if let Some(ref obj) = obj.sse_customer_key_md5 {
SSECustomerKeyMD5Writer::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-customer-key-MD5"), obj);
}
}
}
impl GetObjectTorrentRequestParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<GetObjectTorrentRequest, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = GetObjectTorrentRequest::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "Bucket" {
obj.bucket = try!(BucketNameParser::parse_xml("Bucket", stack));
continue;
}
if current_name == "x-amz-request-payer" {
obj.request_payer = Some(try!(RequestPayerParser::parse_xml("x-amz-request-payer", stack)));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl GetObjectTorrentRequestWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &GetObjectTorrentRequest) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
BucketNameWriter::write_params(params, &(prefix.to_string() + "Bucket"), &obj.bucket);
if let Some(ref obj) = obj.request_payer {
RequestPayerWriter::write_params(params, &(prefix.to_string() + "x-amz-request-payer"), obj);
}
ObjectKeyWriter::write_params(params, &(prefix.to_string() + "Key"), &obj.key);
}
}
impl DeleteMarkerEntryParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<DeleteMarkerEntry, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = DeleteMarkerEntry::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "Owner" {
obj.owner = try!(OwnerParser::parse_xml("Owner", stack));
continue;
}
if current_name == "IsLatest" {
obj.is_latest = try!(IsLatestParser::parse_xml("IsLatest", stack));
continue;
}
if current_name == "VersionId" {
obj.version_id = try!(ObjectVersionIdParser::parse_xml("VersionId", stack));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
if current_name == "LastModified" {
obj.last_modified = try!(LastModifiedParser::parse_xml("LastModified", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl DeleteMarkerEntryWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &DeleteMarkerEntry) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
OwnerWriter::write_params(params, &(prefix.to_string() + "Owner"), &obj.owner);
IsLatestWriter::write_params(params, &(prefix.to_string() + "IsLatest"), &obj.is_latest);
ObjectVersionIdWriter::write_params(params, &(prefix.to_string() + "VersionId"), &obj.version_id);
ObjectKeyWriter::write_params(params, &(prefix.to_string() + "Key"), &obj.key);
LastModifiedWriter::write_params(params, &(prefix.to_string() + "LastModified"), &obj.last_modified);
}
}
impl DeleteMarkersParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<DeleteMarkers, XmlParseError> {
let mut obj = Vec::new();
while try!(peek_at_name(stack)) == "DeleteMarker" {
obj.push(try!(DeleteMarkerEntryParser::parse_xml("DeleteMarker", stack)));
}
Ok(obj)
}
}
impl DeleteMarkersWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &DeleteMarkers) {
let mut index = 1;
for element in obj.iter() {
let key = &format!("{}.{}", name, index);
DeleteMarkerEntryWriter::write_params(params, key, element);
index += 1;
}
}
}
impl ListObjectsRequestParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<ListObjectsRequest, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = ListObjectsRequest::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "Bucket" {
obj.bucket = try!(BucketNameParser::parse_xml("Bucket", stack));
continue;
}
if current_name == "prefix" {
obj.prefix = Some(try!(PrefixParser::parse_xml("prefix", stack)));
continue;
}
if current_name == "max-keys" {
obj.max_keys = Some(try!(MaxKeysParser::parse_xml("max-keys", stack)));
continue;
}
if current_name == "delimiter" {
obj.delimiter = Some(try!(DelimiterParser::parse_xml("delimiter", stack)));
continue;
}
if current_name == "marker" {
obj.marker = Some(try!(MarkerParser::parse_xml("marker", stack)));
continue;
}
if current_name == "encoding-type" {
obj.encoding_type = Some(try!(EncodingTypeParser::parse_xml("encoding-type", stack)));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl ListObjectsRequestWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &ListObjectsRequest) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
BucketNameWriter::write_params(params, &(prefix.to_string() + "Bucket"), &obj.bucket);
if let Some(ref obj) = obj.prefix {
PrefixWriter::write_params(params, &(prefix.to_string() + "prefix"), obj);
}
if let Some(ref obj) = obj.max_keys {
MaxKeysWriter::write_params(params, &(prefix.to_string() + "max-keys"), obj);
}
if let Some(ref obj) = obj.delimiter {
DelimiterWriter::write_params(params, &(prefix.to_string() + "delimiter"), obj);
}
if let Some(ref obj) = obj.marker {
MarkerWriter::write_params(params, &(prefix.to_string() + "marker"), obj);
}
if let Some(ref obj) = obj.encoding_type {
EncodingTypeWriter::write_params(params, &(prefix.to_string() + "encoding-type"), obj);
}
}
}
impl NextVersionIdMarkerParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<NextVersionIdMarker, XmlParseError> {
try!(start_element(tag_name, stack));
let obj = try!(characters(stack));
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl NextVersionIdMarkerWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &NextVersionIdMarker) {
params.put(name, obj);
}
}
impl ListVersionsResultParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<ListVersionsResult, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = ListVersionsResult::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "Name" {
obj.name = try!(BucketNameParser::parse_xml("Name", stack));
continue;
}
if current_name == "Version" {
obj.versions = try!(ObjectVersionListParser::parse_xml("Version", stack));
continue;
}
if current_name == "DeleteMarker" {
obj.delete_markers = try!(DeleteMarkersParser::parse_xml("DeleteMarker", stack));
continue;
}
if current_name == "NextKeyMarker" {
obj.next_key_marker = try!(NextKeyMarkerParser::parse_xml("NextKeyMarker", stack));
continue;
}
if current_name == "Delimiter" {
obj.delimiter = try!(DelimiterParser::parse_xml("Delimiter", stack));
continue;
}
if current_name == "MaxKeys" {
obj.max_keys = try!(MaxKeysParser::parse_xml("MaxKeys", stack));
continue;
}
if current_name == "Prefix" {
obj.prefix = try!(PrefixParser::parse_xml("Prefix", stack));
continue;
}
if current_name == "KeyMarker" {
obj.key_marker = try!(KeyMarkerParser::parse_xml("KeyMarker", stack));
continue;
}
if current_name == "NextVersionIdMarker" {
obj.next_version_id_marker = try!(NextVersionIdMarkerParser::parse_xml("NextVersionIdMarker", stack));
continue;
}
if current_name == "EncodingType" {
obj.encoding_type = try!(EncodingTypeParser::parse_xml("EncodingType", stack));
continue;
}
if current_name == "IsTruncated" {
obj.is_truncated = try!(IsTruncatedParser::parse_xml("IsTruncated", stack));
continue;
}
if current_name == "VersionIdMarker" {
obj.version_id_marker = try!(VersionIdMarkerParser::parse_xml("VersionIdMarker", stack));
continue;
}
if current_name == "CommonPrefix" {
obj.common_prefixes = try!(CommonPrefixListParser::parse_xml("CommonPrefix", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl ListVersionsResultWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &ListVersionsResult) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
BucketNameWriter::write_params(params, &(prefix.to_string() + "Name"), &obj.name);
ObjectVersionListWriter::write_params(params, &(prefix.to_string() + "Version"), &obj.versions);
DeleteMarkersWriter::write_params(params, &(prefix.to_string() + "DeleteMarkerEntry"), &obj.delete_markers);
NextKeyMarkerWriter::write_params(params, &(prefix.to_string() + "NextKeyMarker"), &obj.next_key_marker);
DelimiterWriter::write_params(params, &(prefix.to_string() + "Delimiter"), &obj.delimiter);
MaxKeysWriter::write_params(params, &(prefix.to_string() + "MaxKeys"), &obj.max_keys);
PrefixWriter::write_params(params, &(prefix.to_string() + "Prefix"), &obj.prefix);
KeyMarkerWriter::write_params(params, &(prefix.to_string() + "KeyMarker"), &obj.key_marker);
NextVersionIdMarkerWriter::write_params(params, &(prefix.to_string() + "NextVersionIdMarker"), &obj.next_version_id_marker);
EncodingTypeWriter::write_params(params, &(prefix.to_string() + "EncodingType"), &obj.encoding_type);
IsTruncatedWriter::write_params(params, &(prefix.to_string() + "IsTruncated"), &obj.is_truncated);
VersionIdMarkerWriter::write_params(params, &(prefix.to_string() + "VersionIdMarker"), &obj.version_id_marker);
CommonPrefixListWriter::write_params(params, &(prefix.to_string() + "CommonPrefix"), &obj.common_prefixes);
}
}
impl ListObjectVersionsRequestParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<ListObjectVersionsRequest, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = ListObjectVersionsRequest::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "Bucket" {
obj.bucket = try!(BucketNameParser::parse_xml("Bucket", stack));
continue;
}
if current_name == "prefix" {
obj.prefix = Some(try!(PrefixParser::parse_xml("prefix", stack)));
continue;
}
if current_name == "max-keys" {
obj.max_keys = Some(try!(MaxKeysParser::parse_xml("max-keys", stack)));
continue;
}
if current_name == "delimiter" {
obj.delimiter = Some(try!(DelimiterParser::parse_xml("delimiter", stack)));
continue;
}
if current_name == "key-marker" {
obj.key_marker = Some(try!(KeyMarkerParser::parse_xml("key-marker", stack)));
continue;
}
if current_name == "encoding-type" {
obj.encoding_type = Some(try!(EncodingTypeParser::parse_xml("encoding-type", stack)));
continue;
}
if current_name == "version-id-marker" {
obj.version_id_marker = Some(try!(VersionIdMarkerParser::parse_xml("version-id-marker", stack)));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl ListObjectVersionsRequestWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &ListObjectVersionsRequest) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
BucketNameWriter::write_params(params, &(prefix.to_string() + "Bucket"), &obj.bucket);
if let Some(ref obj) = obj.prefix {
PrefixWriter::write_params(params, &(prefix.to_string() + "prefix"), obj);
}
if let Some(ref obj) = obj.max_keys {
MaxKeysWriter::write_params(params, &(prefix.to_string() + "max-keys"), obj);
}
if let Some(ref obj) = obj.delimiter {
DelimiterWriter::write_params(params, &(prefix.to_string() + "delimiter"), obj);
}
if let Some(ref obj) = obj.key_marker {
KeyMarkerWriter::write_params(params, &(prefix.to_string() + "key-marker"), obj);
}
if let Some(ref obj) = obj.encoding_type {
EncodingTypeWriter::write_params(params, &(prefix.to_string() + "encoding-type"), obj);
}
if let Some(ref obj) = obj.version_id_marker {
VersionIdMarkerWriter::write_params(params, &(prefix.to_string() + "version-id-marker"), obj);
}
}
}
impl MultipartUploadCreateOutputParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<MultipartUploadCreateOutput, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = MultipartUploadCreateOutput::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "x-amz-server-side-encryption-customer-algorithm" {
obj.sse_customer_algorithm = try!(SSECustomerAlgorithmParser::parse_xml("x-amz-server-side-encryption-customer-algorithm", stack));
continue;
}
if current_name == "x-amz-request-charged" {
obj.request_charged = try!(RequestChargedParser::parse_xml("x-amz-request-charged", stack));
continue;
}
if current_name == "Bucket" {
obj.bucket = try!(BucketNameParser::parse_xml("Bucket", stack));
continue;
}
if current_name == "UploadId" {
obj.upload_id = try!(MultipartUploadIdParser::parse_xml("UploadId", stack));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
if current_name == "x-amz-server-side-encryption" {
obj.server_side_encryption = try!(ServerSideEncryptionParser::parse_xml("x-amz-server-side-encryption", stack));
continue;
}
if current_name == "x-amz-server-side-encryption-customer-key-MD5" {
obj.sse_customer_key_md5 = try!(SSECustomerKeyMD5Parser::parse_xml("x-amz-server-side-encryption-customer-key-MD5", stack));
continue;
}
if current_name == "x-amz-server-side-encryption-aws-kms-key-id" {
obj.ssekms_key_id = try!(SSEKMSKeyIdParser::parse_xml("x-amz-server-side-encryption-aws-kms-key-id", stack));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl MultipartUploadCreateOutputWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &MultipartUploadCreateOutput) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
SSECustomerAlgorithmWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-customer-algorithm"), &obj.sse_customer_algorithm);
RequestChargedWriter::write_params(params, &(prefix.to_string() + "x-amz-request-charged"), &obj.request_charged);
BucketNameWriter::write_params(params, &(prefix.to_string() + "Bucket"), &obj.bucket);
MultipartUploadIdWriter::write_params(params, &(prefix.to_string() + "UploadId"), &obj.upload_id);
ObjectKeyWriter::write_params(params, &(prefix.to_string() + "Key"), &obj.key);
ServerSideEncryptionWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption"), &obj.server_side_encryption);
SSECustomerKeyMD5Writer::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-customer-key-MD5"), &obj.sse_customer_key_md5);
SSEKMSKeyIdWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-aws-kms-key-id"), &obj.ssekms_key_id);
}
}
impl HeadObjectRequestParser {
fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<HeadObjectRequest, XmlParseError> {
try!(start_element(tag_name, stack));
let mut obj = HeadObjectRequest::default();
loop {
let current_name = try!(peek_at_name(stack));
if current_name == "x-amz-server-side-encryption-customer-algorithm" {
obj.sse_customer_algorithm = Some(try!(SSECustomerAlgorithmParser::parse_xml("x-amz-server-side-encryption-customer-algorithm", stack)));
continue;
}
if current_name == "x-amz-server-side-encryption-customer-key" {
obj.sse_customer_key = Some(try!(SSECustomerKeyParser::parse_xml("x-amz-server-side-encryption-customer-key", stack)));
continue;
}
if current_name == "If-Unmodified-Since" {
obj.if_unmodified_since = Some(try!(IfUnmodifiedSinceParser::parse_xml("If-Unmodified-Since", stack)));
continue;
}
if current_name == "versionId" {
obj.version_id = Some(try!(ObjectVersionIdParser::parse_xml("versionId", stack)));
continue;
}
if current_name == "x-amz-request-payer" {
obj.request_payer = Some(try!(RequestPayerParser::parse_xml("x-amz-request-payer", stack)));
continue;
}
if current_name == "Bucket" {
obj.bucket = try!(BucketNameParser::parse_xml("Bucket", stack));
continue;
}
if current_name == "If-None-Match" {
obj.if_none_match = Some(try!(IfNoneMatchParser::parse_xml("If-None-Match", stack)));
continue;
}
if current_name == "Range" {
obj.range = Some(try!(RangeParser::parse_xml("Range", stack)));
continue;
}
if current_name == "Key" {
obj.key = try!(ObjectKeyParser::parse_xml("Key", stack));
continue;
}
if current_name == "If-Match" {
obj.if_match = Some(try!(IfMatchParser::parse_xml("If-Match", stack)));
continue;
}
if current_name == "x-amz-server-side-encryption-customer-key-MD5" {
obj.sse_customer_key_md5 = Some(try!(SSECustomerKeyMD5Parser::parse_xml("x-amz-server-side-encryption-customer-key-MD5", stack)));
continue;
}
if current_name == "If-Modified-Since" {
obj.if_modified_since = Some(try!(IfModifiedSinceParser::parse_xml("If-Modified-Since", stack)));
continue;
}
break;
}
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl HeadObjectRequestWriter {
fn write_params(params: &mut Params, name: &str, obj: &HeadObjectRequest) {
let mut prefix = name.to_string();
if prefix != "" { prefix.push_str("."); }
if let Some(ref obj) = obj.sse_customer_algorithm {
SSECustomerAlgorithmWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-customer-algorithm"), obj);
}
if let Some(ref obj) = obj.sse_customer_key {
SSECustomerKeyWriter::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-customer-key"), obj);
}
if let Some(ref obj) = obj.if_unmodified_since {
IfUnmodifiedSinceWriter::write_params(params, &(prefix.to_string() + "If-Unmodified-Since"), obj);
}
if let Some(ref obj) = obj.version_id {
ObjectVersionIdWriter::write_params(params, &(prefix.to_string() + "versionId"), obj);
}
if let Some(ref obj) = obj.request_payer {
RequestPayerWriter::write_params(params, &(prefix.to_string() + "x-amz-request-payer"), obj);
}
BucketNameWriter::write_params(params, &(prefix.to_string() + "Bucket"), &obj.bucket);
if let Some(ref obj) = obj.if_none_match {
IfNoneMatchWriter::write_params(params, &(prefix.to_string() + "If-None-Match"), obj);
}
if let Some(ref obj) = obj.range {
RangeWriter::write_params(params, &(prefix.to_string() + "Range"), obj);
}
ObjectKeyWriter::write_params(params, &(prefix.to_string() + "Key"), &obj.key);
if let Some(ref obj) = obj.if_match {
IfMatchWriter::write_params(params, &(prefix.to_string() + "If-Match"), obj);
}
if let Some(ref obj) = obj.sse_customer_key_md5 {
SSECustomerKeyMD5Writer::write_params(params, &(prefix.to_string() + "x-amz-server-side-encryption-customer-key-MD5"), obj);
}
if let Some(ref obj) = obj.if_modified_since {
IfModifiedSinceWriter::write_params(params, &(prefix.to_string() + "If-Modified-Since"), obj);
}
}
}
impl PrefixParser {
pub fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<Prefix, XmlParseError> {
try!(start_element(tag_name, stack));
let obj = try!(characters(stack));
try!(end_element(tag_name, stack));
Ok(obj)
}
}
impl PrefixWriter {
pub fn write_params(params: &mut Params, name: &str, obj: &Prefix) {
params.put(name, obj);
}
}