initial commit

This commit is contained in:
root
2026-05-13 14:20:41 +00:00
commit 6e178d2012
6022 changed files with 399872 additions and 0 deletions
@@ -0,0 +1,25 @@
import { AwsRestXmlProtocol } from "@aws-sdk/core/protocols";
import { NormalizedSchema } from "@smithy/core/schema";
export class S3RestXmlProtocol extends AwsRestXmlProtocol {
async serializeRequest(operationSchema, input, context) {
const request = await super.serializeRequest(operationSchema, input, context);
const ns = NormalizedSchema.of(operationSchema.input);
const staticStructureSchema = ns.getSchema();
let bucketMemberIndex = 0;
const requiredMemberCount = staticStructureSchema[6] ?? 0;
if (input && typeof input === "object") {
for (const [memberName, memberNs] of ns.structIterator()) {
if (++bucketMemberIndex > requiredMemberCount) {
break;
}
if (memberName === "Bucket") {
if (!input.Bucket && memberNs.getMergedTraits().httpLabel) {
throw new Error(`No value provided for input HTTP label: Bucket.`);
}
break;
}
}
}
return request;
}
}