/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { SecretType, SecretType$outboundSchema } from "./secret-type.js"; export type CreateAPIKeyRequest = { expiresAt?: Date | undefined; name: string; serviceAccountId?: string | undefined; type: SecretType; }; /** @internal */ export type CreateAPIKeyRequest$Outbound = { expires_at?: string | undefined; name: string; service_account_id?: string | undefined; type: string; }; /** @internal */ export const CreateAPIKeyRequest$outboundSchema: z.ZodMiniType< CreateAPIKeyRequest$Outbound, CreateAPIKeyRequest > = z.pipe( z.object({ expiresAt: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))), name: z.string(), serviceAccountId: z.optional(z.string()), type: SecretType$outboundSchema, }), z.transform((v) => { return remap$(v, { expiresAt: "expires_at", serviceAccountId: "service_account_id", }); }), ); export function createAPIKeyRequestToJSON( createAPIKeyRequest: CreateAPIKeyRequest, ): string { return JSON.stringify( CreateAPIKeyRequest$outboundSchema.parse(createAPIKeyRequest), ); }