/* * 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 * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { SubType, SubType$inboundSchema } from "./subtype.js"; export const TokenType = { AccessToken: "access_token", RefreshToken: "refresh_token", } as const; export type TokenType = OpenEnum; export type IntrospectTokenResponse = { active: boolean; clientId: string; tokenType: TokenType; scope: string; subType: SubType; sub: string; aud: string; iss: string; exp: number; iat: number; }; /** @internal */ export const TokenType$inboundSchema: z.ZodMiniType = openEnums.inboundSchema(TokenType); /** @internal */ export const IntrospectTokenResponse$inboundSchema: z.ZodMiniType< IntrospectTokenResponse, unknown > = z.pipe( z.object({ active: z.boolean(), client_id: z.string(), token_type: TokenType$inboundSchema, scope: z.string(), sub_type: SubType$inboundSchema, sub: z.string(), aud: z.string(), iss: z.string(), exp: z.int(), iat: z.int(), }), z.transform((v) => { return remap$(v, { "client_id": "clientId", "token_type": "tokenType", "sub_type": "subType", }); }), ); export function introspectTokenResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IntrospectTokenResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IntrospectTokenResponse' from JSON`, ); }