@vercel/sdk
Version:
<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>
171 lines • 7.08 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { remap as remap$ } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
import * as types from "../types/primitives.js";
import { smartUnion } from "../types/smartUnion.js";
export const TestDrainDeliveryDrainsRequestEncoding = {
Json: "json",
Ndjson: "ndjson",
};
export const TestDrainDeliveryDrainsCompression = {
None: "none",
};
export const TestDrainDeliveryFileStructure = {
Hive: "hive",
};
export const TestDrainDeliveryServerSideEncryption = {
Aes256: "AES256",
AwsKms: "aws:kms",
AwsKmsDsse: "aws:kms:dsse",
};
export const TestDrainDeliveryObjectAcl = {
Private: "private",
BucketOwnerRead: "bucket-owner-read",
BucketOwnerFullControl: "bucket-owner-full-control",
};
export const TestDrainDeliveryDrainsEncoding = {
Proto: "proto",
Json: "json",
};
export const TestDrainDeliveryCompression = {
Gzip: "gzip",
None: "none",
};
export const TestDrainDeliveryEncoding = {
Json: "json",
Ndjson: "ndjson",
};
/** @internal */
export const TestDrainSchemas$outboundSchema = z.object({
version: z.string(),
});
export function testDrainSchemasToJSON(testDrainSchemas) {
return JSON.stringify(TestDrainSchemas$outboundSchema.parse(testDrainSchemas));
}
/** @internal */
export const TestDrainDeliveryDrainsRequestEncoding$outboundSchema = z.nativeEnum(TestDrainDeliveryDrainsRequestEncoding);
/** @internal */
export const TestDrainDeliveryDrainsCompression$outboundSchema = z.nativeEnum(TestDrainDeliveryDrainsCompression);
/** @internal */
export const TestDrainDeliveryFileStructure$outboundSchema = z.nativeEnum(TestDrainDeliveryFileStructure);
/** @internal */
export const TestDrainDeliveryServerSideEncryption$outboundSchema = z.nativeEnum(TestDrainDeliveryServerSideEncryption);
/** @internal */
export const TestDrainDeliveryObjectAcl$outboundSchema = z.nativeEnum(TestDrainDeliveryObjectAcl);
/** @internal */
export const TestDrainDelivery3$outboundSchema = z.object({
type: z.string(),
endpoint: z.string(),
encoding: TestDrainDeliveryDrainsRequestEncoding$outboundSchema,
compression: TestDrainDeliveryDrainsCompression$outboundSchema,
fileStructure: TestDrainDeliveryFileStructure$outboundSchema,
roleArn: z.string(),
region: z.string(),
serverSideEncryption: TestDrainDeliveryServerSideEncryption$outboundSchema
.default("AES256"),
objectAcl: TestDrainDeliveryObjectAcl$outboundSchema.optional(),
});
export function testDrainDelivery3ToJSON(testDrainDelivery3) {
return JSON.stringify(TestDrainDelivery3$outboundSchema.parse(testDrainDelivery3));
}
/** @internal */
export const TestDrainEndpoint1$outboundSchema = z.object({
traces: z.string(),
});
export function testDrainEndpoint1ToJSON(testDrainEndpoint1) {
return JSON.stringify(TestDrainEndpoint1$outboundSchema.parse(testDrainEndpoint1));
}
/** @internal */
export const TestDrainDeliveryEndpoint$outboundSchema = z.lazy(() => TestDrainEndpoint1$outboundSchema);
export function testDrainDeliveryEndpointToJSON(testDrainDeliveryEndpoint) {
return JSON.stringify(TestDrainDeliveryEndpoint$outboundSchema.parse(testDrainDeliveryEndpoint));
}
/** @internal */
export const TestDrainDeliveryDrainsEncoding$outboundSchema = z.nativeEnum(TestDrainDeliveryDrainsEncoding);
/** @internal */
export const TestDrainDelivery2$outboundSchema = z.object({
type: z.string(),
endpoint: z.lazy(() => TestDrainEndpoint1$outboundSchema),
encoding: TestDrainDeliveryDrainsEncoding$outboundSchema,
headers: z.record(z.string()),
secret: z.string().optional(),
});
export function testDrainDelivery2ToJSON(testDrainDelivery2) {
return JSON.stringify(TestDrainDelivery2$outboundSchema.parse(testDrainDelivery2));
}
/** @internal */
export const TestDrainDeliveryCompression$outboundSchema = z.nativeEnum(TestDrainDeliveryCompression);
/** @internal */
export const TestDrainDeliveryEncoding$outboundSchema = z.nativeEnum(TestDrainDeliveryEncoding);
/** @internal */
export const TestDrainDelivery1$outboundSchema = z.object({
type: z.string(),
endpoint: z.string(),
compression: TestDrainDeliveryCompression$outboundSchema.optional(),
encoding: TestDrainDeliveryEncoding$outboundSchema,
headers: z.record(z.string()),
secret: z.string().optional(),
});
export function testDrainDelivery1ToJSON(testDrainDelivery1) {
return JSON.stringify(TestDrainDelivery1$outboundSchema.parse(testDrainDelivery1));
}
/** @internal */
export const TestDrainDelivery$outboundSchema = smartUnion([
z.lazy(() => TestDrainDelivery3$outboundSchema),
z.lazy(() => TestDrainDelivery1$outboundSchema),
z.lazy(() => TestDrainDelivery2$outboundSchema),
]);
export function testDrainDeliveryToJSON(testDrainDelivery) {
return JSON.stringify(TestDrainDelivery$outboundSchema.parse(testDrainDelivery));
}
/** @internal */
export const TestDrainRequestBody$outboundSchema = z.object({
schemas: z.record(z.lazy(() => TestDrainSchemas$outboundSchema)),
delivery: smartUnion([
z.lazy(() => TestDrainDelivery3$outboundSchema),
z.lazy(() => TestDrainDelivery1$outboundSchema),
z.lazy(() => TestDrainDelivery2$outboundSchema),
]),
});
export function testDrainRequestBodyToJSON(testDrainRequestBody) {
return JSON.stringify(TestDrainRequestBody$outboundSchema.parse(testDrainRequestBody));
}
/** @internal */
export const TestDrainRequest$outboundSchema = z.object({
teamId: z.string().optional(),
slug: z.string().optional(),
requestBody: z.lazy(() => TestDrainRequestBody$outboundSchema).optional(),
}).transform((v) => {
return remap$(v, {
requestBody: "RequestBody",
});
});
export function testDrainRequestToJSON(testDrainRequest) {
return JSON.stringify(TestDrainRequest$outboundSchema.parse(testDrainRequest));
}
/** @internal */
export const TestDrainResponseBody2$inboundSchema = z.object({
status: types.string(),
error: types.string(),
endpoint: types.string(),
});
export function testDrainResponseBody2FromJSON(jsonString) {
return safeParse(jsonString, (x) => TestDrainResponseBody2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TestDrainResponseBody2' from JSON`);
}
/** @internal */
export const TestDrainResponseBody1$inboundSchema = z.object({});
export function testDrainResponseBody1FromJSON(jsonString) {
return safeParse(jsonString, (x) => TestDrainResponseBody1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TestDrainResponseBody1' from JSON`);
}
/** @internal */
export const TestDrainResponseBody$inboundSchema = smartUnion([
z.lazy(() => TestDrainResponseBody2$inboundSchema),
z.lazy(() => TestDrainResponseBody1$inboundSchema),
]);
export function testDrainResponseBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => TestDrainResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TestDrainResponseBody' from JSON`);
}
//# sourceMappingURL=testdrainop.js.map