/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: f26659452a5e */ import * as z from "zod/v4"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ServiceAccount = { id: string; name: string; customerId: string; organizationId: string; workspaceId: string; description: string | null; createdAt: Date; updatedAt: Date; deletedAt: Date | null; }; /** @internal */ export const ServiceAccount$inboundSchema: z.ZodType = z.object({ id: z.string(), name: z.string(), customer_id: z.string(), organization_id: z.string(), workspace_id: z.string(), description: z.nullable(z.string()), created_at: z.iso.datetime({ offset: true }).transform(v => new Date(v)), updated_at: z.iso.datetime({ offset: true }).transform(v => new Date(v)), deleted_at: z.nullable( z.iso.datetime({ offset: true }).transform(v => new Date(v)), ), }).transform((v) => { return remap$(v, { "customer_id": "customerId", "organization_id": "organizationId", "workspace_id": "workspaceId", "created_at": "createdAt", "updated_at": "updatedAt", "deleted_at": "deletedAt", }); }); export function serviceAccountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ServiceAccount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ServiceAccount' from JSON`, ); }