/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; 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 * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdk-validation-error.js"; export type GetQueueRequest = { /** * The queue ID */ 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; }; export const IsFlagged = { All: "ALL", Flagged: "FLAGGED", NotFlagged: "NOT_FLAGGED", ShadowFlagged: "SHADOW_FLAGGED", } as const; export type IsFlagged = OpenEnum; export const CasebookAnswer = { All: "ALL", Allowed: "ALLOWED", Rejected: "REJECTED", NoAnswer: "NO_ANSWER", } as const; export type CasebookAnswer = OpenEnum; export const CasebookAgreement = { All: "ALL", Overruled: "OVERRULED", Agreed: "AGREED", } as const; export type CasebookAgreement = OpenEnum; export const GetQueueType = { Flagged: "FLAGGED", NotFlagged: "NOT_FLAGGED", Thresholds: "THRESHOLDS", Matched: "MATCHED", } as const; export type GetQueueType = OpenEnum; export type FilterLabel = { label: string; type: GetQueueType; minThreshold?: number | null | undefined; maxThreshold?: number | null | undefined; }; export type MetadataFilter = { key: string; value: string; }; export const GetQueueContentType = { Profile: "profile", Message: "message", Post: "post", Comment: "comment", Event: "event", Product: "product", Review: "review", Voice: "voice", Other: "other", } as const; export type GetQueueContentType = OpenEnum; export const MediaType = { Text: "text", Image: "image", Video: "video", Object: "object", Audio: "audio", } as const; export type MediaType = OpenEnum; export const GetQueueRecommendationAction = { Review: "review", Allow: "allow", Reject: "reject", } as const; export type GetQueueRecommendationAction = OpenEnum< typeof GetQueueRecommendationAction >; export const WithinUnit = { Minutes: "MINUTES", Hours: "HOURS", Days: "DAYS", Weeks: "WEEKS", Months: "MONTHS", Years: "YEARS", } as const; export type WithinUnit = OpenEnum; export const CheckStatus = { All: "all", Checked: "checked", Unchecked: "unchecked", } as const; export type CheckStatus = OpenEnum; export type Filter = { isFlagged?: IsFlagged | undefined; casebookAnswer?: CasebookAnswer | undefined; casebookAgreement?: CasebookAgreement | undefined; labels?: Array | undefined; filterLabels?: Array | undefined; metadataFilters?: Array | undefined; filteredChannelIds?: Array | undefined; filteredActionIds?: Array | undefined; languages?: Array | undefined; contentTypes?: Array | undefined; mediaTypes?: Array | undefined; authorTrustLevels?: Array | undefined; recommendationActions?: Array | undefined; minSeverity?: number | undefined; maxSeverity?: number | undefined; afterDate?: string | undefined; beforeDate?: string | undefined; within?: number | undefined; withinUnit?: WithinUnit | undefined; clearDateWindow?: boolean | undefined; checkStatus?: CheckStatus | null | undefined; authorID?: string | undefined; contentID?: string | undefined; conversationIds?: Array | undefined; search?: Array | undefined; }; export type Queue = { id: string; name: string; description: string; filter: Filter; unresolvedItemsCount: number; resolvedItemsCount: number; totalItemsCount: number; }; /** * Successful response */ export type GetQueueResponse = { queue: Queue; }; /** @internal */ export type GetQueueRequest$Outbound = { id: string; projectId?: string | undefined; }; /** @internal */ export const GetQueueRequest$outboundSchema: z.ZodMiniType< GetQueueRequest$Outbound, GetQueueRequest > = z.object({ id: z.string(), projectId: z.optional(z.string()), }); export function getQueueRequestToJSON( getQueueRequest: GetQueueRequest, ): string { return JSON.stringify(GetQueueRequest$outboundSchema.parse(getQueueRequest)); } /** @internal */ export const IsFlagged$inboundSchema: z.ZodMiniType = openEnums.inboundSchema(IsFlagged); /** @internal */ export const CasebookAnswer$inboundSchema: z.ZodMiniType< CasebookAnswer, unknown > = openEnums.inboundSchema(CasebookAnswer); /** @internal */ export const CasebookAgreement$inboundSchema: z.ZodMiniType< CasebookAgreement, unknown > = openEnums.inboundSchema(CasebookAgreement); /** @internal */ export const GetQueueType$inboundSchema: z.ZodMiniType = openEnums.inboundSchema(GetQueueType); /** @internal */ export const FilterLabel$inboundSchema: z.ZodMiniType = z .object({ label: types.string(), type: GetQueueType$inboundSchema, minThreshold: z.optional(z.nullable(types.number())), maxThreshold: z.optional(z.nullable(types.number())), }); export function filterLabelFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FilterLabel$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FilterLabel' from JSON`, ); } /** @internal */ export const MetadataFilter$inboundSchema: z.ZodMiniType< MetadataFilter, unknown > = z.object({ key: types.string(), value: types.string(), }); export function metadataFilterFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MetadataFilter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MetadataFilter' from JSON`, ); } /** @internal */ export const GetQueueContentType$inboundSchema: z.ZodMiniType< GetQueueContentType, unknown > = openEnums.inboundSchema(GetQueueContentType); /** @internal */ export const MediaType$inboundSchema: z.ZodMiniType = openEnums.inboundSchema(MediaType); /** @internal */ export const GetQueueRecommendationAction$inboundSchema: z.ZodMiniType< GetQueueRecommendationAction, unknown > = openEnums.inboundSchema(GetQueueRecommendationAction); /** @internal */ export const WithinUnit$inboundSchema: z.ZodMiniType = openEnums.inboundSchema(WithinUnit); /** @internal */ export const CheckStatus$inboundSchema: z.ZodMiniType = openEnums.inboundSchema(CheckStatus); /** @internal */ export const Filter$inboundSchema: z.ZodMiniType = z.object({ isFlagged: types.optional(IsFlagged$inboundSchema), casebookAnswer: types.optional(CasebookAnswer$inboundSchema), casebookAgreement: types.optional(CasebookAgreement$inboundSchema), labels: types.optional(z.array(types.string())), filterLabels: types.optional( z.array(z.lazy(() => FilterLabel$inboundSchema)), ), metadataFilters: types.optional( z.array(z.lazy(() => MetadataFilter$inboundSchema)), ), filteredChannelIds: types.optional(z.array(types.string())), filteredActionIds: types.optional(z.array(types.string())), languages: types.optional(z.array(types.string())), contentTypes: types.optional(z.array(GetQueueContentType$inboundSchema)), mediaTypes: types.optional(z.array(MediaType$inboundSchema)), authorTrustLevels: types.optional(z.array(types.number())), recommendationActions: types.optional( z.array(GetQueueRecommendationAction$inboundSchema), ), minSeverity: types.optional(types.number()), maxSeverity: types.optional(types.number()), afterDate: types.optional(types.string()), beforeDate: types.optional(types.string()), within: types.optional(types.number()), withinUnit: types.optional(WithinUnit$inboundSchema), clearDateWindow: types.optional(types.boolean()), checkStatus: z.optional(z.nullable(CheckStatus$inboundSchema)), authorID: types.optional(types.string()), contentID: types.optional(types.string()), conversationIds: types.optional(z.array(types.nullable(types.string()))), search: types.optional(z.array(types.string())), }); export function filterFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Filter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Filter' from JSON`, ); } /** @internal */ export const Queue$inboundSchema: z.ZodMiniType = z.object({ id: types.string(), name: types.string(), description: types.string(), filter: z.lazy(() => Filter$inboundSchema), unresolvedItemsCount: types.number(), resolvedItemsCount: types.number(), totalItemsCount: types.number(), }); export function queueFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Queue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Queue' from JSON`, ); } /** @internal */ export const GetQueueResponse$inboundSchema: z.ZodMiniType< GetQueueResponse, unknown > = z.object({ queue: z.lazy(() => Queue$inboundSchema), }); export function getQueueResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetQueueResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetQueueResponse' from JSON`, ); }