/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: ff3e47c079a6 */ 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 EditCollectionRequest = { /** * 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 ID of the Collection to modify. */ id: number; }; /** @internal */ export type EditCollectionRequest$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; id: number; }; /** @internal */ export const EditCollectionRequest$outboundSchema: z.ZodType< EditCollectionRequest$Outbound, z.ZodTypeDef, EditCollectionRequest > = 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(), id: z.number().int(), }); export function editCollectionRequestToJSON( editCollectionRequest: EditCollectionRequest, ): string { return JSON.stringify( EditCollectionRequest$outboundSchema.parse(editCollectionRequest), ); }