/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 3139ae7c2318 */ import * as z from "zod/v4"; import { Scope, Scope$Outbound, Scope$outboundSchema } from "./scope.js"; /** * Request schema for creating a new API key */ export type CreateAPIKeyRequest = { description: string | null; /** * Scope and role configuration for service accounts */ scope: Scope; /** * Optional expiration date for the API key */ expiresAt: Date | null; }; /** @internal */ export type CreateAPIKeyRequest$Outbound = { description: string | null; scope: Scope$Outbound; expiresAt: string | null; }; /** @internal */ export const CreateAPIKeyRequest$outboundSchema: z.ZodType< CreateAPIKeyRequest$Outbound, CreateAPIKeyRequest > = z.object({ description: z.nullable(z.string()), scope: Scope$outboundSchema, expiresAt: z.nullable(z.date().transform(v => v.toISOString())), }); export function createAPIKeyRequestToJSON( createAPIKeyRequest: CreateAPIKeyRequest, ): string { return JSON.stringify( CreateAPIKeyRequest$outboundSchema.parse(createAPIKeyRequest), ); }