/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 0355121bd1a8 */ import * as z from "zod/v3"; import { FacetFilter, FacetFilter$Outbound, FacetFilter$outboundSchema, } from "./facetfilter.js"; import { Thumbnail, Thumbnail$Outbound, Thumbnail$outboundSchema, } from "./thumbnail.js"; import { UserRoleSpecification, UserRoleSpecification$Outbound, UserRoleSpecification$outboundSchema, } from "./userrolespecification.js"; export type CreateCollectionRequest = { /** * The unique name of the Collection. */ name: string; /** * A brief summary of the Collection's contents. */ description?: string | undefined; /** * A list of added user roles for the Collection. */ addedRoles?: Array | undefined; /** * A list of removed user roles for the Collection. */ removedRoles?: Array | undefined; /** * Filters which restrict who should see this Collection. Values are taken from the corresponding filters in people search. */ audienceFilters?: Array | undefined; /** * The emoji icon of this Collection. */ icon?: string | undefined; /** * Indicates whether edits are allowed for everyone or only admins. */ adminLocked?: boolean | undefined; /** * The parent of this Collection, or 0 if it's a top-level Collection. */ parentId?: number | undefined; thumbnail?: Thumbnail | undefined; /** * The datasource type this Collection can hold. */ allowedDatasource?: string | undefined; /** * The (optional) ItemId of the next CollectionItem in sequence. If omitted, will be added to the end of the Collection. Only used if parentId is specified. */ newNextItemId?: string | undefined; }; /** @internal */ export type CreateCollectionRequest$Outbound = { name: string; description?: string | undefined; addedRoles?: Array | undefined; removedRoles?: Array | undefined; audienceFilters?: Array | undefined; icon?: string | undefined; adminLocked?: boolean | undefined; parentId?: number | undefined; thumbnail?: Thumbnail$Outbound | undefined; allowedDatasource?: string | undefined; newNextItemId?: string | undefined; }; /** @internal */ export const CreateCollectionRequest$outboundSchema: z.ZodType< CreateCollectionRequest$Outbound, z.ZodTypeDef, CreateCollectionRequest > = z.object({ name: z.string(), description: z.string().optional(), addedRoles: z.array(UserRoleSpecification$outboundSchema).optional(), removedRoles: z.array(UserRoleSpecification$outboundSchema).optional(), audienceFilters: z.array(FacetFilter$outboundSchema).optional(), icon: z.string().optional(), adminLocked: z.boolean().optional(), parentId: z.number().int().optional(), thumbnail: Thumbnail$outboundSchema.optional(), allowedDatasource: z.string().optional(), newNextItemId: z.string().optional(), }); export function createCollectionRequestToJSON( createCollectionRequest: CreateCollectionRequest, ): string { return JSON.stringify( CreateCollectionRequest$outboundSchema.parse(createCollectionRequest), ); }