/* * 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 ResolveQueueItemRequestBody = { /** * Optional comment */ comment?: string | undefined; }; export type ResolveQueueItemRequest = { /** * The queue ID */ id: string; /** * The item ID to resolve */ 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: ResolveQueueItemRequestBody; }; /** * Successful response */ export type ResolveQueueItemResponse = { success: boolean; /** * Timestamp when the item was resolved */ resolvedAt: string; /** * Optional comment */ comment?: string | undefined; }; /** @internal */ export type ResolveQueueItemRequestBody$Outbound = { comment?: string | undefined; }; /** @internal */ export const ResolveQueueItemRequestBody$outboundSchema: z.ZodMiniType< ResolveQueueItemRequestBody$Outbound, ResolveQueueItemRequestBody > = z.object({ comment: z.optional(z.string()), }); export function resolveQueueItemRequestBodyToJSON( resolveQueueItemRequestBody: ResolveQueueItemRequestBody, ): string { return JSON.stringify( ResolveQueueItemRequestBody$outboundSchema.parse( resolveQueueItemRequestBody, ), ); } /** @internal */ export type ResolveQueueItemRequest$Outbound = { id: string; itemId: string; projectId?: string | undefined; body: ResolveQueueItemRequestBody$Outbound; }; /** @internal */ export const ResolveQueueItemRequest$outboundSchema: z.ZodMiniType< ResolveQueueItemRequest$Outbound, ResolveQueueItemRequest > = z.object({ id: z.string(), itemId: z.string(), projectId: z.optional(z.string()), body: z.lazy(() => ResolveQueueItemRequestBody$outboundSchema), }); export function resolveQueueItemRequestToJSON( resolveQueueItemRequest: ResolveQueueItemRequest, ): string { return JSON.stringify( ResolveQueueItemRequest$outboundSchema.parse(resolveQueueItemRequest), ); } /** @internal */ export const ResolveQueueItemResponse$inboundSchema: z.ZodMiniType< ResolveQueueItemResponse, unknown > = z.object({ success: types.boolean(), resolvedAt: types.string(), comment: types.optional(types.string()), }); export function resolveQueueItemResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ResolveQueueItemResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResolveQueueItemResponse' from JSON`, ); }