/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdk-validation-error.js"; export type GetWordlistRequest = { /** * ID of the wordlist to get */ id: string; /** * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. */ projectId?: string | undefined; }; /** * Successful response */ export type GetWordlistResponse = { /** * ID of the wordlist */ id: string; name: string | null; /** * Words in the wordlist */ words: Array; /** * Creation date of the wordlist */ createdAt: string; /** * ID of the organization */ organizationId: string; userId: string | null; /** * Strict mode */ strict: boolean; }; /** @internal */ export type GetWordlistRequest$Outbound = { id: string; projectId?: string | undefined; }; /** @internal */ export const GetWordlistRequest$outboundSchema: z.ZodMiniType< GetWordlistRequest$Outbound, GetWordlistRequest > = z.object({ id: z.string(), projectId: z.optional(z.string()), }); export function getWordlistRequestToJSON( getWordlistRequest: GetWordlistRequest, ): string { return JSON.stringify( GetWordlistRequest$outboundSchema.parse(getWordlistRequest), ); } /** @internal */ export const GetWordlistResponse$inboundSchema: z.ZodMiniType< GetWordlistResponse, unknown > = z.object({ id: types.string(), name: types.nullable(types.string()), words: z.array(types.string()), createdAt: types.string(), organizationId: types.string(), userId: types.nullable(types.string()), strict: types.boolean(), }); export function getWordlistResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetWordlistResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetWordlistResponse' from JSON`, ); }