/* * 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 UnresolveQueueItemRequestBody = { /** * Optional reason for unresolving the item */ comment?: string | undefined; }; export type UnresolveQueueItemRequest = { /** * The queue ID */ id: string; /** * The item ID to unresolve */ itemId: 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: UnresolveQueueItemRequestBody; }; /** * Successful response */ export type UnresolveQueueItemResponse = { success: boolean; /** * New status of the item */ status: string; /** * Timestamp when the item was unresolved */ unresolvedAt: string; }; /** @internal */ export type UnresolveQueueItemRequestBody$Outbound = { comment?: string | undefined; }; /** @internal */ export const UnresolveQueueItemRequestBody$outboundSchema: z.ZodMiniType< UnresolveQueueItemRequestBody$Outbound, UnresolveQueueItemRequestBody > = z.object({ comment: z.optional(z.string()), }); export function unresolveQueueItemRequestBodyToJSON( unresolveQueueItemRequestBody: UnresolveQueueItemRequestBody, ): string { return JSON.stringify( UnresolveQueueItemRequestBody$outboundSchema.parse( unresolveQueueItemRequestBody, ), ); } /** @internal */ export type UnresolveQueueItemRequest$Outbound = { id: string; itemId: string; projectId?: string | undefined; body: UnresolveQueueItemRequestBody$Outbound; }; /** @internal */ export const UnresolveQueueItemRequest$outboundSchema: z.ZodMiniType< UnresolveQueueItemRequest$Outbound, UnresolveQueueItemRequest > = z.object({ id: z.string(), itemId: z.string(), projectId: z.optional(z.string()), body: z.lazy(() => UnresolveQueueItemRequestBody$outboundSchema), }); export function unresolveQueueItemRequestToJSON( unresolveQueueItemRequest: UnresolveQueueItemRequest, ): string { return JSON.stringify( UnresolveQueueItemRequest$outboundSchema.parse(unresolveQueueItemRequest), ); } /** @internal */ export const UnresolveQueueItemResponse$inboundSchema: z.ZodMiniType< UnresolveQueueItemResponse, unknown > = z.object({ success: types.boolean(), status: types.string(), unresolvedAt: types.string(), }); export function unresolveQueueItemResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UnresolveQueueItemResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UnresolveQueueItemResponse' from JSON`, ); }