@aws-sdk/client-s3
Version:
AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native
888 lines (887 loc) • 442 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeAws_restXmlGetObjectTorrentCommand = exports.serializeAws_restXmlGetObjectTaggingCommand = exports.serializeAws_restXmlGetObjectRetentionCommand = exports.serializeAws_restXmlGetObjectLockConfigurationCommand = exports.serializeAws_restXmlGetObjectLegalHoldCommand = exports.serializeAws_restXmlGetObjectAttributesCommand = exports.serializeAws_restXmlGetObjectAclCommand = exports.serializeAws_restXmlGetObjectCommand = exports.serializeAws_restXmlGetBucketWebsiteCommand = exports.serializeAws_restXmlGetBucketVersioningCommand = exports.serializeAws_restXmlGetBucketTaggingCommand = exports.serializeAws_restXmlGetBucketRequestPaymentCommand = exports.serializeAws_restXmlGetBucketReplicationCommand = exports.serializeAws_restXmlGetBucketPolicyStatusCommand = exports.serializeAws_restXmlGetBucketPolicyCommand = exports.serializeAws_restXmlGetBucketOwnershipControlsCommand = exports.serializeAws_restXmlGetBucketNotificationConfigurationCommand = exports.serializeAws_restXmlGetBucketMetricsConfigurationCommand = exports.serializeAws_restXmlGetBucketLoggingCommand = exports.serializeAws_restXmlGetBucketLocationCommand = exports.serializeAws_restXmlGetBucketLifecycleConfigurationCommand = exports.serializeAws_restXmlGetBucketInventoryConfigurationCommand = exports.serializeAws_restXmlGetBucketIntelligentTieringConfigurationCommand = exports.serializeAws_restXmlGetBucketEncryptionCommand = exports.serializeAws_restXmlGetBucketCorsCommand = exports.serializeAws_restXmlGetBucketAnalyticsConfigurationCommand = exports.serializeAws_restXmlGetBucketAclCommand = exports.serializeAws_restXmlGetBucketAccelerateConfigurationCommand = exports.serializeAws_restXmlDeletePublicAccessBlockCommand = exports.serializeAws_restXmlDeleteObjectTaggingCommand = exports.serializeAws_restXmlDeleteObjectsCommand = exports.serializeAws_restXmlDeleteObjectCommand = exports.serializeAws_restXmlDeleteBucketWebsiteCommand = exports.serializeAws_restXmlDeleteBucketTaggingCommand = exports.serializeAws_restXmlDeleteBucketReplicationCommand = exports.serializeAws_restXmlDeleteBucketPolicyCommand = exports.serializeAws_restXmlDeleteBucketOwnershipControlsCommand = exports.serializeAws_restXmlDeleteBucketMetricsConfigurationCommand = exports.serializeAws_restXmlDeleteBucketLifecycleCommand = exports.serializeAws_restXmlDeleteBucketInventoryConfigurationCommand = exports.serializeAws_restXmlDeleteBucketIntelligentTieringConfigurationCommand = exports.serializeAws_restXmlDeleteBucketEncryptionCommand = exports.serializeAws_restXmlDeleteBucketCorsCommand = exports.serializeAws_restXmlDeleteBucketAnalyticsConfigurationCommand = exports.serializeAws_restXmlDeleteBucketCommand = exports.serializeAws_restXmlCreateMultipartUploadCommand = exports.serializeAws_restXmlCreateBucketCommand = exports.serializeAws_restXmlCopyObjectCommand = exports.serializeAws_restXmlCompleteMultipartUploadCommand = exports.serializeAws_restXmlAbortMultipartUploadCommand = void 0;
exports.deserializeAws_restXmlDeleteBucketAnalyticsConfigurationCommand = exports.deserializeAws_restXmlDeleteBucketCommand = exports.deserializeAws_restXmlCreateMultipartUploadCommand = exports.deserializeAws_restXmlCreateBucketCommand = exports.deserializeAws_restXmlCopyObjectCommand = exports.deserializeAws_restXmlCompleteMultipartUploadCommand = exports.deserializeAws_restXmlAbortMultipartUploadCommand = exports.serializeAws_restXmlWriteGetObjectResponseCommand = exports.serializeAws_restXmlUploadPartCopyCommand = exports.serializeAws_restXmlUploadPartCommand = exports.serializeAws_restXmlSelectObjectContentCommand = exports.serializeAws_restXmlRestoreObjectCommand = exports.serializeAws_restXmlPutPublicAccessBlockCommand = exports.serializeAws_restXmlPutObjectTaggingCommand = exports.serializeAws_restXmlPutObjectRetentionCommand = exports.serializeAws_restXmlPutObjectLockConfigurationCommand = exports.serializeAws_restXmlPutObjectLegalHoldCommand = exports.serializeAws_restXmlPutObjectAclCommand = exports.serializeAws_restXmlPutObjectCommand = exports.serializeAws_restXmlPutBucketWebsiteCommand = exports.serializeAws_restXmlPutBucketVersioningCommand = exports.serializeAws_restXmlPutBucketTaggingCommand = exports.serializeAws_restXmlPutBucketRequestPaymentCommand = exports.serializeAws_restXmlPutBucketReplicationCommand = exports.serializeAws_restXmlPutBucketPolicyCommand = exports.serializeAws_restXmlPutBucketOwnershipControlsCommand = exports.serializeAws_restXmlPutBucketNotificationConfigurationCommand = exports.serializeAws_restXmlPutBucketMetricsConfigurationCommand = exports.serializeAws_restXmlPutBucketLoggingCommand = exports.serializeAws_restXmlPutBucketLifecycleConfigurationCommand = exports.serializeAws_restXmlPutBucketInventoryConfigurationCommand = exports.serializeAws_restXmlPutBucketIntelligentTieringConfigurationCommand = exports.serializeAws_restXmlPutBucketEncryptionCommand = exports.serializeAws_restXmlPutBucketCorsCommand = exports.serializeAws_restXmlPutBucketAnalyticsConfigurationCommand = exports.serializeAws_restXmlPutBucketAclCommand = exports.serializeAws_restXmlPutBucketAccelerateConfigurationCommand = exports.serializeAws_restXmlListPartsCommand = exports.serializeAws_restXmlListObjectVersionsCommand = exports.serializeAws_restXmlListObjectsV2Command = exports.serializeAws_restXmlListObjectsCommand = exports.serializeAws_restXmlListMultipartUploadsCommand = exports.serializeAws_restXmlListBucketsCommand = exports.serializeAws_restXmlListBucketMetricsConfigurationsCommand = exports.serializeAws_restXmlListBucketInventoryConfigurationsCommand = exports.serializeAws_restXmlListBucketIntelligentTieringConfigurationsCommand = exports.serializeAws_restXmlListBucketAnalyticsConfigurationsCommand = exports.serializeAws_restXmlHeadObjectCommand = exports.serializeAws_restXmlHeadBucketCommand = exports.serializeAws_restXmlGetPublicAccessBlockCommand = void 0;
exports.deserializeAws_restXmlListBucketMetricsConfigurationsCommand = exports.deserializeAws_restXmlListBucketInventoryConfigurationsCommand = exports.deserializeAws_restXmlListBucketIntelligentTieringConfigurationsCommand = exports.deserializeAws_restXmlListBucketAnalyticsConfigurationsCommand = exports.deserializeAws_restXmlHeadObjectCommand = exports.deserializeAws_restXmlHeadBucketCommand = exports.deserializeAws_restXmlGetPublicAccessBlockCommand = exports.deserializeAws_restXmlGetObjectTorrentCommand = exports.deserializeAws_restXmlGetObjectTaggingCommand = exports.deserializeAws_restXmlGetObjectRetentionCommand = exports.deserializeAws_restXmlGetObjectLockConfigurationCommand = exports.deserializeAws_restXmlGetObjectLegalHoldCommand = exports.deserializeAws_restXmlGetObjectAttributesCommand = exports.deserializeAws_restXmlGetObjectAclCommand = exports.deserializeAws_restXmlGetObjectCommand = exports.deserializeAws_restXmlGetBucketWebsiteCommand = exports.deserializeAws_restXmlGetBucketVersioningCommand = exports.deserializeAws_restXmlGetBucketTaggingCommand = exports.deserializeAws_restXmlGetBucketRequestPaymentCommand = exports.deserializeAws_restXmlGetBucketReplicationCommand = exports.deserializeAws_restXmlGetBucketPolicyStatusCommand = exports.deserializeAws_restXmlGetBucketPolicyCommand = exports.deserializeAws_restXmlGetBucketOwnershipControlsCommand = exports.deserializeAws_restXmlGetBucketNotificationConfigurationCommand = exports.deserializeAws_restXmlGetBucketMetricsConfigurationCommand = exports.deserializeAws_restXmlGetBucketLoggingCommand = exports.deserializeAws_restXmlGetBucketLocationCommand = exports.deserializeAws_restXmlGetBucketLifecycleConfigurationCommand = exports.deserializeAws_restXmlGetBucketInventoryConfigurationCommand = exports.deserializeAws_restXmlGetBucketIntelligentTieringConfigurationCommand = exports.deserializeAws_restXmlGetBucketEncryptionCommand = exports.deserializeAws_restXmlGetBucketCorsCommand = exports.deserializeAws_restXmlGetBucketAnalyticsConfigurationCommand = exports.deserializeAws_restXmlGetBucketAclCommand = exports.deserializeAws_restXmlGetBucketAccelerateConfigurationCommand = exports.deserializeAws_restXmlDeletePublicAccessBlockCommand = exports.deserializeAws_restXmlDeleteObjectTaggingCommand = exports.deserializeAws_restXmlDeleteObjectsCommand = exports.deserializeAws_restXmlDeleteObjectCommand = exports.deserializeAws_restXmlDeleteBucketWebsiteCommand = exports.deserializeAws_restXmlDeleteBucketTaggingCommand = exports.deserializeAws_restXmlDeleteBucketReplicationCommand = exports.deserializeAws_restXmlDeleteBucketPolicyCommand = exports.deserializeAws_restXmlDeleteBucketOwnershipControlsCommand = exports.deserializeAws_restXmlDeleteBucketMetricsConfigurationCommand = exports.deserializeAws_restXmlDeleteBucketLifecycleCommand = exports.deserializeAws_restXmlDeleteBucketInventoryConfigurationCommand = exports.deserializeAws_restXmlDeleteBucketIntelligentTieringConfigurationCommand = exports.deserializeAws_restXmlDeleteBucketEncryptionCommand = exports.deserializeAws_restXmlDeleteBucketCorsCommand = void 0;
exports.deserializeAws_restXmlWriteGetObjectResponseCommand = exports.deserializeAws_restXmlUploadPartCopyCommand = exports.deserializeAws_restXmlUploadPartCommand = exports.deserializeAws_restXmlSelectObjectContentCommand = exports.deserializeAws_restXmlRestoreObjectCommand = exports.deserializeAws_restXmlPutPublicAccessBlockCommand = exports.deserializeAws_restXmlPutObjectTaggingCommand = exports.deserializeAws_restXmlPutObjectRetentionCommand = exports.deserializeAws_restXmlPutObjectLockConfigurationCommand = exports.deserializeAws_restXmlPutObjectLegalHoldCommand = exports.deserializeAws_restXmlPutObjectAclCommand = exports.deserializeAws_restXmlPutObjectCommand = exports.deserializeAws_restXmlPutBucketWebsiteCommand = exports.deserializeAws_restXmlPutBucketVersioningCommand = exports.deserializeAws_restXmlPutBucketTaggingCommand = exports.deserializeAws_restXmlPutBucketRequestPaymentCommand = exports.deserializeAws_restXmlPutBucketReplicationCommand = exports.deserializeAws_restXmlPutBucketPolicyCommand = exports.deserializeAws_restXmlPutBucketOwnershipControlsCommand = exports.deserializeAws_restXmlPutBucketNotificationConfigurationCommand = exports.deserializeAws_restXmlPutBucketMetricsConfigurationCommand = exports.deserializeAws_restXmlPutBucketLoggingCommand = exports.deserializeAws_restXmlPutBucketLifecycleConfigurationCommand = exports.deserializeAws_restXmlPutBucketInventoryConfigurationCommand = exports.deserializeAws_restXmlPutBucketIntelligentTieringConfigurationCommand = exports.deserializeAws_restXmlPutBucketEncryptionCommand = exports.deserializeAws_restXmlPutBucketCorsCommand = exports.deserializeAws_restXmlPutBucketAnalyticsConfigurationCommand = exports.deserializeAws_restXmlPutBucketAclCommand = exports.deserializeAws_restXmlPutBucketAccelerateConfigurationCommand = exports.deserializeAws_restXmlListPartsCommand = exports.deserializeAws_restXmlListObjectVersionsCommand = exports.deserializeAws_restXmlListObjectsV2Command = exports.deserializeAws_restXmlListObjectsCommand = exports.deserializeAws_restXmlListMultipartUploadsCommand = exports.deserializeAws_restXmlListBucketsCommand = void 0;
const protocol_http_1 = require("@aws-sdk/protocol-http");
const smithy_client_1 = require("@aws-sdk/smithy-client");
const xml_builder_1 = require("@aws-sdk/xml-builder");
const fast_xml_parser_1 = require("fast-xml-parser");
const models_0_1 = require("../models/models_0");
const models_1_1 = require("../models/models_1");
const S3ServiceException_1 = require("../models/S3ServiceException");
const serializeAws_restXmlAbortMultipartUploadCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-request-payer": input.RequestPayer,
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/{Key+}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Key", () => input.Key, "{Key+}", true);
const query = map({
"x-id": [, "AbortMultipartUpload"],
uploadId: [, input.UploadId],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlAbortMultipartUploadCommand = serializeAws_restXmlAbortMultipartUploadCommand;
const serializeAws_restXmlCompleteMultipartUploadCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"content-type": "application/xml",
"x-amz-checksum-crc32": input.ChecksumCRC32,
"x-amz-checksum-crc32c": input.ChecksumCRC32C,
"x-amz-checksum-sha1": input.ChecksumSHA1,
"x-amz-checksum-sha256": input.ChecksumSHA256,
"x-amz-request-payer": input.RequestPayer,
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
"x-amz-server-side-encryption-customer-algorithm": input.SSECustomerAlgorithm,
"x-amz-server-side-encryption-customer-key": input.SSECustomerKey,
"x-amz-server-side-encryption-customer-key-md5": input.SSECustomerKeyMD5,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/{Key+}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Key", () => input.Key, "{Key+}", true);
const query = map({
"x-id": [, "CompleteMultipartUpload"],
uploadId: [, input.UploadId],
});
let body;
if (input.MultipartUpload !== undefined) {
body = serializeAws_restXmlCompletedMultipartUpload(input.MultipartUpload, context);
}
let contents;
if (input.MultipartUpload !== undefined) {
contents = serializeAws_restXmlCompletedMultipartUpload(input.MultipartUpload, context);
contents = contents.withName("CompleteMultipartUpload");
body = '<?xml version="1.0" encoding="UTF-8"?>';
contents.addAttribute("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
body += contents.toString();
}
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlCompleteMultipartUploadCommand = serializeAws_restXmlCompleteMultipartUploadCommand;
const serializeAws_restXmlCopyObjectCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-acl": input.ACL,
"cache-control": input.CacheControl,
"x-amz-checksum-algorithm": input.ChecksumAlgorithm,
"content-disposition": input.ContentDisposition,
"content-encoding": input.ContentEncoding,
"content-language": input.ContentLanguage,
"content-type": input.ContentType,
"x-amz-copy-source": input.CopySource,
"x-amz-copy-source-if-match": input.CopySourceIfMatch,
"x-amz-copy-source-if-modified-since": [
() => isSerializableHeaderValue(input.CopySourceIfModifiedSince),
() => (0, smithy_client_1.dateToUtcString)(input.CopySourceIfModifiedSince).toString(),
],
"x-amz-copy-source-if-none-match": input.CopySourceIfNoneMatch,
"x-amz-copy-source-if-unmodified-since": [
() => isSerializableHeaderValue(input.CopySourceIfUnmodifiedSince),
() => (0, smithy_client_1.dateToUtcString)(input.CopySourceIfUnmodifiedSince).toString(),
],
expires: [() => isSerializableHeaderValue(input.Expires), () => (0, smithy_client_1.dateToUtcString)(input.Expires).toString()],
"x-amz-grant-full-control": input.GrantFullControl,
"x-amz-grant-read": input.GrantRead,
"x-amz-grant-read-acp": input.GrantReadACP,
"x-amz-grant-write-acp": input.GrantWriteACP,
"x-amz-metadata-directive": input.MetadataDirective,
"x-amz-tagging-directive": input.TaggingDirective,
"x-amz-server-side-encryption": input.ServerSideEncryption,
"x-amz-storage-class": input.StorageClass,
"x-amz-website-redirect-location": input.WebsiteRedirectLocation,
"x-amz-server-side-encryption-customer-algorithm": input.SSECustomerAlgorithm,
"x-amz-server-side-encryption-customer-key": input.SSECustomerKey,
"x-amz-server-side-encryption-customer-key-md5": input.SSECustomerKeyMD5,
"x-amz-server-side-encryption-aws-kms-key-id": input.SSEKMSKeyId,
"x-amz-server-side-encryption-context": input.SSEKMSEncryptionContext,
"x-amz-server-side-encryption-bucket-key-enabled": [
() => isSerializableHeaderValue(input.BucketKeyEnabled),
() => input.BucketKeyEnabled.toString(),
],
"x-amz-copy-source-server-side-encryption-customer-algorithm": input.CopySourceSSECustomerAlgorithm,
"x-amz-copy-source-server-side-encryption-customer-key": input.CopySourceSSECustomerKey,
"x-amz-copy-source-server-side-encryption-customer-key-md5": input.CopySourceSSECustomerKeyMD5,
"x-amz-request-payer": input.RequestPayer,
"x-amz-tagging": input.Tagging,
"x-amz-object-lock-mode": input.ObjectLockMode,
"x-amz-object-lock-retain-until-date": [
() => isSerializableHeaderValue(input.ObjectLockRetainUntilDate),
() => (input.ObjectLockRetainUntilDate.toISOString().split(".")[0] + "Z").toString(),
],
"x-amz-object-lock-legal-hold": input.ObjectLockLegalHoldStatus,
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
"x-amz-source-expected-bucket-owner": input.ExpectedSourceBucketOwner,
...(input.Metadata !== undefined &&
Object.keys(input.Metadata).reduce((acc, suffix) => {
acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix];
return acc;
}, {})),
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/{Key+}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Key", () => input.Key, "{Key+}", true);
const query = map({
"x-id": [, "CopyObject"],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "PUT",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlCopyObjectCommand = serializeAws_restXmlCopyObjectCommand;
const serializeAws_restXmlCreateBucketCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"content-type": "application/xml",
"x-amz-acl": input.ACL,
"x-amz-grant-full-control": input.GrantFullControl,
"x-amz-grant-read": input.GrantRead,
"x-amz-grant-read-acp": input.GrantReadACP,
"x-amz-grant-write": input.GrantWrite,
"x-amz-grant-write-acp": input.GrantWriteACP,
"x-amz-bucket-object-lock-enabled": [
() => isSerializableHeaderValue(input.ObjectLockEnabledForBucket),
() => input.ObjectLockEnabledForBucket.toString(),
],
"x-amz-object-ownership": input.ObjectOwnership,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
let body;
if (input.CreateBucketConfiguration !== undefined) {
body = serializeAws_restXmlCreateBucketConfiguration(input.CreateBucketConfiguration, context);
}
let contents;
if (input.CreateBucketConfiguration !== undefined) {
contents = serializeAws_restXmlCreateBucketConfiguration(input.CreateBucketConfiguration, context);
body = '<?xml version="1.0" encoding="UTF-8"?>';
contents.addAttribute("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
body += contents.toString();
}
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "PUT",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restXmlCreateBucketCommand = serializeAws_restXmlCreateBucketCommand;
const serializeAws_restXmlCreateMultipartUploadCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-acl": input.ACL,
"cache-control": input.CacheControl,
"content-disposition": input.ContentDisposition,
"content-encoding": input.ContentEncoding,
"content-language": input.ContentLanguage,
"content-type": input.ContentType,
expires: [() => isSerializableHeaderValue(input.Expires), () => (0, smithy_client_1.dateToUtcString)(input.Expires).toString()],
"x-amz-grant-full-control": input.GrantFullControl,
"x-amz-grant-read": input.GrantRead,
"x-amz-grant-read-acp": input.GrantReadACP,
"x-amz-grant-write-acp": input.GrantWriteACP,
"x-amz-server-side-encryption": input.ServerSideEncryption,
"x-amz-storage-class": input.StorageClass,
"x-amz-website-redirect-location": input.WebsiteRedirectLocation,
"x-amz-server-side-encryption-customer-algorithm": input.SSECustomerAlgorithm,
"x-amz-server-side-encryption-customer-key": input.SSECustomerKey,
"x-amz-server-side-encryption-customer-key-md5": input.SSECustomerKeyMD5,
"x-amz-server-side-encryption-aws-kms-key-id": input.SSEKMSKeyId,
"x-amz-server-side-encryption-context": input.SSEKMSEncryptionContext,
"x-amz-server-side-encryption-bucket-key-enabled": [
() => isSerializableHeaderValue(input.BucketKeyEnabled),
() => input.BucketKeyEnabled.toString(),
],
"x-amz-request-payer": input.RequestPayer,
"x-amz-tagging": input.Tagging,
"x-amz-object-lock-mode": input.ObjectLockMode,
"x-amz-object-lock-retain-until-date": [
() => isSerializableHeaderValue(input.ObjectLockRetainUntilDate),
() => (input.ObjectLockRetainUntilDate.toISOString().split(".")[0] + "Z").toString(),
],
"x-amz-object-lock-legal-hold": input.ObjectLockLegalHoldStatus,
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
"x-amz-checksum-algorithm": input.ChecksumAlgorithm,
...(input.Metadata !== undefined &&
Object.keys(input.Metadata).reduce((acc, suffix) => {
acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix];
return acc;
}, {})),
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/{Key+}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Key", () => input.Key, "{Key+}", true);
const query = map({
uploads: [, ""],
"x-id": [, "CreateMultipartUpload"],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlCreateMultipartUploadCommand = serializeAws_restXmlCreateMultipartUploadCommand;
const serializeAws_restXmlDeleteBucketCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restXmlDeleteBucketCommand = serializeAws_restXmlDeleteBucketCommand;
const serializeAws_restXmlDeleteBucketAnalyticsConfigurationCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
analytics: [, ""],
id: [, input.Id],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlDeleteBucketAnalyticsConfigurationCommand = serializeAws_restXmlDeleteBucketAnalyticsConfigurationCommand;
const serializeAws_restXmlDeleteBucketCorsCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
cors: [, ""],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlDeleteBucketCorsCommand = serializeAws_restXmlDeleteBucketCorsCommand;
const serializeAws_restXmlDeleteBucketEncryptionCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
encryption: [, ""],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlDeleteBucketEncryptionCommand = serializeAws_restXmlDeleteBucketEncryptionCommand;
const serializeAws_restXmlDeleteBucketIntelligentTieringConfigurationCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
"intelligent-tiering": [, ""],
id: [, input.Id],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlDeleteBucketIntelligentTieringConfigurationCommand = serializeAws_restXmlDeleteBucketIntelligentTieringConfigurationCommand;
const serializeAws_restXmlDeleteBucketInventoryConfigurationCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
inventory: [, ""],
id: [, input.Id],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlDeleteBucketInventoryConfigurationCommand = serializeAws_restXmlDeleteBucketInventoryConfigurationCommand;
const serializeAws_restXmlDeleteBucketLifecycleCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
lifecycle: [, ""],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlDeleteBucketLifecycleCommand = serializeAws_restXmlDeleteBucketLifecycleCommand;
const serializeAws_restXmlDeleteBucketMetricsConfigurationCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
metrics: [, ""],
id: [, input.Id],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlDeleteBucketMetricsConfigurationCommand = serializeAws_restXmlDeleteBucketMetricsConfigurationCommand;
const serializeAws_restXmlDeleteBucketOwnershipControlsCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
ownershipControls: [, ""],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlDeleteBucketOwnershipControlsCommand = serializeAws_restXmlDeleteBucketOwnershipControlsCommand;
const serializeAws_restXmlDeleteBucketPolicyCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
policy: [, ""],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlDeleteBucketPolicyCommand = serializeAws_restXmlDeleteBucketPolicyCommand;
const serializeAws_restXmlDeleteBucketReplicationCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
replication: [, ""],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlDeleteBucketReplicationCommand = serializeAws_restXmlDeleteBucketReplicationCommand;
const serializeAws_restXmlDeleteBucketTaggingCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
tagging: [, ""],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlDeleteBucketTaggingCommand = serializeAws_restXmlDeleteBucketTaggingCommand;
const serializeAws_restXmlDeleteBucketWebsiteCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
website: [, ""],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlDeleteBucketWebsiteCommand = serializeAws_restXmlDeleteBucketWebsiteCommand;
const serializeAws_restXmlDeleteObjectCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-mfa": input.MFA,
"x-amz-request-payer": input.RequestPayer,
"x-amz-bypass-governance-retention": [
() => isSerializableHeaderValue(input.BypassGovernanceRetention),
() => input.BypassGovernanceRetention.toString(),
],
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/{Key+}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Key", () => input.Key, "{Key+}", true);
const query = map({
"x-id": [, "DeleteObject"],
versionId: [, input.VersionId],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlDeleteObjectCommand = serializeAws_restXmlDeleteObjectCommand;
const serializeAws_restXmlDeleteObjectsCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"content-type": "application/xml",
"x-amz-mfa": input.MFA,
"x-amz-request-payer": input.RequestPayer,
"x-amz-bypass-governance-retention": [
() => isSerializableHeaderValue(input.BypassGovernanceRetention),
() => input.BypassGovernanceRetention.toString(),
],
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
"x-amz-sdk-checksum-algorithm": input.ChecksumAlgorithm,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
delete: [, ""],
"x-id": [, "DeleteObjects"],
});
let body;
if (input.Delete !== undefined) {
body = serializeAws_restXmlDelete(input.Delete, context);
}
let contents;
if (input.Delete !== undefined) {
contents = serializeAws_restXmlDelete(input.Delete, context);
body = '<?xml version="1.0" encoding="UTF-8"?>';
contents.addAttribute("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
body += contents.toString();
}
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlDeleteObjectsCommand = serializeAws_restXmlDeleteObjectsCommand;
const serializeAws_restXmlDeleteObjectTaggingCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/{Key+}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Key", () => input.Key, "{Key+}", true);
const query = map({
tagging: [, ""],
versionId: [, input.VersionId],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlDeleteObjectTaggingCommand = serializeAws_restXmlDeleteObjectTaggingCommand;
const serializeAws_restXmlDeletePublicAccessBlockCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
publicAccessBlock: [, ""],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlDeletePublicAccessBlockCommand = serializeAws_restXmlDeletePublicAccessBlockCommand;
const serializeAws_restXmlGetBucketAccelerateConfigurationCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
accelerate: [, ""],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlGetBucketAccelerateConfigurationCommand = serializeAws_restXmlGetBucketAccelerateConfigurationCommand;
const serializeAws_restXmlGetBucketAclCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
acl: [, ""],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlGetBucketAclCommand = serializeAws_restXmlGetBucketAclCommand;
const serializeAws_restXmlGetBucketAnalyticsConfigurationCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
analytics: [, ""],
"x-id": [, "GetBucketAnalyticsConfiguration"],
id: [, input.Id],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlGetBucketAnalyticsConfigurationCommand = serializeAws_restXmlGetBucketAnalyticsConfigurationCommand;
const serializeAws_restXmlGetBucketCorsCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
cors: [, ""],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlGetBucketCorsCommand = serializeAws_restXmlGetBucketCorsCommand;
const serializeAws_restXmlGetBucketEncryptionCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
encryption: [, ""],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlGetBucketEncryptionCommand = serializeAws_restXmlGetBucketEncryptionCommand;
const serializeAws_restXmlGetBucketIntelligentTieringConfigurationCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
"intelligent-tiering": [, ""],
"x-id": [, "GetBucketIntelligentTieringConfiguration"],
id: [, input.Id],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlGetBucketIntelligentTieringConfigurationCommand = serializeAws_restXmlGetBucketIntelligentTieringConfigurationCommand;
const serializeAws_restXmlGetBucketInventoryConfigurationCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
inventory: [, ""],
"x-id": [, "GetBucketInventoryConfiguration"],
id: [, input.Id],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlGetBucketInventoryConfigurationCommand = serializeAws_restXmlGetBucketInventoryConfigurationCommand;
const serializeAws_restXmlGetBucketLifecycleConfigurationCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
lifecycle: [, ""],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restXmlGetBucketLifecycleConfigurationCommand = serializeAws_restXmlGetBucketLifecycleConfigurationCommand;
const serializeAws_restXmlGetBucketLocationCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-expected-bucket-owner": input.ExpectedBucketOwner,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Bucket", () => input.Bucket, "{Bucket}", false);
const query = map({
location: [, ""],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,