/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { ClosedEnum } from "../../types/enums.js"; /** * The tag IDs to filter the links by. */ export type GetLinksCountQueryParamTagIds = string | Array; /** * The unique name of the tags assigned to the short link (case insensitive). */ export type GetLinksCountQueryParamTagNames = string | Array; export const Four = { FolderId: "folderId", } as const; export type Four = ClosedEnum; export const Three = { UserId: "userId", } as const; export type Three = ClosedEnum; export const Two = { TagId: "tagId", } as const; export type Two = ClosedEnum; export const One = { Domain: "domain", } as const; export type One = ClosedEnum; /** * The field to group the links by. */ export type GroupBy = One | Two | Three | Four; export type GetLinksCountRequest = { /** * The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned. */ domain?: string | undefined; /** * Deprecated: Use `tagIds` instead. The tag ID to filter the links by. */ tagId?: string | undefined; /** * The tag IDs to filter the links by. */ tagIds?: string | Array | undefined; /** * The unique name of the tags assigned to the short link (case insensitive). */ tagNames?: string | Array | undefined; /** * The folder ID to filter the links by. */ folderId?: string | undefined; /** * The search term to filter the links by. The search term will be matched against the short link slug and the destination url. */ search?: string | undefined; /** * The user ID to filter the links by. */ userId?: string | undefined; /** * The ID of the tenant that created the link inside your system. If set, will only return links for the specified tenant. */ tenantId?: string | undefined; /** * Whether to include archived links in the response. Defaults to `false` if not provided. */ showArchived?: boolean | undefined; /** * DEPRECATED. Filter for links that have at least one tag assigned to them. */ withTags?: boolean | undefined; /** * The field to group the links by. */ groupBy?: One | Two | Three | Four | undefined; }; /** @internal */ export type GetLinksCountQueryParamTagIds$Outbound = string | Array; /** @internal */ export const GetLinksCountQueryParamTagIds$outboundSchema: z.ZodType< GetLinksCountQueryParamTagIds$Outbound, z.ZodTypeDef, GetLinksCountQueryParamTagIds > = z.union([z.string(), z.array(z.string())]); export function getLinksCountQueryParamTagIdsToJSON( getLinksCountQueryParamTagIds: GetLinksCountQueryParamTagIds, ): string { return JSON.stringify( GetLinksCountQueryParamTagIds$outboundSchema.parse( getLinksCountQueryParamTagIds, ), ); } /** @internal */ export type GetLinksCountQueryParamTagNames$Outbound = string | Array; /** @internal */ export const GetLinksCountQueryParamTagNames$outboundSchema: z.ZodType< GetLinksCountQueryParamTagNames$Outbound, z.ZodTypeDef, GetLinksCountQueryParamTagNames > = z.union([z.string(), z.array(z.string())]); export function getLinksCountQueryParamTagNamesToJSON( getLinksCountQueryParamTagNames: GetLinksCountQueryParamTagNames, ): string { return JSON.stringify( GetLinksCountQueryParamTagNames$outboundSchema.parse( getLinksCountQueryParamTagNames, ), ); } /** @internal */ export const Four$outboundSchema: z.ZodNativeEnum = z.nativeEnum( Four, ); /** @internal */ export const Three$outboundSchema: z.ZodNativeEnum = z.nativeEnum( Three, ); /** @internal */ export const Two$outboundSchema: z.ZodNativeEnum = z.nativeEnum( Two, ); /** @internal */ export const One$outboundSchema: z.ZodNativeEnum = z.nativeEnum( One, ); /** @internal */ export type GroupBy$Outbound = string | string | string | string; /** @internal */ export const GroupBy$outboundSchema: z.ZodType< GroupBy$Outbound, z.ZodTypeDef, GroupBy > = z.union([ One$outboundSchema, Two$outboundSchema, Three$outboundSchema, Four$outboundSchema, ]); export function groupByToJSON(groupBy: GroupBy): string { return JSON.stringify(GroupBy$outboundSchema.parse(groupBy)); } /** @internal */ export type GetLinksCountRequest$Outbound = { domain?: string | undefined; tagId?: string | undefined; tagIds?: string | Array | undefined; tagNames?: string | Array | undefined; folderId?: string | undefined; search?: string | undefined; userId?: string | undefined; tenantId?: string | undefined; showArchived: boolean; withTags: boolean; groupBy?: string | string | string | string | undefined; }; /** @internal */ export const GetLinksCountRequest$outboundSchema: z.ZodType< GetLinksCountRequest$Outbound, z.ZodTypeDef, GetLinksCountRequest > = z.object({ domain: z.string().optional(), tagId: z.string().optional(), tagIds: z.union([z.string(), z.array(z.string())]).optional(), tagNames: z.union([z.string(), z.array(z.string())]).optional(), folderId: z.string().optional(), search: z.string().optional(), userId: z.string().optional(), tenantId: z.string().optional(), showArchived: z.boolean().default(false), withTags: z.boolean().default(false), groupBy: z.union([ One$outboundSchema, Two$outboundSchema, Three$outboundSchema, Four$outboundSchema, ]).optional(), }); export function getLinksCountRequestToJSON( getLinksCountRequest: GetLinksCountRequest, ): string { return JSON.stringify( GetLinksCountRequest$outboundSchema.parse(getLinksCountRequest), ); }