/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: b2a85200498e */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ChatRestrictionFilters, ChatRestrictionFilters$inboundSchema, } from "./chatrestrictionfilters.js"; import { ObjectPermissions, ObjectPermissions$inboundSchema, } from "./objectpermissions.js"; import { Person, Person$inboundSchema } from "./person.js"; import { UserRoleSpecification, UserRoleSpecification$inboundSchema, } from "./userrolespecification.js"; export type PromptTemplate = { /** * The user-given identifier for this prompt template. */ name?: string | undefined; /** * The actual template string. */ template: string; /** * The Application Id the prompt template should be created under. Empty for default assistant. */ applicationId?: string | undefined; inclusions?: ChatRestrictionFilters | undefined; /** * A list of added user roles for the Workflow. */ addedRoles?: Array | undefined; /** * A list of removed user roles for the Workflow. */ removedRoles?: Array | undefined; permissions?: ObjectPermissions | undefined; /** * Opaque id for this prompt template */ id?: string | undefined; author?: Person | undefined; /** * Server Unix timestamp of the creation time. */ createTimestamp?: number | undefined; /** * Server Unix timestamp of the last update time. */ lastUpdateTimestamp?: number | undefined; lastUpdatedBy?: Person | undefined; /** * A list of roles for this prompt template explicitly granted. */ roles?: Array | undefined; }; /** @internal */ export const PromptTemplate$inboundSchema: z.ZodType< PromptTemplate, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), template: z.string(), applicationId: z.string().optional(), inclusions: ChatRestrictionFilters$inboundSchema.optional(), addedRoles: z.array(UserRoleSpecification$inboundSchema).optional(), removedRoles: z.array(UserRoleSpecification$inboundSchema).optional(), permissions: ObjectPermissions$inboundSchema.optional(), id: z.string().optional(), author: Person$inboundSchema.optional(), createTimestamp: z.number().int().optional(), lastUpdateTimestamp: z.number().int().optional(), lastUpdatedBy: Person$inboundSchema.optional(), roles: z.array(UserRoleSpecification$inboundSchema).optional(), }); export function promptTemplateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PromptTemplate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PromptTemplate' from JSON`, ); }