/* * 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 { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type OAuth2ClientPublic = { /** * Creation timestamp of the object. */ createdAt: Date; /** * Last modification timestamp of the object. */ modifiedAt: Date | null; clientId: string; clientName: string | null; clientUri: string | null; logoUri: string | null; tosUri: string | null; policyUri: string | null; }; /** @internal */ export const OAuth2ClientPublic$inboundSchema: z.ZodMiniType< OAuth2ClientPublic, unknown > = z.pipe( z.object({ created_at: z.pipe( z.iso.datetime({ offset: true }), z.transform(v => new Date(v)), ), modified_at: z.nullable( z.pipe(z.iso.datetime({ offset: true }), z.transform(v => new Date(v))), ), client_id: z.string(), client_name: z.nullable(z.string()), client_uri: z.nullable(z.string()), logo_uri: z.nullable(z.string()), tos_uri: z.nullable(z.string()), policy_uri: z.nullable(z.string()), }), z.transform((v) => { return remap$(v, { "created_at": "createdAt", "modified_at": "modifiedAt", "client_id": "clientId", "client_name": "clientName", "client_uri": "clientUri", "logo_uri": "logoUri", "tos_uri": "tosUri", "policy_uri": "policyUri", }); }), ); export function oAuth2ClientPublicFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => OAuth2ClientPublic$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OAuth2ClientPublic' from JSON`, ); }