/* * 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 UpdateWordlistRequestBody = { /** * New name for the wordlist */ name?: string | undefined; /** * New key for the wordlist */ key?: string | undefined; /** * New description for the wordlist */ description?: string | undefined; /** * New words for the wordlist. Replace the existing words with these new ones. Duplicate words will be ignored. */ words?: Array | undefined; /** * Deprecated. Now using threshold in project settings. */ strict?: boolean | undefined; }; export type UpdateWordlistRequest = { /** * ID of the wordlist to update */ 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; body: UpdateWordlistRequestBody; }; /** * Wordlist updated successfully */ export type UpdateWordlistResponse = { /** * 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 UpdateWordlistRequestBody$Outbound = { name?: string | undefined; key?: string | undefined; description?: string | undefined; words?: Array | undefined; strict?: boolean | undefined; }; /** @internal */ export const UpdateWordlistRequestBody$outboundSchema: z.ZodMiniType< UpdateWordlistRequestBody$Outbound, UpdateWordlistRequestBody > = z.object({ name: z.optional(z.string()), key: z.optional(z.string()), description: z.optional(z.string()), words: z.optional(z.array(z.string())), strict: z.optional(z.boolean()), }); export function updateWordlistRequestBodyToJSON( updateWordlistRequestBody: UpdateWordlistRequestBody, ): string { return JSON.stringify( UpdateWordlistRequestBody$outboundSchema.parse(updateWordlistRequestBody), ); } /** @internal */ export type UpdateWordlistRequest$Outbound = { id: string; projectId?: string | undefined; body: UpdateWordlistRequestBody$Outbound; }; /** @internal */ export const UpdateWordlistRequest$outboundSchema: z.ZodMiniType< UpdateWordlistRequest$Outbound, UpdateWordlistRequest > = z.object({ id: z.string(), projectId: z.optional(z.string()), body: z.lazy(() => UpdateWordlistRequestBody$outboundSchema), }); export function updateWordlistRequestToJSON( updateWordlistRequest: UpdateWordlistRequest, ): string { return JSON.stringify( UpdateWordlistRequest$outboundSchema.parse(updateWordlistRequest), ); } /** @internal */ export const UpdateWordlistResponse$inboundSchema: z.ZodMiniType< UpdateWordlistResponse, 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 updateWordlistResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateWordlistResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateWordlistResponse' from JSON`, ); }