@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>
110 lines • 4.61 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { safeParse } from "../lib/schemas.js";
import * as types from "../types/primitives.js";
/**
* The delivery log format
*/
export const GetIntegrationLogDrainsDeliveryFormat = {
Json: "json",
Ndjson: "ndjson",
Protobuf: "protobuf",
};
/**
* The sources from which logs are currently being delivered to this log drain.
*/
export const GetIntegrationLogDrainsSources = {
Build: "build",
Edge: "edge",
External: "external",
Firewall: "firewall",
Lambda: "lambda",
Redirect: "redirect",
Static: "static",
};
/**
* Whether the log drain was created by an integration or by a user
*/
export const CreatedFrom = {
Integration: "integration",
SelfServed: "self-served",
};
/**
* The environment of log drain
*/
export const GetIntegrationLogDrainsEnvironments = {
Preview: "preview",
Production: "production",
};
/** @internal */
export const GetIntegrationLogDrainsRequest$outboundSchema = z.object({
teamId: z.string().optional(),
slug: z.string().optional(),
});
export function getIntegrationLogDrainsRequestToJSON(getIntegrationLogDrainsRequest) {
return JSON.stringify(GetIntegrationLogDrainsRequest$outboundSchema.parse(getIntegrationLogDrainsRequest));
}
/** @internal */
export const GetIntegrationLogDrainsDeliveryFormat$inboundSchema = z.nativeEnum(GetIntegrationLogDrainsDeliveryFormat);
/** @internal */
export const GetIntegrationLogDrainsSources$inboundSchema = z.nativeEnum(GetIntegrationLogDrainsSources);
/** @internal */
export const CreatedFrom$inboundSchema = z
.nativeEnum(CreatedFrom);
/** @internal */
export const GetIntegrationLogDrainsEnvironments$inboundSchema = z.nativeEnum(GetIntegrationLogDrainsEnvironments);
/** @internal */
export const GetIntegrationLogDrainsSource2$inboundSchema = z.object({
kind: types.literal("integration"),
resourceId: types.optional(types.string()),
externalResourceId: types.optional(types.string()),
integrationId: types.string(),
integrationConfigurationId: types.string(),
});
export function getIntegrationLogDrainsSource2FromJSON(jsonString) {
return safeParse(jsonString, (x) => GetIntegrationLogDrainsSource2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetIntegrationLogDrainsSource2' from JSON`);
}
/** @internal */
export const GetIntegrationLogDrainsSource1$inboundSchema = z.object({
kind: types.literal("self-served"),
});
export function getIntegrationLogDrainsSource1FromJSON(jsonString) {
return safeParse(jsonString, (x) => GetIntegrationLogDrainsSource1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetIntegrationLogDrainsSource1' from JSON`);
}
/** @internal */
export const GetIntegrationLogDrainsSource$inboundSchema = z.union([
z.lazy(() => GetIntegrationLogDrainsSource1$inboundSchema),
z.lazy(() => GetIntegrationLogDrainsSource2$inboundSchema),
]);
export function getIntegrationLogDrainsSourceFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetIntegrationLogDrainsSource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetIntegrationLogDrainsSource' from JSON`);
}
/** @internal */
export const GetIntegrationLogDrainsResponseBody$inboundSchema = z.object({
clientId: types.optional(types.string()),
configurationId: types.optional(types.string()),
createdAt: types.number(),
id: types.string(),
deliveryFormat: types.optional(GetIntegrationLogDrainsDeliveryFormat$inboundSchema),
name: types.string(),
ownerId: types.string(),
projectId: z.nullable(types.string()).optional(),
projectIds: types.optional(z.array(types.string())),
url: types.string(),
sources: types.optional(z.array(GetIntegrationLogDrainsSources$inboundSchema)),
createdFrom: types.optional(CreatedFrom$inboundSchema),
headers: types.optional(z.record(types.string())),
environments: types.optional(z.array(GetIntegrationLogDrainsEnvironments$inboundSchema)),
branch: types.optional(types.string()),
samplingRate: types.optional(types.number()),
source: z.union([
z.lazy(() => GetIntegrationLogDrainsSource1$inboundSchema),
z.lazy(() => GetIntegrationLogDrainsSource2$inboundSchema),
]),
});
export function getIntegrationLogDrainsResponseBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetIntegrationLogDrainsResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetIntegrationLogDrainsResponseBody' from JSON`);
}
//# sourceMappingURL=getintegrationlogdrainsop.js.map