/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: f44d2aa19d3f */ import * as z from "zod/v3"; 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { OperatorScope, OperatorScope$inboundSchema } from "./operatorscope.js"; export const OperatorType = { Text: "TEXT", Double: "DOUBLE", Date: "DATE", User: "USER", } as const; export type OperatorType = OpenEnum; export type OperatorMetadata = { name: string; /** * Whether this operator is supported by default or something that was created within a workplace app (e.g. custom jira field). */ isCustom?: boolean | undefined; operatorType?: OperatorType | undefined; helpText?: string | undefined; scopes?: Array | undefined; /** * Raw/canonical value of the operator. Only applies when result is an operator value. */ value?: string | undefined; /** * Human readable value of the operator that can be shown to the user. Only applies when result is an operator value. */ displayValue?: string | undefined; }; /** @internal */ export const OperatorType$inboundSchema: z.ZodType< OperatorType, z.ZodTypeDef, unknown > = openEnums.inboundSchema(OperatorType); /** @internal */ export const OperatorMetadata$inboundSchema: z.ZodType< OperatorMetadata, z.ZodTypeDef, unknown > = z.object({ name: z.string(), isCustom: z.boolean().optional(), operatorType: OperatorType$inboundSchema.optional(), helpText: z.string().optional(), scopes: z.array(OperatorScope$inboundSchema).optional(), value: z.string().optional(), displayValue: z.string().optional(), }); export function operatorMetadataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => OperatorMetadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OperatorMetadata' from JSON`, ); }