/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { ClosedEnum } from "../../types/enums.js"; /** * The field to sort the tags by. */ export const GetTagsQueryParamSortBy = { Name: "name", CreatedAt: "createdAt", } as const; /** * The field to sort the tags by. */ export type GetTagsQueryParamSortBy = ClosedEnum< typeof GetTagsQueryParamSortBy >; /** * The order to sort the tags by. */ export const GetTagsQueryParamSortOrder = { Asc: "asc", Desc: "desc", } as const; /** * The order to sort the tags by. */ export type GetTagsQueryParamSortOrder = ClosedEnum< typeof GetTagsQueryParamSortOrder >; /** * IDs of tags to filter by. */ export type Ids = string | Array; export type GetTagsRequest = { /** * The field to sort the tags by. */ sortBy?: GetTagsQueryParamSortBy | undefined; /** * The order to sort the tags by. */ sortOrder?: GetTagsQueryParamSortOrder | undefined; /** * The search term to filter the tags by. */ search?: string | undefined; /** * IDs of tags to filter by. */ ids?: string | Array | undefined; /** * The page number for pagination. */ page?: number | undefined; /** * The number of items per page. */ pageSize?: number | undefined; }; /** @internal */ export const GetTagsQueryParamSortBy$outboundSchema: z.ZodNativeEnum< typeof GetTagsQueryParamSortBy > = z.nativeEnum(GetTagsQueryParamSortBy); /** @internal */ export const GetTagsQueryParamSortOrder$outboundSchema: z.ZodNativeEnum< typeof GetTagsQueryParamSortOrder > = z.nativeEnum(GetTagsQueryParamSortOrder); /** @internal */ export type Ids$Outbound = string | Array; /** @internal */ export const Ids$outboundSchema: z.ZodType = z .union([z.string(), z.array(z.string())]); export function idsToJSON(ids: Ids): string { return JSON.stringify(Ids$outboundSchema.parse(ids)); } /** @internal */ export type GetTagsRequest$Outbound = { sortBy: string; sortOrder: string; search?: string | undefined; ids?: string | Array | undefined; page?: number | undefined; pageSize: number; }; /** @internal */ export const GetTagsRequest$outboundSchema: z.ZodType< GetTagsRequest$Outbound, z.ZodTypeDef, GetTagsRequest > = z.object({ sortBy: GetTagsQueryParamSortBy$outboundSchema.default("name"), sortOrder: GetTagsQueryParamSortOrder$outboundSchema.default("asc"), search: z.string().optional(), ids: z.union([z.string(), z.array(z.string())]).optional(), page: z.number().optional(), pageSize: z.number().default(100), }); export function getTagsRequestToJSON(getTagsRequest: GetTagsRequest): string { return JSON.stringify(GetTagsRequest$outboundSchema.parse(getTagsRequest)); }