@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>
99 lines (86 loc) • 2.75 kB
text/typescript
/*
* 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 { Result as SafeParseResult } from "../types/fp.js";
import * as types from "../types/primitives.js";
import { SDKValidationError } from "./sdkvalidationerror.js";
export type CreateSpeedInsightsToggleRequestBody = {
value: boolean;
};
export type CreateSpeedInsightsToggleRequest = {
projectId: string;
requestBody?: CreateSpeedInsightsToggleRequestBody | undefined;
};
export type CreateSpeedInsightsToggleResponseBody = {
value: boolean;
};
/** @internal */
export type CreateSpeedInsightsToggleRequestBody$Outbound = {
value: boolean;
};
/** @internal */
export const CreateSpeedInsightsToggleRequestBody$outboundSchema: z.ZodType<
CreateSpeedInsightsToggleRequestBody$Outbound,
z.ZodTypeDef,
CreateSpeedInsightsToggleRequestBody
> = z.object({
value: z.boolean(),
});
export function createSpeedInsightsToggleRequestBodyToJSON(
createSpeedInsightsToggleRequestBody: CreateSpeedInsightsToggleRequestBody,
): string {
return JSON.stringify(
CreateSpeedInsightsToggleRequestBody$outboundSchema.parse(
createSpeedInsightsToggleRequestBody,
),
);
}
/** @internal */
export type CreateSpeedInsightsToggleRequest$Outbound = {
projectId: string;
RequestBody?: CreateSpeedInsightsToggleRequestBody$Outbound | undefined;
};
/** @internal */
export const CreateSpeedInsightsToggleRequest$outboundSchema: z.ZodType<
CreateSpeedInsightsToggleRequest$Outbound,
z.ZodTypeDef,
CreateSpeedInsightsToggleRequest
> = z.object({
projectId: z.string(),
requestBody: z.lazy(() => CreateSpeedInsightsToggleRequestBody$outboundSchema)
.optional(),
}).transform((v) => {
return remap$(v, {
requestBody: "RequestBody",
});
});
export function createSpeedInsightsToggleRequestToJSON(
createSpeedInsightsToggleRequest: CreateSpeedInsightsToggleRequest,
): string {
return JSON.stringify(
CreateSpeedInsightsToggleRequest$outboundSchema.parse(
createSpeedInsightsToggleRequest,
),
);
}
/** @internal */
export const CreateSpeedInsightsToggleResponseBody$inboundSchema: z.ZodType<
CreateSpeedInsightsToggleResponseBody,
z.ZodTypeDef,
unknown
> = z.object({
value: types.boolean(),
});
export function createSpeedInsightsToggleResponseBodyFromJSON(
jsonString: string,
): SafeParseResult<CreateSpeedInsightsToggleResponseBody, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
CreateSpeedInsightsToggleResponseBody$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'CreateSpeedInsightsToggleResponseBody' from JSON`,
);
}