{"version":3,"file":"index.mjs","names":["mergeHeaders","mergeHeaders","#defaults","#defaults","#secret","#options","#client","#baseUrl","#fetch","#headers","#raw"],"sources":["../src/generated/core/bodySerializer.gen.ts","../src/generated/core/serverSentEvents.gen.ts","../src/generated/core/pathSerializer.gen.ts","../src/generated/core/utils.gen.ts","../src/generated/core/auth.gen.ts","../src/generated/client/utils.gen.ts","../src/generated/client/client.gen.ts","../src/region.ts","../src/caller-rules.gen.ts","../src/detect-caller.ts","../src/errors.ts","../src/core/http.ts","../src/core/result.ts","../src/generated/client.gen.ts","../src/generated/sdk.gen.ts","../src/resources/base.ts","../src/resources/email.gen.ts","../src/resources/emailDefaults.ts","../src/resources/emailStats.gen.ts","../src/resources/emailMailboxes.gen.ts","../src/resources/emailMailboxesMessages.ts","../src/resources/emailMailboxesReceiveRules.gen.ts","../src/resources/emailMailboxes.ts","../src/resources/emailThreads.gen.ts","../src/resources/emailThreadsMessages.gen.ts","../src/resources/emailThreads.ts","../src/resources/email.ts","../src/resources/audiences.gen.ts","../src/resources/domains.gen.ts","../src/resources/contactProperties.gen.ts","../src/resources/contacts.gen.ts","../src/resources/sms.gen.ts","../src/resources/smsStats.gen.ts","../src/resources/smsStatsInbound.gen.ts","../src/resources/smsStats.ts","../src/resources/sms.ts","../src/resources/smsKeywordRules.gen.ts","../src/resources/smsSuppressions.gen.ts","../src/resources/smsTemplates.gen.ts","../src/resources/whatsapp.gen.ts","../src/resources/whatsapp.ts","../src/resources/voice.gen.ts","../src/resources/verifyVerifications.gen.ts","../src/resources/verify.ts","../src/resources/webhooks.ts","../src/resources/realtime.gen.ts","../src/resources/realtimeChannels.gen.ts","../src/resources/realtimeMembers.gen.ts","../src/core/secretbox.gen.ts","../src/core/realtime-crypto.ts","../src/resources/realtime.ts","../src/resources/lookup.gen.ts","../src/resources/numbers.gen.ts","../src/resources/numbersAvailable.gen.ts","../src/resources/numbersOrders.gen.ts","../src/resources/numbers.ts","../src/client.ts","../src/event-types.gen.ts","../src/open-enums.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport type {\n  ArrayStyle,\n  ObjectStyle,\n  SerializerOptions,\n} from \"./pathSerializer.gen\";\n\nexport type QuerySerializer = (query: Record<string, unknown>) => string;\n\nexport type BodySerializer = (body: unknown) => unknown;\n\ntype QuerySerializerOptionsObject = {\n  allowReserved?: boolean;\n  array?: Partial<SerializerOptions<ArrayStyle>>;\n  object?: Partial<SerializerOptions<ObjectStyle>>;\n};\n\nexport type QuerySerializerOptions = QuerySerializerOptionsObject & {\n  /**\n   * Per-parameter serialization overrides. When provided, these settings\n   * override the global array/object settings for specific parameter names.\n   */\n  parameters?: Record<string, QuerySerializerOptionsObject>;\n};\n\nconst serializeFormDataPair = (\n  data: FormData,\n  key: string,\n  value: unknown,\n): void => {\n  if (typeof value === \"string\" || value instanceof Blob) {\n    data.append(key, value);\n  } else if (value instanceof Date) {\n    data.append(key, value.toISOString());\n  } else {\n    data.append(key, JSON.stringify(value));\n  }\n};\n\nconst serializeUrlSearchParamsPair = (\n  data: URLSearchParams,\n  key: string,\n  value: unknown,\n): void => {\n  if (typeof value === \"string\") {\n    data.append(key, value);\n  } else {\n    data.append(key, JSON.stringify(value));\n  }\n};\n\nexport const formDataBodySerializer = {\n  bodySerializer: (body: unknown): FormData => {\n    const data = new FormData();\n\n    Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {\n      if (value === undefined || value === null) {\n        return;\n      }\n      if (Array.isArray(value)) {\n        value.forEach((v) => serializeFormDataPair(data, key, v));\n      } else {\n        serializeFormDataPair(data, key, value);\n      }\n    });\n\n    return data;\n  },\n};\n\nexport const jsonBodySerializer = {\n  bodySerializer: (body: unknown): string =>\n    JSON.stringify(body, (_key, value) =>\n      typeof value === \"bigint\" ? value.toString() : value,\n    ),\n};\n\nexport const urlSearchParamsBodySerializer = {\n  bodySerializer: (body: unknown): string => {\n    const data = new URLSearchParams();\n\n    Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {\n      if (value === undefined || value === null) {\n        return;\n      }\n      if (Array.isArray(value)) {\n        value.forEach((v) => serializeUrlSearchParamsPair(data, key, v));\n      } else {\n        serializeUrlSearchParamsPair(data, key, value);\n      }\n    });\n\n    return data.toString();\n  },\n};\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { Config } from \"./types.gen\";\n\nexport type ServerSentEventsOptions<TData = unknown> = Omit<\n  RequestInit,\n  \"method\"\n> &\n  Pick<Config, \"method\" | \"responseTransformer\" | \"responseValidator\"> & {\n    /**\n     * Fetch API implementation. You can use this option to provide a custom\n     * fetch instance.\n     *\n     * @default globalThis.fetch\n     */\n    fetch?: typeof fetch;\n    /**\n     * Implementing clients can call request interceptors inside this hook.\n     */\n    onRequest?: (url: string, init: RequestInit) => Promise<Request>;\n    /**\n     * Callback invoked when a network or parsing error occurs during streaming.\n     *\n     * This option applies only if the endpoint returns a stream of events.\n     *\n     * @param error The error that occurred.\n     */\n    onSseError?: (error: unknown) => void;\n    /**\n     * Callback invoked when an event is streamed from the server.\n     *\n     * This option applies only if the endpoint returns a stream of events.\n     *\n     * @param event Event streamed from the server.\n     * @returns Nothing (void).\n     */\n    onSseEvent?: (event: StreamEvent<TData>) => void;\n    serializedBody?: RequestInit[\"body\"];\n    /**\n     * Default retry delay in milliseconds.\n     *\n     * This option applies only if the endpoint returns a stream of events.\n     *\n     * @default 3000\n     */\n    sseDefaultRetryDelay?: number;\n    /**\n     * Maximum number of retry attempts before giving up.\n     */\n    sseMaxRetryAttempts?: number;\n    /**\n     * Maximum retry delay in milliseconds.\n     *\n     * Applies only when exponential backoff is used.\n     *\n     * This option applies only if the endpoint returns a stream of events.\n     *\n     * @default 30000\n     */\n    sseMaxRetryDelay?: number;\n    /**\n     * Optional sleep function for retry backoff.\n     *\n     * Defaults to using `setTimeout`.\n     */\n    sseSleepFn?: (ms: number) => Promise<void>;\n    url: string;\n  };\n\nexport interface StreamEvent<TData = unknown> {\n  data: TData;\n  event?: string;\n  id?: string;\n  retry?: number;\n}\n\nexport type ServerSentEventsResult<\n  TData = unknown,\n  TReturn = void,\n  TNext = unknown,\n> = {\n  stream: AsyncGenerator<\n    TData extends Record<string, unknown> ? TData[keyof TData] : TData,\n    TReturn,\n    TNext\n  >;\n};\n\nexport function createSseClient<TData = unknown>({\n  onRequest,\n  onSseError,\n  onSseEvent,\n  responseTransformer,\n  responseValidator,\n  sseDefaultRetryDelay,\n  sseMaxRetryAttempts,\n  sseMaxRetryDelay,\n  sseSleepFn,\n  url,\n  ...options\n}: ServerSentEventsOptions): ServerSentEventsResult<TData> {\n  let lastEventId: string | undefined;\n\n  const sleep =\n    sseSleepFn ??\n    ((ms: number) => new Promise((resolve) => setTimeout(resolve, ms)));\n\n  const createStream = async function* () {\n    let retryDelay: number = sseDefaultRetryDelay ?? 3000;\n    let attempt = 0;\n    const signal = options.signal ?? new AbortController().signal;\n\n    while (true) {\n      if (signal.aborted) break;\n\n      attempt++;\n\n      const headers =\n        options.headers instanceof Headers\n          ? options.headers\n          : new Headers(options.headers as Record<string, string> | undefined);\n\n      if (lastEventId !== undefined) {\n        headers.set(\"Last-Event-ID\", lastEventId);\n      }\n\n      try {\n        const requestInit: RequestInit = {\n          redirect: \"follow\",\n          ...options,\n          body: options.serializedBody,\n          headers,\n          signal,\n        };\n        let request = new Request(url, requestInit);\n        if (onRequest) {\n          request = await onRequest(url, requestInit);\n        }\n        // fetch must be assigned here, otherwise it would throw the error:\n        // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation\n        const _fetch = options.fetch ?? globalThis.fetch;\n        const response = await _fetch(request);\n\n        if (!response.ok)\n          throw new Error(\n            `SSE failed: ${response.status} ${response.statusText}`,\n          );\n\n        if (!response.body) throw new Error(\"No body in SSE response\");\n\n        const reader = response.body\n          .pipeThrough(new TextDecoderStream())\n          .getReader();\n\n        let buffer = \"\";\n\n        const abortHandler = () => {\n          try {\n            reader.cancel();\n          } catch {\n            // noop\n          }\n        };\n\n        signal.addEventListener(\"abort\", abortHandler);\n\n        try {\n          while (true) {\n            const { done, value } = await reader.read();\n            if (done) break;\n            buffer += value;\n            buffer = buffer.replace(/\\r\\n?/g, \"\\n\"); // normalize line endings\n\n            const chunks = buffer.split(\"\\n\\n\");\n            buffer = chunks.pop() ?? \"\";\n\n            for (const chunk of chunks) {\n              const lines = chunk.split(\"\\n\");\n              const dataLines: Array<string> = [];\n              let eventName: string | undefined;\n\n              for (const line of lines) {\n                if (line.startsWith(\"data:\")) {\n                  dataLines.push(line.replace(/^data:\\s*/, \"\"));\n                } else if (line.startsWith(\"event:\")) {\n                  eventName = line.replace(/^event:\\s*/, \"\");\n                } else if (line.startsWith(\"id:\")) {\n                  lastEventId = line.replace(/^id:\\s*/, \"\");\n                } else if (line.startsWith(\"retry:\")) {\n                  const parsed = Number.parseInt(\n                    line.replace(/^retry:\\s*/, \"\"),\n                    10,\n                  );\n                  if (!Number.isNaN(parsed)) {\n                    retryDelay = parsed;\n                  }\n                }\n              }\n\n              let data: unknown;\n              let parsedJson = false;\n\n              if (dataLines.length) {\n                const rawData = dataLines.join(\"\\n\");\n                try {\n                  data = JSON.parse(rawData);\n                  parsedJson = true;\n                } catch {\n                  data = rawData;\n                }\n              }\n\n              if (parsedJson) {\n                if (responseValidator) {\n                  await responseValidator(data);\n                }\n\n                if (responseTransformer) {\n                  data = await responseTransformer(data);\n                }\n              }\n\n              onSseEvent?.({\n                data,\n                event: eventName,\n                id: lastEventId,\n                retry: retryDelay,\n              });\n\n              if (dataLines.length) {\n                yield data as any;\n              }\n            }\n          }\n        } finally {\n          signal.removeEventListener(\"abort\", abortHandler);\n          reader.releaseLock();\n        }\n\n        break; // exit loop on normal completion\n      } catch (error) {\n        // connection failed or aborted; retry after delay\n        onSseError?.(error);\n\n        if (\n          sseMaxRetryAttempts !== undefined &&\n          attempt >= sseMaxRetryAttempts\n        ) {\n          break; // stop after firing error\n        }\n\n        // exponential backoff: double retry each attempt, cap at 30s\n        const backoff = Math.min(\n          retryDelay * 2 ** (attempt - 1),\n          sseMaxRetryDelay ?? 30000,\n        );\n        await sleep(backoff);\n      }\n    }\n  };\n\n  const stream = createStream();\n\n  return { stream };\n}\n","// This file is auto-generated by @hey-api/openapi-ts\n\ninterface SerializeOptions<T>\n  extends SerializePrimitiveOptions, SerializerOptions<T> {}\n\ninterface SerializePrimitiveOptions {\n  allowReserved?: boolean;\n  name: string;\n}\n\nexport interface SerializerOptions<T> {\n  /**\n   * @default true\n   */\n  explode: boolean;\n  style: T;\n}\n\nexport type ArrayStyle = \"form\" | \"spaceDelimited\" | \"pipeDelimited\";\nexport type ArraySeparatorStyle = ArrayStyle | MatrixStyle;\ntype MatrixStyle = \"label\" | \"matrix\" | \"simple\";\nexport type ObjectStyle = \"form\" | \"deepObject\";\ntype ObjectSeparatorStyle = ObjectStyle | MatrixStyle;\n\ninterface SerializePrimitiveParam extends SerializePrimitiveOptions {\n  value: string;\n}\n\nexport const separatorArrayExplode = (\n  style: ArraySeparatorStyle,\n): \".\" | \";\" | \",\" | \"&\" => {\n  switch (style) {\n    case \"label\":\n      return \".\";\n    case \"matrix\":\n      return \";\";\n    case \"simple\":\n      return \",\";\n    default:\n      return \"&\";\n  }\n};\n\nexport const separatorArrayNoExplode = (\n  style: ArraySeparatorStyle,\n): \",\" | \"|\" | \"%20\" => {\n  switch (style) {\n    case \"form\":\n      return \",\";\n    case \"pipeDelimited\":\n      return \"|\";\n    case \"spaceDelimited\":\n      return \"%20\";\n    default:\n      return \",\";\n  }\n};\n\nexport const separatorObjectExplode = (\n  style: ObjectSeparatorStyle,\n): \".\" | \";\" | \",\" | \"&\" => {\n  switch (style) {\n    case \"label\":\n      return \".\";\n    case \"matrix\":\n      return \";\";\n    case \"simple\":\n      return \",\";\n    default:\n      return \"&\";\n  }\n};\n\nexport const serializeArrayParam = ({\n  allowReserved,\n  explode,\n  name,\n  style,\n  value,\n}: SerializeOptions<ArraySeparatorStyle> & {\n  value: unknown[];\n}): string => {\n  if (!explode) {\n    const joinedValues = (\n      allowReserved ? value : value.map((v) => encodeURIComponent(v as string))\n    ).join(separatorArrayNoExplode(style));\n    switch (style) {\n      case \"label\":\n        return `.${joinedValues}`;\n      case \"matrix\":\n        return `;${name}=${joinedValues}`;\n      case \"simple\":\n        return joinedValues;\n      default:\n        return `${name}=${joinedValues}`;\n    }\n  }\n\n  const separator = separatorArrayExplode(style);\n  const joinedValues = value\n    .map((v) => {\n      if (style === \"label\" || style === \"simple\") {\n        return allowReserved ? v : encodeURIComponent(v as string);\n      }\n\n      return serializePrimitiveParam({\n        allowReserved,\n        name,\n        value: v as string,\n      });\n    })\n    .join(separator);\n  return style === \"label\" || style === \"matrix\"\n    ? separator + joinedValues\n    : joinedValues;\n};\n\nexport const serializePrimitiveParam = ({\n  allowReserved,\n  name,\n  value,\n}: SerializePrimitiveParam): string => {\n  if (value === undefined || value === null) {\n    return \"\";\n  }\n\n  if (typeof value === \"object\") {\n    throw new Error(\n      \"Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.\",\n    );\n  }\n\n  return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;\n};\n\nexport const serializeObjectParam = ({\n  allowReserved,\n  explode,\n  name,\n  style,\n  value,\n  valueOnly,\n}: SerializeOptions<ObjectSeparatorStyle> & {\n  value: Record<string, unknown> | Date;\n  valueOnly?: boolean;\n}): string => {\n  if (value instanceof Date) {\n    return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;\n  }\n\n  if (style !== \"deepObject\" && !explode) {\n    let values: string[] = [];\n    Object.entries(value).forEach(([key, v]) => {\n      values = [\n        ...values,\n        key,\n        allowReserved ? (v as string) : encodeURIComponent(v as string),\n      ];\n    });\n    const joinedValues = values.join(\",\");\n    switch (style) {\n      case \"form\":\n        return `${name}=${joinedValues}`;\n      case \"label\":\n        return `.${joinedValues}`;\n      case \"matrix\":\n        return `;${name}=${joinedValues}`;\n      default:\n        return joinedValues;\n    }\n  }\n\n  const separator = separatorObjectExplode(style);\n  const joinedValues = Object.entries(value)\n    .map(([key, v]) =>\n      serializePrimitiveParam({\n        allowReserved,\n        name: style === \"deepObject\" ? `${name}[${key}]` : key,\n        value: v as string,\n      }),\n    )\n    .join(separator);\n  return style === \"label\" || style === \"matrix\"\n    ? separator + joinedValues\n    : joinedValues;\n};\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { BodySerializer, QuerySerializer } from \"./bodySerializer.gen\";\nimport {\n  type ArraySeparatorStyle,\n  serializeArrayParam,\n  serializeObjectParam,\n  serializePrimitiveParam,\n} from \"./pathSerializer.gen\";\n\nexport interface PathSerializer {\n  path: Record<string, unknown>;\n  url: string;\n}\n\nexport const PATH_PARAM_RE: RegExp = /\\{[^{}]+\\}/g;\n\nexport const defaultPathSerializer = ({\n  path,\n  url: _url,\n}: PathSerializer): string => {\n  let url = _url;\n  const matches = _url.match(PATH_PARAM_RE);\n  if (matches) {\n    for (const match of matches) {\n      let explode = false;\n      let name = match.substring(1, match.length - 1);\n      let style: ArraySeparatorStyle = \"simple\";\n\n      if (name.endsWith(\"*\")) {\n        explode = true;\n        name = name.substring(0, name.length - 1);\n      }\n\n      if (name.startsWith(\".\")) {\n        name = name.substring(1);\n        style = \"label\";\n      } else if (name.startsWith(\";\")) {\n        name = name.substring(1);\n        style = \"matrix\";\n      }\n\n      const value = path[name];\n\n      if (value === undefined || value === null) {\n        continue;\n      }\n\n      if (Array.isArray(value)) {\n        url = url.replace(\n          match,\n          serializeArrayParam({ explode, name, style, value }),\n        );\n        continue;\n      }\n\n      if (typeof value === \"object\") {\n        url = url.replace(\n          match,\n          serializeObjectParam({\n            explode,\n            name,\n            style,\n            value: value as Record<string, unknown>,\n            valueOnly: true,\n          }),\n        );\n        continue;\n      }\n\n      if (style === \"matrix\") {\n        url = url.replace(\n          match,\n          `;${serializePrimitiveParam({\n            name,\n            value: value as string,\n          })}`,\n        );\n        continue;\n      }\n\n      const replaceValue = encodeURIComponent(\n        style === \"label\" ? `.${value as string}` : (value as string),\n      );\n      url = url.replace(match, replaceValue);\n    }\n  }\n  return url;\n};\n\nexport const getUrl = ({\n  baseUrl,\n  path,\n  query,\n  querySerializer,\n  url: _url,\n}: {\n  baseUrl?: string;\n  path?: Record<string, unknown>;\n  query?: Record<string, unknown>;\n  querySerializer: QuerySerializer;\n  url: string;\n}): string => {\n  const pathUrl = _url.startsWith(\"/\") ? _url : `/${_url}`;\n  let url = (baseUrl ?? \"\") + pathUrl;\n  if (path) {\n    url = defaultPathSerializer({ path, url });\n  }\n  let search = query ? querySerializer(query) : \"\";\n  if (search.startsWith(\"?\")) {\n    search = search.substring(1);\n  }\n  if (search) {\n    url += `?${search}`;\n  }\n  return url;\n};\n\nexport function getValidRequestBody(options: {\n  body?: unknown;\n  bodySerializer?: BodySerializer | null;\n  serializedBody?: unknown;\n}): unknown {\n  const hasBody = options.body !== undefined;\n  const isSerializedBody = hasBody && options.bodySerializer;\n\n  if (isSerializedBody) {\n    if (\"serializedBody\" in options) {\n      const hasSerializedBody =\n        options.serializedBody !== undefined && options.serializedBody !== \"\";\n\n      return hasSerializedBody ? options.serializedBody : null;\n    }\n\n    // not all clients implement a serializedBody property (i.e., client-axios)\n    return options.body !== \"\" ? options.body : null;\n  }\n\n  // plain/text body\n  if (hasBody) {\n    return options.body;\n  }\n\n  // no body was provided\n  return undefined;\n}\n","// This file is auto-generated by @hey-api/openapi-ts\n\nexport type AuthToken = string | undefined;\n\nexport interface Auth {\n  /**\n   * Which part of the request do we use to send the auth?\n   *\n   * @default 'header'\n   */\n  in?: \"header\" | \"query\" | \"cookie\";\n  /**\n   * A unique identifier for the security scheme.\n   *\n   * Defined only when there are multiple security schemes whose `Auth`\n   * shape would otherwise be identical.\n   */\n  key?: string;\n  /**\n   * Header or query parameter name.\n   *\n   * @default 'Authorization'\n   */\n  name?: string;\n  scheme?: \"basic\" | \"bearer\";\n  type: \"apiKey\" | \"http\";\n}\n\nexport const getAuthToken = async (\n  auth: Auth,\n  callback: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken,\n): Promise<string | undefined> => {\n  const token =\n    typeof callback === \"function\" ? await callback(auth) : callback;\n\n  if (!token) {\n    return;\n  }\n\n  if (auth.scheme === \"bearer\") {\n    return `Bearer ${token}`;\n  }\n\n  if (auth.scheme === \"basic\") {\n    return `Basic ${btoa(token)}`;\n  }\n\n  return token;\n};\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport { getAuthToken } from \"../core/auth.gen\";\nimport type { QuerySerializerOptions } from \"../core/bodySerializer.gen\";\nimport { jsonBodySerializer } from \"../core/bodySerializer.gen\";\nimport {\n  serializeArrayParam,\n  serializeObjectParam,\n  serializePrimitiveParam,\n} from \"../core/pathSerializer.gen\";\nimport { getUrl } from \"../core/utils.gen\";\nimport type {\n  Client,\n  ClientOptions,\n  Config,\n  RequestOptions,\n} from \"./types.gen\";\n\nexport const createQuerySerializer = <T = unknown>({\n  parameters = {},\n  ...args\n}: QuerySerializerOptions = {}): ((queryParams: T) => string) => {\n  const querySerializer = (queryParams: T): string => {\n    const search: string[] = [];\n    if (queryParams && typeof queryParams === \"object\") {\n      for (const name in queryParams) {\n        const value = queryParams[name];\n\n        if (value === undefined || value === null) {\n          continue;\n        }\n\n        const options = parameters[name] || args;\n\n        if (Array.isArray(value)) {\n          const serializedArray = serializeArrayParam({\n            allowReserved: options.allowReserved,\n            explode: true,\n            name,\n            style: \"form\",\n            value,\n            ...options.array,\n          });\n          if (serializedArray) search.push(serializedArray);\n        } else if (typeof value === \"object\") {\n          const serializedObject = serializeObjectParam({\n            allowReserved: options.allowReserved,\n            explode: true,\n            name,\n            style: \"deepObject\",\n            value: value as Record<string, unknown>,\n            ...options.object,\n          });\n          if (serializedObject) search.push(serializedObject);\n        } else {\n          const serializedPrimitive = serializePrimitiveParam({\n            allowReserved: options.allowReserved,\n            name,\n            value: value as string,\n          });\n          if (serializedPrimitive) search.push(serializedPrimitive);\n        }\n      }\n    }\n    return search.join(\"&\");\n  };\n  return querySerializer;\n};\n\n/**\n * Infers parseAs value from provided Content-Type header.\n */\nexport const getParseAs = (\n  contentType: string | null,\n): Exclude<Config[\"parseAs\"], \"auto\"> => {\n  if (!contentType) {\n    // If no Content-Type header is provided, the best we can do is return the raw response body,\n    // which is effectively the same as the 'stream' option.\n    return \"stream\";\n  }\n\n  const cleanContent = contentType.split(\";\")[0]?.trim();\n\n  if (!cleanContent) {\n    return;\n  }\n\n  if (\n    cleanContent.startsWith(\"application/json\") ||\n    cleanContent.endsWith(\"+json\")\n  ) {\n    return \"json\";\n  }\n\n  if (cleanContent === \"multipart/form-data\") {\n    return \"formData\";\n  }\n\n  if (\n    [\"application/\", \"audio/\", \"image/\", \"video/\"].some((type) =>\n      cleanContent.startsWith(type),\n    )\n  ) {\n    return \"blob\";\n  }\n\n  if (cleanContent.startsWith(\"text/\")) {\n    return \"text\";\n  }\n\n  return;\n};\n\nconst checkForExistence = (\n  options: Pick<RequestOptions, \"auth\" | \"query\"> & {\n    headers: Headers;\n  },\n  name?: string,\n): boolean => {\n  if (!name) {\n    return false;\n  }\n  if (\n    options.headers.has(name) ||\n    options.query?.[name] ||\n    options.headers.get(\"Cookie\")?.includes(`${name}=`)\n  ) {\n    return true;\n  }\n  return false;\n};\n\nexport async function setAuthParams(\n  options: Pick<RequestOptions, \"auth\" | \"query\" | \"security\"> & {\n    headers: Headers;\n  },\n): Promise<void> {\n  for (const auth of options.security ?? []) {\n    if (checkForExistence(options, auth.name)) {\n      continue;\n    }\n\n    const token = await getAuthToken(auth, options.auth);\n\n    if (!token) {\n      continue;\n    }\n\n    const name = auth.name ?? \"Authorization\";\n\n    switch (auth.in) {\n      case \"query\":\n        if (!options.query) {\n          options.query = {};\n        }\n        options.query[name] = token;\n        break;\n      case \"cookie\":\n        options.headers.append(\"Cookie\", `${name}=${token}`);\n        break;\n      case \"header\":\n      default:\n        options.headers.set(name, token);\n        break;\n    }\n  }\n}\n\nexport const buildUrl: Client[\"buildUrl\"] = (options) =>\n  getUrl({\n    baseUrl: options.baseUrl as string,\n    path: options.path,\n    query: options.query,\n    querySerializer:\n      typeof options.querySerializer === \"function\"\n        ? options.querySerializer\n        : createQuerySerializer(options.querySerializer),\n    url: options.url,\n  });\n\nexport const mergeConfigs = (a: Config, b: Config): Config => {\n  const config = { ...a, ...b };\n  if (config.baseUrl?.endsWith(\"/\")) {\n    config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1);\n  }\n  config.headers = mergeHeaders(a.headers, b.headers);\n  return config;\n};\n\nconst headersEntries = (headers: Headers): Array<[string, string]> => {\n  const entries: Array<[string, string]> = [];\n  headers.forEach((value, key) => {\n    entries.push([key, value]);\n  });\n  return entries;\n};\n\nexport const mergeHeaders = (\n  ...headers: Array<Required<Config>[\"headers\"] | undefined>\n): Headers => {\n  const mergedHeaders = new Headers();\n  for (const header of headers) {\n    if (!header) {\n      continue;\n    }\n\n    const iterator =\n      header instanceof Headers\n        ? headersEntries(header)\n        : Object.entries(header);\n\n    for (const [key, value] of iterator) {\n      if (value === null) {\n        mergedHeaders.delete(key);\n      } else if (Array.isArray(value)) {\n        for (const v of value) {\n          mergedHeaders.append(key, v as string);\n        }\n      } else if (value !== undefined) {\n        // assume object headers are meant to be JSON stringified, i.e., their\n        // content value in OpenAPI specification is 'application/json'\n        mergedHeaders.set(\n          key,\n          typeof value === \"object\" ? JSON.stringify(value) : (value as string),\n        );\n      }\n    }\n  }\n  return mergedHeaders;\n};\n\ntype ErrInterceptor<Err, Res, Req, Options> = (\n  error: Err,\n  /** response may be undefined due to a network error where no response object is produced */\n  response: Res | undefined,\n  /** request may be undefined, because error may be from building the request object itself */\n  request: Req | undefined,\n  options: Options,\n) => Err | Promise<Err>;\n\ntype ReqInterceptor<Req, Options> = (\n  request: Req,\n  options: Options,\n) => Req | Promise<Req>;\n\ntype ResInterceptor<Res, Req, Options> = (\n  response: Res,\n  request: Req,\n  options: Options,\n) => Res | Promise<Res>;\n\nclass Interceptors<Interceptor> {\n  fns: Array<Interceptor | null> = [];\n\n  clear(): void {\n    this.fns = [];\n  }\n\n  eject(id: number | Interceptor): void {\n    const index = this.getInterceptorIndex(id);\n    if (this.fns[index]) {\n      this.fns[index] = null;\n    }\n  }\n\n  exists(id: number | Interceptor): boolean {\n    const index = this.getInterceptorIndex(id);\n    return Boolean(this.fns[index]);\n  }\n\n  getInterceptorIndex(id: number | Interceptor): number {\n    if (typeof id === \"number\") {\n      return this.fns[id] ? id : -1;\n    }\n    return this.fns.indexOf(id);\n  }\n\n  update(\n    id: number | Interceptor,\n    fn: Interceptor,\n  ): number | Interceptor | false {\n    const index = this.getInterceptorIndex(id);\n    if (this.fns[index]) {\n      this.fns[index] = fn;\n      return id;\n    }\n    return false;\n  }\n\n  use(fn: Interceptor): number {\n    this.fns.push(fn);\n    return this.fns.length - 1;\n  }\n}\n\nexport interface Middleware<Req, Res, Err, Options> {\n  error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;\n  request: Interceptors<ReqInterceptor<Req, Options>>;\n  response: Interceptors<ResInterceptor<Res, Req, Options>>;\n}\n\nexport const createInterceptors = <Req, Res, Err, Options>(): Middleware<\n  Req,\n  Res,\n  Err,\n  Options\n> => ({\n  error: new Interceptors<ErrInterceptor<Err, Res, Req, Options>>(),\n  request: new Interceptors<ReqInterceptor<Req, Options>>(),\n  response: new Interceptors<ResInterceptor<Res, Req, Options>>(),\n});\n\nconst defaultQuerySerializer = createQuerySerializer({\n  allowReserved: false,\n  array: {\n    explode: true,\n    style: \"form\",\n  },\n  object: {\n    explode: true,\n    style: \"deepObject\",\n  },\n});\n\nconst defaultHeaders = {\n  \"Content-Type\": \"application/json\",\n};\n\nexport const createConfig = <T extends ClientOptions = ClientOptions>(\n  override: Config<Omit<ClientOptions, keyof T> & T> = {},\n): Config<Omit<ClientOptions, keyof T> & T> => ({\n  ...jsonBodySerializer,\n  headers: defaultHeaders,\n  parseAs: \"auto\",\n  querySerializer: defaultQuerySerializer,\n  ...override,\n});\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport { createSseClient } from \"../core/serverSentEvents.gen\";\nimport type { HttpMethod } from \"../core/types.gen\";\nimport { getValidRequestBody } from \"../core/utils.gen\";\nimport type {\n  Client,\n  Config,\n  RequestOptions,\n  ResolvedRequestOptions,\n} from \"./types.gen\";\nimport {\n  buildUrl,\n  createConfig,\n  createInterceptors,\n  getParseAs,\n  mergeConfigs,\n  mergeHeaders,\n  setAuthParams,\n} from \"./utils.gen\";\n\ntype ReqInit = Omit<RequestInit, \"body\" | \"headers\"> & {\n  body?: any;\n  headers: ReturnType<typeof mergeHeaders>;\n};\n\nexport const createClient = (config: Config = {}): Client => {\n  let _config = mergeConfigs(createConfig(), config);\n\n  const getConfig = (): Config => ({ ..._config });\n\n  const setConfig = (config: Config): Config => {\n    _config = mergeConfigs(_config, config);\n    return getConfig();\n  };\n\n  const interceptors = createInterceptors<\n    Request,\n    Response,\n    unknown,\n    ResolvedRequestOptions\n  >();\n\n  const beforeRequest = async <\n    TData = unknown,\n    TResponseStyle extends \"data\" | \"fields\" = \"fields\",\n    ThrowOnError extends boolean = boolean,\n    Url extends string = string,\n  >(\n    options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>,\n  ) => {\n    const opts = {\n      ..._config,\n      ...options,\n      fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,\n      headers: mergeHeaders(_config.headers, options.headers),\n      serializedBody: undefined as string | undefined,\n    };\n\n    if (opts.security) {\n      await setAuthParams(opts);\n    }\n\n    if (opts.requestValidator) {\n      await opts.requestValidator(opts);\n    }\n\n    if (opts.body !== undefined && opts.bodySerializer) {\n      opts.serializedBody = opts.bodySerializer(opts.body) as\n        string | undefined;\n    }\n\n    // remove Content-Type header if body is empty to avoid sending invalid requests\n    if (opts.body === undefined || opts.serializedBody === \"\") {\n      opts.headers.delete(\"Content-Type\");\n    }\n\n    const resolvedOpts = opts as typeof opts &\n      ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>;\n    const url = buildUrl(resolvedOpts);\n\n    return { opts: resolvedOpts, url };\n  };\n\n  const request: Client[\"request\"] = async (options) => {\n    const throwOnError = options.throwOnError ?? _config.throwOnError;\n    const responseStyle = options.responseStyle ?? _config.responseStyle;\n\n    let request: Request | undefined;\n    let response: Response | undefined;\n\n    try {\n      const { opts, url } = await beforeRequest(options);\n      const requestInit: ReqInit = {\n        redirect: \"follow\",\n        ...opts,\n        body: getValidRequestBody(opts),\n      };\n\n      request = new Request(url, requestInit);\n\n      for (const fn of interceptors.request.fns) {\n        if (fn) {\n          request = await fn(request, opts);\n        }\n      }\n\n      // fetch must be assigned here, otherwise it would throw the error:\n      // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation\n      const _fetch = opts.fetch!;\n\n      response = await _fetch(request);\n\n      for (const fn of interceptors.response.fns) {\n        if (fn) {\n          response = await fn(response, request, opts);\n        }\n      }\n\n      const result = {\n        request,\n        response,\n      };\n\n      if (response.ok) {\n        const parseAs =\n          (opts.parseAs === \"auto\"\n            ? getParseAs(response.headers.get(\"Content-Type\"))\n            : opts.parseAs) ?? \"json\";\n\n        if (\n          response.status === 204 ||\n          response.headers.get(\"Content-Length\") === \"0\"\n        ) {\n          let emptyData: any;\n          switch (parseAs) {\n            case \"arrayBuffer\":\n            case \"blob\":\n            case \"text\":\n              emptyData = await response[parseAs]();\n              break;\n            case \"formData\":\n              emptyData = new FormData();\n              break;\n            case \"stream\":\n              emptyData = response.body;\n              break;\n            case \"json\":\n            default:\n              emptyData = {};\n              break;\n          }\n          return opts.responseStyle === \"data\"\n            ? emptyData\n            : {\n                data: emptyData,\n                ...result,\n              };\n        }\n\n        let data: any;\n        switch (parseAs) {\n          case \"arrayBuffer\":\n          case \"blob\":\n          case \"formData\":\n          case \"text\":\n            data = await response[parseAs]();\n            break;\n          case \"json\": {\n            // Some servers return 200 with no Content-Length and empty body.\n            // response.json() would throw; read as text and parse if non-empty.\n            const text = await response.text();\n            data = text ? JSON.parse(text) : {};\n            break;\n          }\n          case \"stream\":\n            return opts.responseStyle === \"data\"\n              ? response.body\n              : {\n                  data: response.body,\n                  ...result,\n                };\n        }\n\n        if (parseAs === \"json\") {\n          if (opts.responseValidator) {\n            await opts.responseValidator(data);\n          }\n\n          if (opts.responseTransformer) {\n            data = await opts.responseTransformer(data);\n          }\n        }\n\n        return opts.responseStyle === \"data\"\n          ? data\n          : {\n              data,\n              ...result,\n            };\n      }\n\n      const textError = await response.text();\n      let jsonError: unknown;\n\n      try {\n        jsonError = JSON.parse(textError);\n      } catch {\n        // noop\n      }\n\n      throw jsonError ?? textError;\n    } catch (error) {\n      let finalError = error;\n\n      for (const fn of interceptors.error.fns) {\n        if (fn) {\n          finalError = await fn(\n            finalError,\n            response,\n            request,\n            options as ResolvedRequestOptions,\n          );\n        }\n      }\n\n      finalError = finalError || {};\n\n      if (throwOnError) {\n        throw finalError;\n      }\n\n      // TODO: we probably want to return error and improve types\n      return responseStyle === \"data\"\n        ? undefined\n        : {\n            error: finalError,\n            request,\n            response,\n          };\n    }\n  };\n\n  const makeMethodFn =\n    (method: Uppercase<HttpMethod>) => (options: RequestOptions) =>\n      request({ ...options, method });\n\n  const makeSseFn =\n    (method: Uppercase<HttpMethod>) => async (options: RequestOptions) => {\n      const { opts, url } = await beforeRequest(options);\n      return createSseClient({\n        ...opts,\n        body: opts.body as BodyInit | null | undefined,\n        method,\n        onRequest: async (url, init) => {\n          let request = new Request(url, init);\n          for (const fn of interceptors.request.fns) {\n            if (fn) {\n              request = await fn(request, opts);\n            }\n          }\n          return request;\n        },\n        serializedBody: getValidRequestBody(opts) as\n          BodyInit | null | undefined,\n        url,\n      });\n    };\n\n  const _buildUrl: Client[\"buildUrl\"] = (options) =>\n    buildUrl({ ..._config, ...options });\n\n  return {\n    buildUrl: _buildUrl,\n    connect: makeMethodFn(\"CONNECT\"),\n    delete: makeMethodFn(\"DELETE\"),\n    get: makeMethodFn(\"GET\"),\n    getConfig,\n    head: makeMethodFn(\"HEAD\"),\n    interceptors,\n    options: makeMethodFn(\"OPTIONS\"),\n    patch: makeMethodFn(\"PATCH\"),\n    post: makeMethodFn(\"POST\"),\n    put: makeMethodFn(\"PUT\"),\n    request,\n    setConfig,\n    sse: {\n      connect: makeSseFn(\"CONNECT\"),\n      delete: makeSseFn(\"DELETE\"),\n      get: makeSseFn(\"GET\"),\n      head: makeSseFn(\"HEAD\"),\n      options: makeSseFn(\"OPTIONS\"),\n      patch: makeSseFn(\"PATCH\"),\n      post: makeSseFn(\"POST\"),\n      put: makeSseFn(\"PUT\"),\n      trace: makeSseFn(\"TRACE\"),\n    },\n    trace: makeMethodFn(\"TRACE\"),\n  } as Client;\n};\n","// API keys encode their region as bk_{region}_{token}, so the client can route\n// to {region}.platform.bird.com automatically.\n\nconst REGION_PATTERN = /^[a-z]{2}[0-9]+$/;\n\n/** Extracts the region code from a `bk_{region}_{token}` key, or undefined. */\nexport function regionFromApiKey(apiKey: string): string | undefined {\n  const [prefix, region, token] = apiKey.split(\"_\");\n  if (prefix !== \"bk\" || !region || !token) return undefined;\n  return REGION_PATTERN.test(region) ? region : undefined;\n}\n\nexport function baseUrlForRegion(region: string): string {\n  return `https://${region}.platform.bird.com`;\n}\n","// Code generated by beak gen:caller-detection from clients/caller-detection.yaml. DO NOT EDIT.\n\nexport interface CallerRule {\n  env: string;\n  equals?: string;\n  name?: string;\n  passthrough?: boolean;\n}\n\nexport const callerRules: CallerRule[] = [\n  { env: \"CLAUDECODE\", name: \"claude-code\" },\n  { env: \"CODEX_CI\", name: \"codex\" },\n  { env: \"GEMINI_CLI\", name: \"gemini\" },\n  { env: \"QWEN_CODE\", name: \"qwen\" },\n  { env: \"PI_CODING_AGENT\", name: \"pi\" },\n  { env: \"OPENCODE\", name: \"opencode\" },\n  { env: \"CLINE_ACTIVE\", name: \"cline\" },\n  { env: \"ROO_ACTIVE\", name: \"roo\" },\n  { env: \"CURSOR_TRACE_ID\", name: \"cursor\" },\n  { env: \"CURSOR_AGENT\", name: \"cursor\" },\n  { env: \"ANTIGRAVITY_AGENT\", name: \"antigravity\" },\n  { env: \"AUGMENT_AGENT\", name: \"augment\" },\n  { env: \"AGENT\", passthrough: true },\n  { env: \"AI_AGENT\", passthrough: true },\n  { env: \"REPL_ID\", name: \"replit\" },\n  { env: \"CI\", name: \"ci\" },\n  { env: \"GITHUB_ACTIONS\", name: \"ci\" },\n  { env: \"TERM_PROGRAM\", equals: \"zed\", name: \"zed\" },\n  { env: \"ZED_TERM\", name: \"zed\" },\n  { env: \"TERM_PROGRAM\", equals: \"kiro\", name: \"kiro\" },\n  { env: \"TERM_PROGRAM\", equals: \"WarpTerminal\", name: \"warp\" },\n  { env: \"TERMINAL_EMULATOR\", equals: \"JetBrains-JediTerm\", name: \"jetbrains\" },\n  { env: \"__CFBundleIdentifier\", equals: \"com.exafunction.windsurf\", name: \"windsurf\" },\n  { env: \"TERM_PROGRAM\", equals: \"vscode\", name: \"vscode\" },\n];\n\nexport const callerBooleanishSkip: ReadonlySet<string> = new Set([\"1\", \"0\", \"true\", \"false\", \"yes\", \"no\", \"on\", \"off\"]);\n\nexport const callerDefault = \"shell\";\n","import { callerRules, callerBooleanishSkip, callerDefault } from \"./caller-rules.gen.js\";\n\n/**\n * Infers the environment driving the SDK for the `Bird-Caller` usage-telemetry\n * label by walking the generated rules in order (single source of truth:\n * `clients/caller-detection.yaml`, shared with the CLI and the other SDKs).\n * Best-effort and non-authoritative — it only labels traffic, never gates\n * behavior.\n *\n * Edge-safe: `process` is read only through a `typeof`-style `globalThis` guard,\n * so on a browser (no `process.env`) it returns `\"\"` and the client sends no\n * `Bird-Caller` header. `env` is injected in tests.\n */\nexport function detectCaller(env?: Record<string, string | undefined>): string {\n  // Tests / explicit callers pass `env`. Otherwise derive it from a *real* Node\n  // process only: a browser — including one whose bundler polyfills an empty\n  // `process.env` — has no agent, so we return \"\" (no header) rather than falling\n  // through to the shell default. A genuine Node process always sets\n  // `process.versions.node`; polyfills do not.\n  let source = env;\n  if (source === undefined) {\n    const proc = (\n      globalThis as {\n        process?: { env?: Record<string, string | undefined>; versions?: { node?: string } };\n      }\n    ).process;\n    if (proc?.versions?.node === undefined) return \"\";\n    source = proc.env ?? {};\n  }\n  for (const rule of callerRules) {\n    const value = source[rule.env];\n    if (value === undefined || value === \"\" || (rule.equals !== undefined && value !== rule.equals)) {\n      continue;\n    }\n    if (!rule.passthrough) return rule.name as string;\n    const sanitized = sanitizeCaller(value);\n    if (sanitized) return sanitized;\n  }\n  return callerDefault;\n}\n\n// Lowercases and bounds a passthrough (AGENT=<name>) value the same charset+length\n// way as the other Bird-* labels, dropping boolean-ish values that carry no\n// harness identity (e.g. OpenCode sets AGENT=1).\nfunction sanitizeCaller(value: string): string {\n  const s = value.trim().toLowerCase();\n  if (s === \"\" || s.length > 32 || callerBooleanishSkip.has(s)) return \"\";\n  return /^[a-z0-9._-]+$/.test(s) ? s : \"\";\n}\n","// Error hierarchy for the Bird SDK.\n//\n// One class per error `type` (clients branch on the coarse `type`,\n// never on individual codes). Two transport classes cover failures with no HTTP\n// response. Scalar fields on the error objects are camelCase — these are\n// SDK-constructed objects, not wire data (the Stripe/OpenAI-node convention:\n// snake data, camel code). Nested wire payloads (validation `details`) pass\n// through as-is.\n//\n// `mapResponseToError` is the single place a non-2xx response becomes a thrown\n// error; the request core calls it once a response is terminal.\n\n/** Root of the hierarchy. Catch this to catch anything the SDK throws. */\nexport class BirdError extends Error {\n  constructor(message: string) {\n    super(message);\n    this.name = \"BirdError\";\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n/** Network-level failure with no HTTP response (DNS, refused, socket hangup). */\nexport class BirdConnectionError extends BirdError {\n  constructor(message: string) {\n    super(message);\n    this.name = \"BirdConnectionError\";\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n/** A single attempt exceeded its timeout. Retryable. */\nexport class BirdTimeoutError extends BirdError {\n  readonly timeoutMs: number;\n  constructor(message: string, timeoutMs: number) {\n    super(message);\n    this.name = \"BirdTimeoutError\";\n    this.timeoutMs = timeoutMs;\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n/** A webhook payload failed signature verification (bad signature, stale timestamp, malformed headers). */\nexport class BirdWebhookVerificationError extends BirdError {\n  constructor(message: string) {\n    super(message);\n    this.name = \"BirdWebhookVerificationError\";\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n/** One per-field validation failure (the `details` array on a 422). */\nexport interface ErrorDetail {\n  /** Dotted field path, e.g. `to[0].email`, `subject`, `.`. */\n  param: string;\n  /** What is wrong with this field. */\n  message: string;\n}\n\n/**\n * One recovery step the server suggests. Read `kind` before `operation`: only an\n * `operation` step carries one.\n */\nexport interface NextAction {\n  /**\n   * What to do about this step: `operation` calls the operation named in\n   * `operation` and reads again, `external` acts somewhere this API does not\n   * reach, `wait` reads again later, `terminal` means nothing resolves this so\n   * stop retrying. A value this SDK version does not know is display-only: show\n   * `description` and offer no action.\n   */\n  kind: string;\n  /** Short human-readable label for the step, suitable for display. */\n  description: string;\n  /** operationId to call. Present only when `kind` is `operation`. */\n  operation?: string;\n  /**\n   * Parameters that address `operation`, by name — every parameter the call\n   * needs, so it can be made from this step alone. A request body, when the\n   * operation takes one, is described by the operation and never appears here.\n   */\n  params?: Record<string, string>;\n  /**\n   * A URL to open. Present only when `kind` is `external`, and only when the step\n   * has one; an external step with nothing to open is normal.\n   */\n  url?: string;\n}\n\n/** One verification requirement blocking the action, with the flow that resolves it. */\n/** Constructor fields shared by every API error, mapped from the wire body. */\nexport interface BirdAPIErrorFields {\n  statusCode: number;\n  /** Opaque, stable error code (`E#####`). */\n  code: string;\n  /** Coarse category — the value callers branch on. */\n  type: string;\n  /** Human-readable slug for logs. Paired with `code`, never replaces it. */\n  errorName: string;\n  message: string;\n  /** Stable link to the docs page for this code. */\n  docUrl: string;\n  /** Correlation ID — also the `X-Request-Id` response header. */\n  requestId: string;\n  /** Offending field, when applicable. */\n  param?: string;\n  /** Verbatim code from a downstream system (SMTP reply, payment decline). */\n  vendorCode?: string;\n  /** Human recovery line for this error, when a recovery is known. */\n  remediation?: string;\n  /** Recovery steps for this error, in the order to take them. */\n  next?: NextAction[];\n  /** Verification requirements blocking this action, when it is blocked pending verification. */\n}\n\n/** The server returned an error body. Base for every `type`-specific class. */\nexport class BirdAPIError extends BirdError {\n  readonly statusCode: number;\n  readonly code: string;\n  readonly type: string;\n  readonly errorName: string;\n  readonly docUrl: string;\n  readonly requestId: string;\n  readonly param?: string;\n  readonly vendorCode?: string;\n  readonly remediation?: string;\n  readonly next?: NextAction[];\n\n  constructor(fields: BirdAPIErrorFields) {\n    super(fields.message);\n    this.name = \"BirdAPIError\";\n    this.statusCode = fields.statusCode;\n    this.code = fields.code;\n    this.type = fields.type;\n    this.errorName = fields.errorName;\n    this.docUrl = fields.docUrl;\n    this.requestId = fields.requestId;\n    this.param = fields.param;\n    this.vendorCode = fields.vendorCode;\n    this.remediation = fields.remediation;\n    this.next = fields.next;\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n// One class per `type` enum value. The plain ones add nothing beyond the base;\n// they exist so callers can `instanceof BirdNotFoundError` rather than compare\n// strings, and so the special-field classes have peers.\n\n/** 401 — authentication failed or missing. */\nexport class BirdAuthError extends BirdAPIError {\n  constructor(fields: BirdAPIErrorFields) {\n    super(fields);\n    this.name = \"BirdAuthError\";\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n/** 403 — authenticated but not allowed. */\nexport class BirdPermissionError extends BirdAPIError {\n  constructor(fields: BirdAPIErrorFields) {\n    super(fields);\n    this.name = \"BirdPermissionError\";\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n/** 404 — resource does not exist. */\nexport class BirdNotFoundError extends BirdAPIError {\n  constructor(fields: BirdAPIErrorFields) {\n    super(fields);\n    this.name = \"BirdNotFoundError\";\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n/** 409 — semantic conflict (e.g. a unique value already taken). */\nexport class BirdConflictError extends BirdAPIError {\n  constructor(fields: BirdAPIErrorFields) {\n    super(fields);\n    this.name = \"BirdConflictError\";\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n/** 400 — malformed request. */\nexport class BirdBadRequestError extends BirdAPIError {\n  constructor(fields: BirdAPIErrorFields) {\n    super(fields);\n    this.name = \"BirdBadRequestError\";\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n/** 402 — billing/balance problem. */\nexport class BirdBillingError extends BirdAPIError {\n  constructor(fields: BirdAPIErrorFields) {\n    super(fields);\n    this.name = \"BirdBillingError\";\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n/** 412/428 — a precondition was not met. */\nexport class BirdPreconditionError extends BirdAPIError {\n  constructor(fields: BirdAPIErrorFields) {\n    super(fields);\n    this.name = \"BirdPreconditionError\";\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n/** 413 — request body too large. */\nexport class BirdPayloadTooLargeError extends BirdAPIError {\n  constructor(fields: BirdAPIErrorFields) {\n    super(fields);\n    this.name = \"BirdPayloadTooLargeError\";\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n/** 500 — unexpected server error. */\nexport class BirdInternalError extends BirdAPIError {\n  constructor(fields: BirdAPIErrorFields) {\n    super(fields);\n    this.name = \"BirdInternalError\";\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n/** 501 — endpoint not implemented. */\nexport class BirdNotImplementedError extends BirdAPIError {\n  constructor(fields: BirdAPIErrorFields) {\n    super(fields);\n    this.name = \"BirdNotImplementedError\";\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n/** 421 — request reached the wrong region. */\nexport class BirdMisdirectedError extends BirdAPIError {\n  constructor(fields: BirdAPIErrorFields) {\n    super(fields);\n    this.name = \"BirdMisdirectedError\";\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n/** 503 — service temporarily unavailable. */\nexport class BirdServiceUnavailableError extends BirdAPIError {\n  constructor(fields: BirdAPIErrorFields) {\n    super(fields);\n    this.name = \"BirdServiceUnavailableError\";\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n/** 422 — field validation failed; `details` carries the per-field errors. */\nexport class BirdValidationError extends BirdAPIError {\n  readonly details: ErrorDetail[];\n  constructor(fields: BirdAPIErrorFields & { details: ErrorDetail[] }) {\n    super(fields);\n    this.name = \"BirdValidationError\";\n    this.details = fields.details;\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n/** 429 — rate limited; `retryAfter` is the server-advised wait in seconds. */\nexport class BirdRateLimitError extends BirdAPIError {\n  readonly retryAfter?: number;\n  constructor(fields: BirdAPIErrorFields & { retryAfter?: number }) {\n    super(fields);\n    this.name = \"BirdRateLimitError\";\n    this.retryAfter = fields.retryAfter;\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\n/** Shape of the wire error body (`ErrorBody`), snake_case as sent. */\ninterface WireErrorBody {\n  type?: string;\n  code?: string;\n  name?: string;\n  message?: string;\n  doc_url?: string;\n  request_id?: string;\n  param?: string;\n  vendor_code?: string;\n  details?: ErrorDetail[];\n  remediation?: string;\n  next?: NextAction[];\n}\n\n/**\n * Parse `Retry-After` (delta-seconds or HTTP-date) into whole seconds. A\n * negative or unparseable value yields `undefined` — a negative wait is\n * meaningless, so both the user-facing `retryAfter` and the retry loop treat it\n * as \"no server advice\". The single Retry-After parser; `retryDelay` builds on it.\n */\nexport function parseRetryAfter(headers?: Headers): number | undefined {\n  const header = headers?.get(\"Retry-After\");\n  if (!header) return undefined;\n  const seconds = Number(header);\n  const value = Number.isFinite(seconds)\n    ? seconds\n    : (Date.parse(header) - Date.now()) / 1000;\n  return Number.isFinite(value) && value >= 0 ? Math.round(value) : undefined;\n}\n\n// Status → type fallback for non-JSON error bodies (proxy 502s, etc.) where the\n// body carries no `type`.\nfunction inferType(status: number): string {\n  switch (status) {\n    case 400:\n      return \"bad_request_error\";\n    case 401:\n      return \"auth_error\";\n    case 402:\n      return \"billing_error\";\n    case 403:\n      return \"permission_error\";\n    case 404:\n      return \"not_found_error\";\n    case 409:\n      return \"conflict_error\";\n    case 412:\n    case 428:\n      return \"precondition_error\";\n    case 413:\n      return \"payload_too_large_error\";\n    case 421:\n      return \"misdirected_error\";\n    case 422:\n      return \"validation_error\";\n    case 429:\n      return \"rate_limit_error\";\n    case 501:\n      return \"not_implemented_error\";\n    case 503:\n      return \"service_unavailable_error\";\n    default:\n      return status >= 500 ? \"internal_error\" : \"bad_request_error\";\n  }\n}\n\n/**\n * Map a non-2xx response to the right `BirdAPIError` subclass. The single place\n * the SDK turns a wire error into a thrown error.\n */\nexport function mapResponseToError(\n  status: number,\n  body: unknown,\n  headers?: Headers,\n): BirdAPIError {\n  // The API wraps errors as `{ \"error\": { … } }`; unwrap it (tolerating a bare\n  // top-level body and a non-object body) so the wire type/code/message/request_id\n  // are read, not defaulted. Without this the type was only ever inferred from the\n  // HTTP status and code/request_id were dropped.\n  const raw = (body ?? {}) as Record<string, unknown>;\n  const b =\n    (raw.error as WireErrorBody | undefined) ?? (raw as WireErrorBody) ?? {};\n  const fields: BirdAPIErrorFields = {\n    statusCode: status,\n    code: b.code ?? \"unknown\",\n    type: b.type ?? inferType(status),\n    errorName: b.name ?? \"\",\n    message: b.message ?? `Request failed with status ${status}`,\n    docUrl: b.doc_url ?? \"\",\n    requestId: b.request_id ?? headers?.get(\"X-Request-Id\") ?? \"\",\n    param: b.param,\n    vendorCode: b.vendor_code,\n    remediation: b.remediation,\n    next: b.next ?? [], // normalize a null/absent wire `next` to [] so callers can always iterate\n  };\n\n  switch (fields.type) {\n    case \"auth_error\":\n      return new BirdAuthError(fields);\n    case \"permission_error\":\n      return new BirdPermissionError(fields);\n    case \"not_found_error\":\n      return new BirdNotFoundError(fields);\n    case \"conflict_error\":\n      return new BirdConflictError(fields);\n    case \"bad_request_error\":\n      return new BirdBadRequestError(fields);\n    case \"billing_error\":\n      return new BirdBillingError(fields);\n    case \"precondition_error\":\n      return new BirdPreconditionError(fields);\n    case \"payload_too_large_error\":\n      return new BirdPayloadTooLargeError(fields);\n    case \"internal_error\":\n      return new BirdInternalError(fields);\n    case \"not_implemented_error\":\n      return new BirdNotImplementedError(fields);\n    case \"misdirected_error\":\n      return new BirdMisdirectedError(fields);\n    case \"service_unavailable_error\":\n      return new BirdServiceUnavailableError(fields);\n    case \"rate_limit_error\":\n      return new BirdRateLimitError({\n        ...fields,\n        retryAfter: parseRetryAfter(headers),\n      });\n    case \"validation_error\":\n      return new BirdValidationError({ ...fields, details: b.details ?? [] });\n    default:\n      return new BirdAPIError(fields);\n  }\n}\n","// The request lifecycle: retries, timeouts, and idempotency.\n//\n// BirdHTTPClient owns the attempt loop and wraps a generated hey-api SDK call\n// (passed as a thunk) so resources keep the generated call-site typing while\n// the loop owns: idempotency-key generate-once-and-reuse, per-attempt timeout,\n// AbortSignal, backoff with full jitter + Retry-After, and turning a terminal\n// response into a thrown BirdError via mapResponseToError.\n//\n// The hey-api client is configured WITHOUT throwOnError: a non-2xx returns\n// `{ error, response }` so this loop can inspect status and decide\n// retry-vs-throw. Network failures reject and are caught here.\n\nimport {\n  BirdConnectionError,\n  BirdError,\n  BirdTimeoutError,\n  mapResponseToError,\n  parseRetryAfter,\n} from \"../errors.js\";\n\n/** Transport metadata exposed to callers via `.withResponse()`. */\nexport interface BirdResponse {\n  status: number;\n  headers: Headers;\n  /** Correlation ID — the `X-Request-Id` header. */\n  requestId: string;\n}\n\n/** Per-request lifecycle inputs, supplied by the resource method. */\nexport interface RequestLifecycleOptions {\n  /** HTTP method — decides idempotency-key generation and retry safety. */\n  method: string;\n  /** Caller-supplied idempotency key; auto-generated for mutations if absent. */\n  idempotencyKey?: string;\n  /** Caller cancellation. */\n  signal?: AbortSignal;\n  /** Per-attempt timeout (ms). Overrides the client default. */\n  timeout?: number;\n  /** Max retry attempts. Overrides the client default. */\n  maxRetries?: number;\n}\n\n/** The shape a generated hey-api SDK call resolves to. */\nexport interface FetchOutcome<T> {\n  data?: T;\n  error?: unknown;\n  /** Present whenever the HTTP round-trip completed; absent only on a rejected call. */\n  response?: Response;\n}\n\n/** Context handed to the call thunk on each attempt. */\nexport interface AttemptContext {\n  signal: AbortSignal;\n  idempotencyKey?: string;\n}\n\nexport interface CoreDefaults {\n  /** Per-attempt timeout (ms). */\n  timeout: number;\n  /** Max retry attempts. */\n  maxRetries: number;\n  /**\n   * Extra credentials some operations require on top of the API key, keyed by the\n   * security scheme that names them. A generated method names the schemes its\n   * operation declares; the core resolves them, so a credential reaches only\n   * those operations and never an unrelated request.\n   */\n  credentials?: Record<string, { header: string; value?: string; how: string }>;\n}\n\nconst BACKOFF_BASE_MS = 500;\nconst BACKOFF_CAP_MS = 8_000;\nconst RETRY_AFTER_CAP_MS = 60_000;\n\nexport class BirdHTTPClient {\n  constructor(private readonly defaults: CoreDefaults) {}\n\n  /**\n   * Resolve the credential headers an operation's security schemes require.\n   * Throws before the request when one is unconfigured, so a caller gets a named\n   * error instead of a 401.\n   */\n  credentialHeaders(\n    schemes: string[] | undefined,\n    override?: Record<string, string>,\n  ): Record<string, string> {\n    if (!schemes?.length) return {};\n    const out: Record<string, string> = {};\n    for (const scheme of schemes) {\n      const cred = this.defaults.credentials?.[scheme];\n      if (!cred) throw new Error(`Unknown credential scheme \"${scheme}\"`);\n      const value = override?.[scheme] ?? cred.value;\n      if (!value) throw new Error(`${cred.header} is required for this operation. ${cred.how}`);\n      out[cred.header] = value;\n    }\n    return out;\n  }\n\n  /**\n   * Run a generated hey-api SDK call through the request lifecycle.\n   *\n   * @param call  Invokes the SDK function; receives the per-attempt signal and\n   *              the idempotency key to set as a header.\n   * @returns the parsed body plus transport metadata.\n   * @throws  a `BirdError` subclass on terminal failure; the native\n   *          `AbortError` if the caller's signal aborts.\n   */\n  async request<T>(\n    call: (ctx: AttemptContext) => Promise<FetchOutcome<T>>,\n    options: RequestLifecycleOptions,\n  ): Promise<{ data: T; response: BirdResponse }> {\n    const maxRetries = options.maxRetries ?? this.defaults.maxRetries;\n    const timeout = options.timeout ?? this.defaults.timeout;\n    // Generated once, reused on every attempt — regenerating would double-execute.\n    const idempotencyKey =\n      options.idempotencyKey ??\n      (isMutation(options.method) ? crypto.randomUUID() : undefined);\n\n    for (let attempt = 0; ; attempt++) {\n      throwIfAborted(options.signal);\n\n      // Retry a transient failure with backoff if attempts remain; otherwise\n      // throw the terminal error. Caller `continue`s the loop after this returns.\n      const retryOrThrow = async (terminal: () => BirdError): Promise<void> => {\n        if (attempt >= maxRetries) throw terminal();\n        await sleep(backoffDelay(attempt), options.signal);\n      };\n\n      const timeoutSignal = AbortSignal.timeout(timeout);\n      const signal = options.signal\n        ? AbortSignal.any([options.signal, timeoutSignal])\n        : timeoutSignal;\n\n      let outcome: FetchOutcome<T> | undefined;\n      try {\n        outcome = await call({ signal, idempotencyKey });\n      } catch (err) {\n        // The fetch rejected: caller abort, per-attempt timeout, or network.\n        throwIfAborted(options.signal); // caller abort wins, terminal\n        await retryOrThrow(() =>\n          timeoutSignal.aborted\n            ? new BirdTimeoutError(`Request timed out after ${timeout}ms`, timeout)\n            : new BirdConnectionError(errorMessage(err)),\n        );\n        continue;\n      }\n\n      const res = outcome.response;\n      if (!res) {\n        // A resolved call with no response is a transport failure (the client\n        // normally rejects instead) — treat it like a network error.\n        await retryOrThrow(() => new BirdConnectionError(\"No response received from the server\"));\n        continue;\n      }\n      if (res.ok) {\n        return { data: outcome.data as T, response: toBirdResponse(res) };\n      }\n      if (!isRetryableStatus(res.status) || attempt >= maxRetries) {\n        throw mapResponseToError(res.status, outcome.error, res.headers);\n      }\n      await sleep(retryDelay(attempt, res.headers), options.signal);\n    }\n  }\n}\n\nfunction isMutation(method: string): boolean {\n  return [\"POST\", \"PATCH\", \"DELETE\"].includes(method.toUpperCase());\n}\n\n// Retry network failures, per-attempt timeouts, and transient statuses. 409 is a\n// semantic conflict a retry can't resolve; 501 is permanent; other 4xx are\n// deterministic.\nfunction isRetryableStatus(status: number): boolean {\n  return [408, 429, 500, 502, 503, 504].includes(status);\n}\n\n/** Full-jitter exponential backoff: random in [0, min(cap, base·2^attempt)). */\nfunction backoffDelay(attempt: number): number {\n  const ceiling = Math.min(BACKOFF_CAP_MS, BACKOFF_BASE_MS * 2 ** attempt);\n  return Math.random() * ceiling;\n}\n\n/** Honor Retry-After on a retryable response, else fall back to backoff. */\nfunction retryDelay(attempt: number, headers: Headers): number {\n  const seconds = parseRetryAfter(headers);\n  return seconds === undefined ? backoffDelay(attempt) : Math.min(seconds * 1000, RETRY_AFTER_CAP_MS);\n}\n\nfunction toBirdResponse(res: Response): BirdResponse {\n  return {\n    status: res.status,\n    headers: res.headers,\n    requestId: res.headers.get(\"X-Request-Id\") ?? \"\",\n  };\n}\n\n// The abort contract: surface the caller's `signal.reason` so a caller-initiated\n// abort stays the native AbortError, falling back to a synthetic one.\nfunction abortReason(signal: AbortSignal | undefined): unknown {\n  return signal?.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n}\n\nfunction throwIfAborted(signal: AbortSignal | undefined): void {\n  if (signal?.aborted) throw abortReason(signal);\n}\n\n/** Sleep, rejecting immediately if the caller's signal aborts. */\nfunction sleep(ms: number, signal: AbortSignal | undefined): Promise<void> {\n  return new Promise((resolve, reject) => {\n    if (signal?.aborted) {\n      reject(abortReason(signal));\n      return;\n    }\n    const timer = setTimeout(() => {\n      signal?.removeEventListener(\"abort\", onAbort);\n      resolve();\n    }, ms);\n    const onAbort = () => {\n      clearTimeout(timer);\n      reject(abortReason(signal));\n    };\n    signal?.addEventListener(\"abort\", onAbort, { once: true });\n  });\n}\n\nfunction errorMessage(err: unknown): string {\n  if (err instanceof Error) return err.message;\n  return String(err);\n}\n","// What resource methods return: a Promise you can await for the value, plus\n// `.withResponse()` for transport metadata and `.safe()` for a non-throwing\n// `{ data, error, response }` result (errors throw by default,\n// `.safe()` is the opt-in result form). Pagination follows R1: awaiting a list yields the\n// first page; `for await` walks every item across pages, fetching lazily.\n\nimport type { BirdResponse } from \"./http.js\";\nimport { BirdError } from \"../errors.js\";\n\n/** Per-request overrides accepted by every resource method. */\nexport interface RequestOptions {\n  /**\n   * Per-call override for the extra credentials an operation requires, keyed by\n   * security scheme (`{ RealtimeKey: \"…\", RealtimeSecret: \"…\" }`). Overrides the\n   * client config for this call, so one client can address several apps.\n   */\n  credentials?: Record<string, string>;\n\n  /** Idempotency key; auto-generated for mutations if omitted, reused on retry. */\n  idempotencyKey?: string;\n  /** Caller cancellation. Rejects with the native `AbortError`. */\n  signal?: AbortSignal;\n  /** Per-attempt timeout (ms). Overrides the client default. */\n  timeout?: number;\n  /** Max retry attempts. Overrides the client default. */\n  maxRetries?: number;\n  /** Extra headers for this request. SDK-internal headers win on conflict. */\n  headers?: Record<string, string>;\n}\n\n/**\n * The result of `.safe()` — the value or the error, never thrown. On success\n * `data` and the `response` envelope are present and `error` is `null`. On\n * failure `error` is a `BirdError` you can `instanceof`-narrow, and `data`/\n * `response` are `null` — the metadata you need (status, request id) is on the\n * error itself. A caller-initiated abort is not a Bird failure and still throws\n * (the native `AbortError`).\n */\nexport type SafeResult<T> =\n  | { data: T; error: null; response: BirdResponse }\n  | { data: null; error: BirdError; response: null };\n\n/** Single-result return: `await` for the value, `.withResponse()` for metadata. */\nexport interface APIPromise<T> extends Promise<T> {\n  withResponse(): Promise<{ data: T; response: BirdResponse }>;\n  /** Resolve to `{ data, error }` instead of throwing. */\n  safe(): Promise<SafeResult<T>>;\n}\n\n// Build the base `await`→data promise shared by both wrappers and wire its\n// `.withResponse()`/`.safe()` views onto `inner`.\n//\n// `.withResponse()` and `.safe()` consume `inner` directly, so when a caller\n// uses one of those (or fires-and-forgets) this base promise is never awaited.\n// Mark its rejection handled — the chosen view still surfaces the error — so a\n// failed call isn't flagged as an unhandled rejection.\nfunction basePromise<T, P extends APIPromise<T>>(\n  inner: Promise<{ data: T; response: BirdResponse }>,\n): P {\n  const promise = inner.then((r) => r.data) as P;\n  void promise.catch(() => {});\n  promise.withResponse = () => inner;\n  promise.safe = () => toSafe(inner);\n  return promise;\n}\n\nexport function apiPromise<T>(\n  inner: Promise<{ data: T; response: BirdResponse }>,\n): APIPromise<T> {\n  return basePromise(inner);\n}\n\n/** One cursor-paginated page — the wire envelope shape (snake), verbatim. */\nexport interface CursorPage<T> {\n  data: T[];\n  /** Pass back as `starting_after` to advance. Null at the end. */\n  next_cursor: string | null;\n  /** Pass back as `ending_before` to step back. Null at the start. */\n  prev_cursor: string | null;\n  /** Refresh anchor; pass as `ending_before` later for items since this page. */\n  refresh_cursor: string | null;\n  /** Total across all pages — only when `include_total=true` was passed. */\n  total?: number | null;\n}\n\n/**\n * List return (R1): `await` resolves the first page; `for await` walks every\n * item across all pages, fetching subsequent pages lazily.\n */\nexport interface PaginatedPromise<T> extends Promise<CursorPage<T>>, AsyncIterable<T> {\n  withResponse(): Promise<{ data: CursorPage<T>; response: BirdResponse }>;\n  /** Resolve the first page as `{ data, error }` instead of throwing. */\n  safe(): Promise<SafeResult<CursorPage<T>>>;\n}\n\nexport function paginate<T>(\n  fetchPage: (cursor?: string) => Promise<{ data: CursorPage<T>; response: BirdResponse }>,\n): PaginatedPromise<T> {\n  const first = fetchPage();\n  const promise = basePromise<CursorPage<T>, PaginatedPromise<T>>(first);\n  promise[Symbol.asyncIterator] = async function* () {\n    let result = await first;\n    for (;;) {\n      for (const item of result.data.data) yield item;\n      if (result.data.next_cursor == null) return;\n      result = await fetchPage(result.data.next_cursor);\n    }\n  };\n  return promise;\n}\n\n// `.safe()` turns Bird failures (the BirdError hierarchy) into values. Anything\n// else — a caller-initiated AbortError, or an unexpected non-Bird throw — keeps\n// propagating, so `error` stays soundly typed as `BirdError`.\nfunction toSafe<V>(\n  inner: Promise<{ data: V; response: BirdResponse }>,\n): Promise<SafeResult<V>> {\n  return inner.then(\n    ({ data, response }): SafeResult<V> => ({ data, error: null, response }),\n    (error): SafeResult<V> => {\n      if (error instanceof BirdError) return { data: null, error, response: null };\n      throw error;\n    },\n  );\n}\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport {\n  type Client,\n  type ClientOptions,\n  type Config,\n  createClient,\n  createConfig,\n} from \"./client\";\nimport type { ClientOptions as ClientOptions2 } from \"./types.gen\";\n\n/**\n * The `createClientConfig()` function will be called on client initialization\n * and the returned object will become the client's initial configuration.\n *\n * You may want to initialize your client this way instead of calling\n * `setConfig()`. This is useful for example if you're using Next.js\n * to ensure your client always has the correct values.\n */\nexport type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (\n  override?: Config<ClientOptions & T>,\n) => Config<Required<ClientOptions> & T>;\n\nexport const client: Client = createClient(createConfig<ClientOptions2>());\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport type {\n  Client,\n  ClientMeta,\n  Options as Options2,\n  RequestResult,\n  TDataShape,\n} from \"./client\";\nimport { client } from \"./client.gen\";\nimport type {\n  ArchiveContactPropertyData,\n  ArchiveContactPropertyErrors,\n  ArchiveContactPropertyResponses,\n  AssignAudienceContactsData,\n  AssignAudienceContactsErrors,\n  AssignAudienceContactsResponses,\n  CancelEmailMessageData,\n  CancelEmailMessageErrors,\n  CancelEmailMessageResponses,\n  CreateAudienceData,\n  CreateAudienceErrors,\n  CreateAudienceResponses,\n  CreateContactBatchData,\n  CreateContactBatchErrors,\n  CreateContactBatchResponses,\n  CreateContactData,\n  CreateContactErrors,\n  CreateContactPropertyData,\n  CreateContactPropertyErrors,\n  CreateContactPropertyResponses,\n  CreateContactResponses,\n  CreateDomainData,\n  CreateDomainErrors,\n  CreateDomainResponses,\n  CreateEmailLookupData,\n  CreateEmailLookupErrors,\n  CreateEmailLookupResponses,\n  CreateEmailMessageBatchData,\n  CreateEmailMessageBatchErrors,\n  CreateEmailMessageBatchResponses,\n  CreateEmailMessageData,\n  CreateEmailMessageErrors,\n  CreateEmailMessageResponses,\n  CreateMailboxData,\n  CreateMailboxErrors,\n  CreateMailboxMessageData,\n  CreateMailboxMessageErrors,\n  CreateMailboxMessageResponses,\n  CreateMailboxReceiveRuleData,\n  CreateMailboxReceiveRuleErrors,\n  CreateMailboxReceiveRuleResponses,\n  CreateMailboxResponses,\n  CreateNumbersOrderData,\n  CreateNumbersOrderErrors,\n  CreateNumbersOrderResponses,\n  CreatePhoneNumberLookupData,\n  CreatePhoneNumberLookupErrors,\n  CreatePhoneNumberLookupResponses,\n  CreateSmsKeywordRuleData,\n  CreateSmsKeywordRuleErrors,\n  CreateSmsKeywordRuleResponses,\n  CreateSmsMessageBatchData,\n  CreateSmsMessageBatchErrors,\n  CreateSmsMessageBatchResponses,\n  CreateSmsMessageData,\n  CreateSmsMessageErrors,\n  CreateSmsMessageResponses,\n  CreateSmsSuppressionData,\n  CreateSmsSuppressionErrors,\n  CreateSmsSuppressionResponses,\n  CreateVerificationCheckData,\n  CreateVerificationCheckErrors,\n  CreateVerificationCheckResponses,\n  CreateVerificationData,\n  CreateVerificationErrors,\n  CreateVerificationNextChannelData,\n  CreateVerificationNextChannelErrors,\n  CreateVerificationNextChannelResponses,\n  CreateVerificationResponses,\n  CreateWhatsAppMessageData,\n  CreateWhatsAppMessageErrors,\n  CreateWhatsAppMessageResponses,\n  DeleteAudienceData,\n  DeleteAudienceErrors,\n  DeleteAudienceResponses,\n  DeleteContactData,\n  DeleteContactErrors,\n  DeleteContactResponses,\n  DeleteDomainData,\n  DeleteDomainErrors,\n  DeleteDomainResponses,\n  DeleteEmailThreadData,\n  DeleteEmailThreadErrors,\n  DeleteEmailThreadResponses,\n  DeleteMailboxData,\n  DeleteMailboxErrors,\n  DeleteMailboxReceiveRuleData,\n  DeleteMailboxReceiveRuleErrors,\n  DeleteMailboxReceiveRuleResponses,\n  DeleteMailboxResponses,\n  DeleteSmsKeywordRuleData,\n  DeleteSmsKeywordRuleErrors,\n  DeleteSmsKeywordRuleResponses,\n  DeleteSmsSuppressionData,\n  DeleteSmsSuppressionErrors,\n  DeleteSmsSuppressionResponses,\n  DisconnectRealtimeAppMemberData,\n  DisconnectRealtimeAppMemberErrors,\n  DisconnectRealtimeAppMemberResponses,\n  GetAudienceData,\n  GetAudienceErrors,\n  GetAudienceResponses,\n  GetAvailableNumberData,\n  GetAvailableNumberErrors,\n  GetAvailableNumberResponses,\n  GetContactData,\n  GetContactErrors,\n  GetContactPropertyData,\n  GetContactPropertyErrors,\n  GetContactPropertyResponses,\n  GetContactResponses,\n  GetDomainData,\n  GetDomainErrors,\n  GetDomainResponses,\n  GetEmailMessageData,\n  GetEmailMessageErrors,\n  GetEmailMessageResponses,\n  GetEmailStatsByBounceCodeData,\n  GetEmailStatsByBounceCodeErrors,\n  GetEmailStatsByBounceCodeResponses,\n  GetEmailStatsByBroadcastData,\n  GetEmailStatsByBroadcastErrors,\n  GetEmailStatsByBroadcastResponses,\n  GetEmailStatsByCategoryData,\n  GetEmailStatsByCategoryErrors,\n  GetEmailStatsByCategoryResponses,\n  GetEmailStatsByClientData,\n  GetEmailStatsByClientErrors,\n  GetEmailStatsByClientResponses,\n  GetEmailStatsByComplaintTypeData,\n  GetEmailStatsByComplaintTypeErrors,\n  GetEmailStatsByComplaintTypeResponses,\n  GetEmailStatsByLocationData,\n  GetEmailStatsByLocationErrors,\n  GetEmailStatsByLocationResponses,\n  GetEmailStatsByMailboxProviderData,\n  GetEmailStatsByMailboxProviderErrors,\n  GetEmailStatsByMailboxProviderRegionData,\n  GetEmailStatsByMailboxProviderRegionErrors,\n  GetEmailStatsByMailboxProviderRegionResponses,\n  GetEmailStatsByMailboxProviderResponses,\n  GetEmailStatsByRecipientDomainData,\n  GetEmailStatsByRecipientDomainErrors,\n  GetEmailStatsByRecipientDomainResponses,\n  GetEmailStatsBySendingDomainData,\n  GetEmailStatsBySendingDomainErrors,\n  GetEmailStatsBySendingDomainResponses,\n  GetEmailStatsBySendingIpData,\n  GetEmailStatsBySendingIpErrors,\n  GetEmailStatsBySendingIpResponses,\n  GetEmailStatsByTagData,\n  GetEmailStatsByTagErrors,\n  GetEmailStatsByTagResponses,\n  GetEmailStatsByTemplateData,\n  GetEmailStatsByTemplateErrors,\n  GetEmailStatsByTemplateResponses,\n  GetEmailStatsDailyData,\n  GetEmailStatsDailyErrors,\n  GetEmailStatsDailyResponses,\n  GetEmailStatsHourlyData,\n  GetEmailStatsHourlyErrors,\n  GetEmailStatsHourlyResponses,\n  GetEmailStatsSummaryData,\n  GetEmailStatsSummaryErrors,\n  GetEmailStatsSummaryResponses,\n  GetEmailThreadData,\n  GetEmailThreadErrors,\n  GetEmailThreadMessageBodyData,\n  GetEmailThreadMessageBodyErrors,\n  GetEmailThreadMessageBodyResponses,\n  GetEmailThreadMessageData,\n  GetEmailThreadMessageErrors,\n  GetEmailThreadMessageResponses,\n  GetEmailThreadResponses,\n  GetMailboxData,\n  GetMailboxErrors,\n  GetMailboxResponses,\n  GetMailboxStatsData,\n  GetMailboxStatsErrors,\n  GetMailboxStatsResponses,\n  GetNumbersOrderData,\n  GetNumbersOrderErrors,\n  GetNumbersOrderResponses,\n  GetRealtimeAppChannelData,\n  GetRealtimeAppChannelErrors,\n  GetRealtimeAppChannelResponses,\n  GetSmsInboundStatsByCountryData,\n  GetSmsInboundStatsByCountryErrors,\n  GetSmsInboundStatsByCountryResponses,\n  GetSmsInboundStatsByNumberData,\n  GetSmsInboundStatsByNumberErrors,\n  GetSmsInboundStatsByNumberResponses,\n  GetSmsInboundStatsByOperatorData,\n  GetSmsInboundStatsByOperatorErrors,\n  GetSmsInboundStatsByOperatorResponses,\n  GetSmsInboundStatsDailyData,\n  GetSmsInboundStatsDailyErrors,\n  GetSmsInboundStatsDailyResponses,\n  GetSmsInboundStatsHourlyData,\n  GetSmsInboundStatsHourlyErrors,\n  GetSmsInboundStatsHourlyResponses,\n  GetSmsInboundStatsSummaryData,\n  GetSmsInboundStatsSummaryErrors,\n  GetSmsInboundStatsSummaryResponses,\n  GetSmsKeywordRuleData,\n  GetSmsKeywordRuleErrors,\n  GetSmsKeywordRuleResponses,\n  GetSmsMessageData,\n  GetSmsMessageErrors,\n  GetSmsMessageResponses,\n  GetSmsStatsByCarrierData,\n  GetSmsStatsByCarrierErrors,\n  GetSmsStatsByCarrierResponses,\n  GetSmsStatsByCategoryData,\n  GetSmsStatsByCategoryErrors,\n  GetSmsStatsByCategoryResponses,\n  GetSmsStatsByCountryData,\n  GetSmsStatsByCountryErrors,\n  GetSmsStatsByCountryResponses,\n  GetSmsStatsByErrorCodeData,\n  GetSmsStatsByErrorCodeErrors,\n  GetSmsStatsByErrorCodeResponses,\n  GetSmsStatsByOriginatorData,\n  GetSmsStatsByOriginatorErrors,\n  GetSmsStatsByOriginatorResponses,\n  GetSmsStatsByStatusData,\n  GetSmsStatsByStatusErrors,\n  GetSmsStatsByStatusResponses,\n  GetSmsStatsByTagData,\n  GetSmsStatsByTagErrors,\n  GetSmsStatsByTagResponses,\n  GetSmsStatsDailyData,\n  GetSmsStatsDailyErrors,\n  GetSmsStatsDailyResponses,\n  GetSmsStatsHourlyData,\n  GetSmsStatsHourlyErrors,\n  GetSmsStatsHourlyResponses,\n  GetSmsStatsSummaryData,\n  GetSmsStatsSummaryErrors,\n  GetSmsStatsSummaryResponses,\n  GetSmsSuppressionData,\n  GetSmsSuppressionErrors,\n  GetSmsSuppressionResponses,\n  GetSmsTemplateData,\n  GetSmsTemplateErrors,\n  GetSmsTemplateResponses,\n  GetVoiceCallData,\n  GetVoiceCallErrors,\n  GetVoiceCallResponses,\n  GetWhatsAppMessageData,\n  GetWhatsAppMessageErrors,\n  GetWhatsAppMessageResponses,\n  GetWorkspaceNumberData,\n  GetWorkspaceNumberErrors,\n  GetWorkspaceNumberResponses,\n  ListAudienceContactsData,\n  ListAudienceContactsErrors,\n  ListAudienceContactsResponses,\n  ListAudiencesData,\n  ListAudiencesErrors,\n  ListAudiencesResponses,\n  ListAvailableNumbersData,\n  ListAvailableNumbersErrors,\n  ListAvailableNumbersResponses,\n  ListContactPropertiesData,\n  ListContactPropertiesErrors,\n  ListContactPropertiesResponses,\n  ListContactsData,\n  ListContactsErrors,\n  ListContactsResponses,\n  ListDomainsData,\n  ListDomainsErrors,\n  ListDomainsResponses,\n  ListEmailMessagesData,\n  ListEmailMessagesErrors,\n  ListEmailMessagesResponses,\n  ListEmailThreadMessageAttachmentsData,\n  ListEmailThreadMessageAttachmentsErrors,\n  ListEmailThreadMessageAttachmentsResponses,\n  ListEmailThreadMessagesData,\n  ListEmailThreadMessagesErrors,\n  ListEmailThreadMessagesResponses,\n  ListEmailThreadsData,\n  ListEmailThreadsErrors,\n  ListEmailThreadsResponses,\n  ListMailboxesData,\n  ListMailboxesErrors,\n  ListMailboxesResponses,\n  ListMailboxLabelsData,\n  ListMailboxLabelsErrors,\n  ListMailboxLabelsResponses,\n  ListMailboxReceiveRulesData,\n  ListMailboxReceiveRulesErrors,\n  ListMailboxReceiveRulesResponses,\n  ListNumbersOrdersData,\n  ListNumbersOrdersErrors,\n  ListNumbersOrdersResponses,\n  ListRealtimeAppChannelMembersData,\n  ListRealtimeAppChannelMembersErrors,\n  ListRealtimeAppChannelMembersResponses,\n  ListRealtimeAppChannelsData,\n  ListRealtimeAppChannelsErrors,\n  ListRealtimeAppChannelsResponses,\n  ListSmsKeywordRulesData,\n  ListSmsKeywordRulesErrors,\n  ListSmsKeywordRulesResponses,\n  ListSmsMessageEventsData,\n  ListSmsMessageEventsErrors,\n  ListSmsMessageEventsResponses,\n  ListSmsMessagesData,\n  ListSmsMessagesErrors,\n  ListSmsMessagesResponses,\n  ListSmsSuppressionsData,\n  ListSmsSuppressionsErrors,\n  ListSmsSuppressionsResponses,\n  ListSmsTemplatesData,\n  ListSmsTemplatesErrors,\n  ListSmsTemplatesResponses,\n  ListVoiceCallsData,\n  ListVoiceCallsErrors,\n  ListVoiceCallsResponses,\n  ListWhatsAppMessageEventsData,\n  ListWhatsAppMessageEventsErrors,\n  ListWhatsAppMessageEventsResponses,\n  ListWhatsAppMessagesData,\n  ListWhatsAppMessagesErrors,\n  ListWhatsAppMessagesResponses,\n  ListWorkspaceNumbersData,\n  ListWorkspaceNumbersErrors,\n  ListWorkspaceNumbersResponses,\n  PublishRealtimeAppBatchData,\n  PublishRealtimeAppBatchErrors,\n  PublishRealtimeAppBatchResponses,\n  PublishRealtimeAppEventData,\n  PublishRealtimeAppEventErrors,\n  PublishRealtimeAppEventResponses,\n  ReleaseWorkspaceNumberData,\n  ReleaseWorkspaceNumberErrors,\n  ReleaseWorkspaceNumberResponses,\n  ReplyEmailThreadMessageData,\n  ReplyEmailThreadMessageErrors,\n  ReplyEmailThreadMessageResponses,\n  RestoreMailboxData,\n  RestoreMailboxErrors,\n  RestoreMailboxResponses,\n  ResumeMailboxData,\n  ResumeMailboxErrors,\n  ResumeMailboxResponses,\n  SendRealtimeAppMemberEventData,\n  SendRealtimeAppMemberEventErrors,\n  SendRealtimeAppMemberEventResponses,\n  UnarchiveContactPropertyData,\n  UnarchiveContactPropertyErrors,\n  UnarchiveContactPropertyResponses,\n  UnassignAudienceContactData,\n  UnassignAudienceContactErrors,\n  UnassignAudienceContactResponses,\n  UnassignAudienceContactsData,\n  UnassignAudienceContactsErrors,\n  UnassignAudienceContactsResponses,\n  UpdateAudienceData,\n  UpdateAudienceErrors,\n  UpdateAudienceResponses,\n  UpdateContactData,\n  UpdateContactErrors,\n  UpdateContactPropertyData,\n  UpdateContactPropertyErrors,\n  UpdateContactPropertyResponses,\n  UpdateContactResponses,\n  UpdateDomainData,\n  UpdateDomainErrors,\n  UpdateDomainResponses,\n  UpdateEmailThreadData,\n  UpdateEmailThreadErrors,\n  UpdateEmailThreadResponses,\n  UpdateMailboxData,\n  UpdateMailboxErrors,\n  UpdateMailboxResponses,\n  UpdateSmsKeywordRuleData,\n  UpdateSmsKeywordRuleErrors,\n  UpdateSmsKeywordRuleResponses,\n  VerifyDomainData,\n  VerifyDomainErrors,\n  VerifyDomainResponses,\n} from \"./types.gen\";\n\nexport type Options<\n  TData extends TDataShape = TDataShape,\n  ThrowOnError extends boolean = boolean,\n  TResponse = unknown,\n> = Options2<TData, ThrowOnError, TResponse> & {\n  /**\n   * You can provide a client instance returned by `createClient()` instead of\n   * individual options. This might be also useful if you want to implement a\n   * custom client.\n   */\n  client?: Client;\n  /**\n   * You can pass arbitrary values through the `meta` object. This can be\n   * used to access values that aren't defined as part of the SDK function.\n   */\n  meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;\n};\n\n/**\n * Publish a Realtime event\n *\n * Publishes an event to one or more channels of a Realtime app. Listing several channels broadcasts the event to all of them in one call. Connected clients subscribed to those channels receive it in real time.\n */\nexport const publishRealtimeAppEvent = <ThrowOnError extends boolean = false>(\n  options: Options<PublishRealtimeAppEventData, ThrowOnError>,\n): RequestResult<\n  PublishRealtimeAppEventResponses,\n  PublishRealtimeAppEventErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    PublishRealtimeAppEventResponses,\n    PublishRealtimeAppEventErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      { name: \"X-Realtime-Key\", type: \"apiKey\" },\n      { name: \"X-Realtime-Secret\", type: \"apiKey\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/realtime/apps/{realtime_app_id}/events\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Publish a batch of Realtime events\n *\n * Publishes up to 10 events (each to one channel) in a single request.\n */\nexport const publishRealtimeAppBatch = <ThrowOnError extends boolean = false>(\n  options: Options<PublishRealtimeAppBatchData, ThrowOnError>,\n): RequestResult<\n  PublishRealtimeAppBatchResponses,\n  PublishRealtimeAppBatchErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    PublishRealtimeAppBatchResponses,\n    PublishRealtimeAppBatchErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      { name: \"X-Realtime-Key\", type: \"apiKey\" },\n      { name: \"X-Realtime-Secret\", type: \"apiKey\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/realtime/apps/{realtime_app_id}/batch-events\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * List Realtime channels\n *\n * Lists the app's currently occupied channels, optionally filtered by name prefix.\n */\nexport const listRealtimeAppChannels = <ThrowOnError extends boolean = false>(\n  options: Options<ListRealtimeAppChannelsData, ThrowOnError>,\n): RequestResult<\n  ListRealtimeAppChannelsResponses,\n  ListRealtimeAppChannelsErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    ListRealtimeAppChannelsResponses,\n    ListRealtimeAppChannelsErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      { name: \"X-Realtime-Key\", type: \"apiKey\" },\n      { name: \"X-Realtime-Secret\", type: \"apiKey\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/realtime/apps/{realtime_app_id}/channels\",\n    ...options,\n  });\n\n/**\n * Get a Realtime channel\n *\n * Returns a single channel's occupancy and optional counts. A channel appears when its first connection subscribes and disappears when its last connection leaves. An unknown or unused name returns `200 OK` with `occupied: false`.\n */\nexport const getRealtimeAppChannel = <ThrowOnError extends boolean = false>(\n  options: Options<GetRealtimeAppChannelData, ThrowOnError>,\n): RequestResult<\n  GetRealtimeAppChannelResponses,\n  GetRealtimeAppChannelErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    GetRealtimeAppChannelResponses,\n    GetRealtimeAppChannelErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      { name: \"X-Realtime-Key\", type: \"apiKey\" },\n      { name: \"X-Realtime-Secret\", type: \"apiKey\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/realtime/apps/{realtime_app_id}/channels/{channel_name}\",\n    ...options,\n  });\n\n/**\n * List members on a presence channel\n *\n * Lists the member IDs currently subscribed to a presence channel. IDs only: `member_info` (the profile data attached by your authorization endpoint) is delivered to subscribed clients over the realtime connection and is not available over REST.\n */\nexport const listRealtimeAppChannelMembers = <\n  ThrowOnError extends boolean = false,\n>(\n  options: Options<ListRealtimeAppChannelMembersData, ThrowOnError>,\n): RequestResult<\n  ListRealtimeAppChannelMembersResponses,\n  ListRealtimeAppChannelMembersErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    ListRealtimeAppChannelMembersResponses,\n    ListRealtimeAppChannelMembersErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      { name: \"X-Realtime-Key\", type: \"apiKey\" },\n      { name: \"X-Realtime-Secret\", type: \"apiKey\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/realtime/apps/{realtime_app_id}/channels/{channel_name}/members\",\n    ...options,\n  });\n\n/**\n * Disconnect a member\n *\n * Disconnects all of a member's active connections, for example on sign-out or ban.\n */\nexport const disconnectRealtimeAppMember = <\n  ThrowOnError extends boolean = false,\n>(\n  options: Options<DisconnectRealtimeAppMemberData, ThrowOnError>,\n): RequestResult<\n  DisconnectRealtimeAppMemberResponses,\n  DisconnectRealtimeAppMemberErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    DisconnectRealtimeAppMemberResponses,\n    DisconnectRealtimeAppMemberErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      { name: \"X-Realtime-Key\", type: \"apiKey\" },\n      { name: \"X-Realtime-Secret\", type: \"apiKey\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/realtime/apps/{realtime_app_id}/members/{member_id}/disconnect\",\n    ...options,\n  });\n\n/**\n * Send an event to a member\n *\n * Delivers an event to one member of a Realtime app, addressing the person\n * rather than a channel. Every connection that member currently holds receives\n * it across tabs and devices, without requiring a dedicated channel.\n *\n * The member must have signed in on the connection for it to be addressable.\n * Delivery is best-effort and not queued. A member with no active connections\n * at the time of the call does not receive the event.\n */\nexport const sendRealtimeAppMemberEvent = <\n  ThrowOnError extends boolean = false,\n>(\n  options: Options<SendRealtimeAppMemberEventData, ThrowOnError>,\n): RequestResult<\n  SendRealtimeAppMemberEventResponses,\n  SendRealtimeAppMemberEventErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    SendRealtimeAppMemberEventResponses,\n    SendRealtimeAppMemberEventErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      { name: \"X-Realtime-Key\", type: \"apiKey\" },\n      { name: \"X-Realtime-Secret\", type: \"apiKey\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/realtime/apps/{realtime_app_id}/members/{member_id}/events\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * List messages\n *\n * Returns the workspace's sent and scheduled messages, newest first, as a cursor page. Each item has the aggregate delivery `status` and per-state recipient counts. Message bodies are omitted.\n *\n * Combine filters to narrow the page:\n *\n * - Delivery status.\n * - Category.\n * - Tag.\n * - An exact `to` or `from` address.\n * - A `created_after` or `created_before` time window.\n *\n */\nexport const listEmailMessages = <ThrowOnError extends boolean = false>(\n  options?: Options<ListEmailMessagesData, ThrowOnError>,\n): RequestResult<\n  ListEmailMessagesResponses,\n  ListEmailMessagesErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    ListEmailMessagesResponses,\n    ListEmailMessagesErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/messages\",\n    ...options,\n  });\n\n/**\n * Create an email message\n *\n * Sends an email to the recipients you list explicitly in `to`/`cc`/`bcc`. Use it for\n * transactional sends (receipts, password resets, alerts) and for marketing sends where\n * you have the recipient addresses on hand. To submit many independent messages in one\n * request, use [Create a batch of email messages](/docs/api/reference/create-email-message-batch)\n * instead. The `category` field controls suppression policy independently of content:\n * set it to `marketing` when sending marketing content.\n *\n * The `202` response means the message is safely accepted and awaiting delivery.\n * Fetch it by `id` or subscribe to webhook events to follow delivery. The\n * request never half-succeeds: an unverified sender domain or any field-level\n * validation failure rejects it immediately with a `422` naming the reason.\n * Suppression is evaluated per recipient after acceptance, so a suppressed recipient\n * appears as `rejected` on the message's recipient list rather than as a synchronous\n * error. New workspaces can send from the shared onboarding domain before verifying\n * their own. The [quickstart](/docs/get-started/send-your-first-email) covers its\n * recipient and volume limits.\n *\n */\nexport const createEmailMessage = <ThrowOnError extends boolean = false>(\n  options: Options<CreateEmailMessageData, ThrowOnError>,\n): RequestResult<\n  CreateEmailMessageResponses,\n  CreateEmailMessageErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    CreateEmailMessageResponses,\n    CreateEmailMessageErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/messages\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Create a batch of email messages\n *\n * Accepts up to 100 independent email messages and queues them for delivery. All items are validated before any are queued: if one fails validation, the entire batch is rejected. Field-level validation failures and business-rule failures, such as sending from a domain that is not verified, both return `422`. None of the items can set `scheduled_at`; schedule a single message with [Create an email message](/docs/api/reference/create-email-message) instead. Suppression is evaluated per recipient after acceptance, never as a synchronous error. The `202` response returns one entry per message in submission order, each with its own `id` you can use to fetch that message or match it against webhook events. Attachments are allowed per message. Each message must stay within the 20 MB estimated generated message-size cap, and the serialized JSON request body for the whole batch has a hard 20 MB cap.\n *\n */\nexport const createEmailMessageBatch = <ThrowOnError extends boolean = false>(\n  options: Options<CreateEmailMessageBatchData, ThrowOnError>,\n): RequestResult<\n  CreateEmailMessageBatchResponses,\n  CreateEmailMessageBatchErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    CreateEmailMessageBatchResponses,\n    CreateEmailMessageBatchErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/batches\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Get a message\n *\n * Returns a single message with its aggregate delivery `status` and per-state recipient counts. The response never includes the `html`/`text` bodies. When content storage is enabled for the send, fetch the stored bodies with [Get stored message content](/docs/api/reference/get-email-message-content). Per-recipient statuses and the event timeline are separate sub-resources.\n *\n */\nexport const getEmailMessage = <ThrowOnError extends boolean = false>(\n  options: Options<GetEmailMessageData, ThrowOnError>,\n): RequestResult<\n  GetEmailMessageResponses,\n  GetEmailMessageErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    GetEmailMessageResponses,\n    GetEmailMessageErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/messages/{message_id}\",\n    ...options,\n  });\n\n/**\n * Cancel a scheduled message\n *\n * Cancels a message that was scheduled with `scheduled_at` before it sends. Only a message that is still scheduled can be canceled. A message that already started sending, was delivered, or was previously canceled returns a conflict error. The message's status becomes `canceled` and an `email.canceled` webhook event fires. Canceling does not return consumed scheduled-send quota.\n *\n */\nexport const cancelEmailMessage = <ThrowOnError extends boolean = false>(\n  options: Options<CancelEmailMessageData, ThrowOnError>,\n): RequestResult<\n  CancelEmailMessageResponses,\n  CancelEmailMessageErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    CancelEmailMessageResponses,\n    CancelEmailMessageErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/messages/{message_id}/cancel\",\n    ...options,\n  });\n\n/**\n * List contacts\n *\n * Returns a paginated list of contacts in the workspace, newest first. Look up a single contact by its exact `email`, `phone_number`, or `external_id`, or search by email, first name, last name, or phone substring with `q`. Repeat `phone_number` to resolve up to 50 numbers to their contacts in one request, raising `limit` to at least the number of values you pass. Pass `include_total=true` to add the total number of matching contacts to the response.\n *\n */\nexport const listContacts = <ThrowOnError extends boolean = false>(\n  options?: Options<ListContactsData, ThrowOnError>,\n): RequestResult<ListContactsResponses, ListContactsErrors, ThrowOnError> =>\n  (options?.client ?? client).get<\n    ListContactsResponses,\n    ListContactsErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/contacts\",\n    ...options,\n  });\n\n/**\n * Create a contact\n *\n * Creates a contact in the workspace, identified by an email address, a phone number, or both; at least one is required. Email is stored trimmed and lowercased, and phone in its canonical international form. Creating a second contact with the same email or phone number, or reusing another contact's `external_id`, returns a conflict error.\n *\n * To create or update many contacts in one request, or to write a contact without knowing whether the address already exists, use [Create or update contacts in bulk](/docs/api/reference/create-contact-batch) instead.\n *\n */\nexport const createContact = <ThrowOnError extends boolean = false>(\n  options: Options<CreateContactData, ThrowOnError>,\n): RequestResult<CreateContactResponses, CreateContactErrors, ThrowOnError> =>\n  (options.client ?? client).post<\n    CreateContactResponses,\n    CreateContactErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/contacts\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Create or update contacts in bulk\n *\n * Creates or updates up to 1,000 contacts in one request. Each entry is matched automatically against every identifier it supplies: its email address (trimmed and lowercased), its phone number (normalized to international form), and your own `external_id`. An entry with no match creates a contact. An entry whose identifiers all match one contact updates the supplied fields and preserves omitted fields. This lets an email address change under a stable `external_id` without creating a second contact. An entry whose identifiers belong to several contacts fails with an error naming each match; contacts are never merged automatically. Supplying `match_on` makes that field the only matching key, and every entry must include it. You can also add every contact in the request to up to 10 audiences.\n *\n * Each entry succeeds or fails on its own: the response lists one result per contact in submission order (`created`, `updated`, or `failed` with the reason), and a failed entry does not abort the rest. If the request itself is invalid, for example when an entry in `audience_ids` does not exist, the whole request fails with a validation error and no contacts are written.\n *\n */\nexport const createContactBatch = <ThrowOnError extends boolean = false>(\n  options: Options<CreateContactBatchData, ThrowOnError>,\n): RequestResult<\n  CreateContactBatchResponses,\n  CreateContactBatchErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    CreateContactBatchResponses,\n    CreateContactBatchErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/contacts/batch\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Delete a contact\n *\n * Deletes a contact permanently and removes it from every audience it belongs to. Suppression records for the address are not affected: an unsubscribed or bounced address stays suppressed even after the contact is deleted.\n *\n */\nexport const deleteContact = <ThrowOnError extends boolean = false>(\n  options: Options<DeleteContactData, ThrowOnError>,\n): RequestResult<DeleteContactResponses, DeleteContactErrors, ThrowOnError> =>\n  (options.client ?? client).delete<\n    DeleteContactResponses,\n    DeleteContactErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/contacts/{contact_id}\",\n    ...options,\n  });\n\n/**\n * Get a contact\n *\n * Returns a single contact, including its custom `data` values and the channels it can be reached on. To find a contact's ID by email address or `external_id`, use [List contacts](/docs/api/reference/list-contacts).\n *\n */\nexport const getContact = <ThrowOnError extends boolean = false>(\n  options: Options<GetContactData, ThrowOnError>,\n): RequestResult<GetContactResponses, GetContactErrors, ThrowOnError> =>\n  (options.client ?? client).get<\n    GetContactResponses,\n    GetContactErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/contacts/{contact_id}\",\n    ...options,\n  });\n\n/**\n * Update a contact\n *\n * Updates a contact. Supplied fields are changed and omitted fields are left unchanged; set `first_name`, `last_name`, or `external_id` to `null` to clear them. Custom values in `data` are merged: keys you supply are set, keys set to `null` are removed, and keys you omit are unchanged.\n *\n * Changing the email address, phone number, or `external_id` to a value already used by another contact returns a conflict error. A contact always keeps at least one identifier. Clearing both email and phone in the same contact is rejected.\n *\n */\nexport const updateContact = <ThrowOnError extends boolean = false>(\n  options: Options<UpdateContactData, ThrowOnError>,\n): RequestResult<UpdateContactResponses, UpdateContactErrors, ThrowOnError> =>\n  (options.client ?? client).patch<\n    UpdateContactResponses,\n    UpdateContactErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/contacts/{contact_id}\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * List contact properties\n *\n * Returns a paginated list of the workspace's contact properties, newest first. Archived properties are included; check each entry's `archived` flag.\n *\n */\nexport const listContactProperties = <ThrowOnError extends boolean = false>(\n  options?: Options<ListContactPropertiesData, ThrowOnError>,\n): RequestResult<\n  ListContactPropertiesResponses,\n  ListContactPropertiesErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    ListContactPropertiesResponses,\n    ListContactPropertiesErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/contact-properties\",\n    ...options,\n  });\n\n/**\n * Create a contact property\n *\n * Defines a custom property that contacts in the workspace can carry. The key becomes available in contact `data` and as a template variable in broadcasts. The key and type cannot be changed after creation.\n *\n * A key already in use returns a conflict error. A workspace can hold at most 200 properties; archived properties keep their key and count toward that limit.\n *\n */\nexport const createContactProperty = <ThrowOnError extends boolean = false>(\n  options: Options<CreateContactPropertyData, ThrowOnError>,\n): RequestResult<\n  CreateContactPropertyResponses,\n  CreateContactPropertyErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    CreateContactPropertyResponses,\n    CreateContactPropertyErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/contact-properties\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Get a contact property\n *\n * Returns a single contact property: its immutable key and type, the fallback value, and whether it is archived.\n *\n */\nexport const getContactProperty = <ThrowOnError extends boolean = false>(\n  options: Options<GetContactPropertyData, ThrowOnError>,\n): RequestResult<\n  GetContactPropertyResponses,\n  GetContactPropertyErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    GetContactPropertyResponses,\n    GetContactPropertyErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/contact-properties/{property_id}\",\n    ...options,\n  });\n\n/**\n * Update a contact property\n *\n * Updates a contact property's fallback value, the only mutable field. The key and type cannot be changed after creation; create a new property instead.\n *\n */\nexport const updateContactProperty = <ThrowOnError extends boolean = false>(\n  options: Options<UpdateContactPropertyData, ThrowOnError>,\n): RequestResult<\n  UpdateContactPropertyResponses,\n  UpdateContactPropertyErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).patch<\n    UpdateContactPropertyResponses,\n    UpdateContactPropertyErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/contact-properties/{property_id}\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Archive a contact property\n *\n * Archives a contact property. The key stops being accepted in contact writes and stops rendering in templates, but every value already stored on your contacts is preserved and still returned when you read a contact.\n *\n * The key stays reserved and still counts toward the workspace's 200-property limit, so it cannot be re-created with a different type. Archiving an already-archived property returns a conflict error; reverse it with [Unarchive a contact property](/docs/api/reference/unarchive-contact-property).\n *\n */\nexport const archiveContactProperty = <ThrowOnError extends boolean = false>(\n  options: Options<ArchiveContactPropertyData, ThrowOnError>,\n): RequestResult<\n  ArchiveContactPropertyResponses,\n  ArchiveContactPropertyErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    ArchiveContactPropertyResponses,\n    ArchiveContactPropertyErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/contact-properties/{property_id}/archive\",\n    ...options,\n  });\n\n/**\n * Unarchive a contact property\n *\n * Reactivates an archived contact property. The key is accepted in contact writes and renders in templates again; stored values were never removed, so they are unchanged. Unarchiving a property that is not archived returns a conflict error.\n *\n */\nexport const unarchiveContactProperty = <ThrowOnError extends boolean = false>(\n  options: Options<UnarchiveContactPropertyData, ThrowOnError>,\n): RequestResult<\n  UnarchiveContactPropertyResponses,\n  UnarchiveContactPropertyErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    UnarchiveContactPropertyResponses,\n    UnarchiveContactPropertyErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/contact-properties/{property_id}/unarchive\",\n    ...options,\n  });\n\n/**\n * List audiences\n *\n * Returns a paginated list of audiences in the workspace, newest first. Filter to audiences whose name contains a substring with `q`.\n *\n */\nexport const listAudiences = <ThrowOnError extends boolean = false>(\n  options?: Options<ListAudiencesData, ThrowOnError>,\n): RequestResult<ListAudiencesResponses, ListAudiencesErrors, ThrowOnError> =>\n  (options?.client ?? client).get<\n    ListAudiencesResponses,\n    ListAudiencesErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/audiences\",\n    ...options,\n  });\n\n/**\n * Create an audience\n *\n * Creates an audience in the workspace. New audiences start empty: add members with [Add contacts to an audience](/docs/api/reference/assign-audience-contacts) or through [Create or update contacts in bulk](/docs/api/reference/create-contact-batch). The `type` field currently accepts only `static` audiences.\n *\n */\nexport const createAudience = <ThrowOnError extends boolean = false>(\n  options: Options<CreateAudienceData, ThrowOnError>,\n): RequestResult<CreateAudienceResponses, CreateAudienceErrors, ThrowOnError> =>\n  (options.client ?? client).post<\n    CreateAudienceResponses,\n    CreateAudienceErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/audiences\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Delete an audience\n *\n * Deletes an audience and its memberships. Contacts themselves are not deleted. An audience cannot be deleted while a broadcast targeting it is scheduled, accepted, sending, or canceling; cancel that broadcast first, then retry.\n *\n */\nexport const deleteAudience = <ThrowOnError extends boolean = false>(\n  options: Options<DeleteAudienceData, ThrowOnError>,\n): RequestResult<DeleteAudienceResponses, DeleteAudienceErrors, ThrowOnError> =>\n  (options.client ?? client).delete<\n    DeleteAudienceResponses,\n    DeleteAudienceErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/audiences/{audience_id}\",\n    ...options,\n  });\n\n/**\n * Get an audience\n *\n * Returns a single audience: its name, description, and type. The member list is separate; fetch it with [List an audience's contacts](/docs/api/reference/list-audience-contacts).\n *\n */\nexport const getAudience = <ThrowOnError extends boolean = false>(\n  options: Options<GetAudienceData, ThrowOnError>,\n): RequestResult<GetAudienceResponses, GetAudienceErrors, ThrowOnError> =>\n  (options.client ?? client).get<\n    GetAudienceResponses,\n    GetAudienceErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/audiences/{audience_id}\",\n    ...options,\n  });\n\n/**\n * Update an audience\n *\n * Updates an audience's name or description. Omitted fields are left unchanged; set `description` to `null` to clear it.\n *\n */\nexport const updateAudience = <ThrowOnError extends boolean = false>(\n  options: Options<UpdateAudienceData, ThrowOnError>,\n): RequestResult<UpdateAudienceResponses, UpdateAudienceErrors, ThrowOnError> =>\n  (options.client ?? client).patch<\n    UpdateAudienceResponses,\n    UpdateAudienceErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/audiences/{audience_id}\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * List an audience's contacts\n *\n * Lists the contacts in a static audience as a cursor page, ordered by the time each contact joined the audience, most recent first. Each entry is the contact together with the time it joined.\n *\n */\nexport const listAudienceContacts = <ThrowOnError extends boolean = false>(\n  options: Options<ListAudienceContactsData, ThrowOnError>,\n): RequestResult<\n  ListAudienceContactsResponses,\n  ListAudienceContactsErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    ListAudienceContactsResponses,\n    ListAudienceContactsErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/audiences/{audience_id}/contacts\",\n    ...options,\n  });\n\n/**\n * Assign contacts to an audience\n *\n * Adds up to 1,000 contacts to an audience. Adding is idempotent: contacts that are already members are left in place and keep their original join time. If any contact ID does not exist in the workspace, the whole request fails with `422 Unprocessable Entity` and no contacts are added.\n *\n */\nexport const assignAudienceContacts = <ThrowOnError extends boolean = false>(\n  options: Options<AssignAudienceContactsData, ThrowOnError>,\n): RequestResult<\n  AssignAudienceContactsResponses,\n  AssignAudienceContactsErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    AssignAudienceContactsResponses,\n    AssignAudienceContactsErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/audiences/{audience_id}/contacts\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Unassign contacts from an audience\n *\n * Removes up to 1,000 contacts from an audience. Contacts that are not members are skipped. If any contact ID does not exist in the workspace, the whole request fails with `422 Unprocessable Entity` and no memberships are removed. The contacts themselves are not deleted and remain members of any other audiences.\n *\n */\nexport const unassignAudienceContacts = <ThrowOnError extends boolean = false>(\n  options: Options<UnassignAudienceContactsData, ThrowOnError>,\n): RequestResult<\n  UnassignAudienceContactsResponses,\n  UnassignAudienceContactsErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    UnassignAudienceContactsResponses,\n    UnassignAudienceContactsErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/audiences/{audience_id}/contacts/remove\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Unassign a contact from an audience\n *\n * Removes a contact's membership in an audience. The contact itself is not deleted and remains a member of any other audiences. Removing a contact that is not a member of the audience succeeds with no effect (`204 No Content`); an unknown audience or contact returns a not-found error.\n *\n */\nexport const unassignAudienceContact = <ThrowOnError extends boolean = false>(\n  options: Options<UnassignAudienceContactData, ThrowOnError>,\n): RequestResult<\n  UnassignAudienceContactResponses,\n  UnassignAudienceContactErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).delete<\n    UnassignAudienceContactResponses,\n    UnassignAudienceContactErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/audiences/{audience_id}/contacts/{contact_id}\",\n    ...options,\n  });\n\n/**\n * List SMS messages\n *\n * Returns the workspace's SMS messages as a cursor-paginated list, newest\n * first. Filter by direction, status, category, recipient, sender, failure\n * reason, tag, or creation time; pass the response's `next_cursor` back as\n * `starting_after` to fetch the next page. To follow a single message's\n * delivery, use [Get an SMS message](/docs/api/reference/get-sms-message)\n * instead.\n *\n * Messages are retained for **30 days**. A `created_after` earlier than that\n * is accepted and raised to the retention bound rather than rejected, so a\n * wider window returns what is still retained instead of failing. Messages\n * older than the retention window cannot be retrieved.\n *\n */\nexport const listSmsMessages = <ThrowOnError extends boolean = false>(\n  options?: Options<ListSmsMessagesData, ThrowOnError>,\n): RequestResult<\n  ListSmsMessagesResponses,\n  ListSmsMessagesErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    ListSmsMessagesResponses,\n    ListSmsMessagesErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/messages\",\n    ...options,\n  });\n\n/**\n * Create an SMS message\n *\n * Sends one SMS to one recipient with exactly one content form: `text`, which\n * requires `category` and `from`, or a stored `template`, which selects both\n * for you. To submit up to 100 independent messages in one request, use\n * [Send a batch of SMS messages](/docs/api/reference/create-sms-message-batch)\n * instead.\n *\n * The `202 Accepted` response means the API durably accepted the message for\n * asynchronous delivery. Delivery remains pending; follow it with\n * [Get an SMS message](/docs/api/reference/get-sms-message) or by subscribing\n * to `sms.*` webhook events.\n *\n * An invalid field, more than 12 segments, a disabled destination country, or\n * a sender not permitted for the destination returns `422`. Insufficient\n * wallet balance returns `402`.\n *\n */\nexport const createSmsMessage = <ThrowOnError extends boolean = false>(\n  options: Options<CreateSmsMessageData, ThrowOnError>,\n): RequestResult<\n  CreateSmsMessageResponses,\n  CreateSmsMessageErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    CreateSmsMessageResponses,\n    CreateSmsMessageErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/messages\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Create a batch of SMS messages\n *\n * Sends up to 100 independent SMS messages in one request. Each item is a\n * complete send request with its own recipient, content, ID, status, and\n * cost. For a single message, use\n * [Send an SMS message](/docs/api/reference/create-sms-message) instead.\n *\n * Acceptance is all-or-nothing: every item is validated before any is queued,\n * and one invalid item rejects the whole batch with a `422` (nothing is\n * sent). A batch from a workspace with no wallet balance fails with a `402`.\n * The `202` response lists the accepted messages in submission order; each\n * delivers asynchronously and is tracked individually, like a single send.\n *\n */\nexport const createSmsMessageBatch = <ThrowOnError extends boolean = false>(\n  options: Options<CreateSmsMessageBatchData, ThrowOnError>,\n): RequestResult<\n  CreateSmsMessageBatchResponses,\n  CreateSmsMessageBatchErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    CreateSmsMessageBatchResponses,\n    CreateSmsMessageBatchErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/batches\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Get an SMS message\n *\n * Returns a single SMS message: its current delivery status, segment breakdown, cost, and failure detail when it failed. The `status` advances asynchronously as delivery progresses, and `cost` is null until the message has been priced, so poll this operation (or subscribe to `sms.*` webhook events) after a send to confirm delivery. To scan messages in bulk, use [List SMS messages](/docs/api/reference/list-sms-messages) instead.\n *\n */\nexport const getSmsMessage = <ThrowOnError extends boolean = false>(\n  options: Options<GetSmsMessageData, ThrowOnError>,\n): RequestResult<GetSmsMessageResponses, GetSmsMessageErrors, ThrowOnError> =>\n  (options.client ?? client).get<\n    GetSmsMessageResponses,\n    GetSmsMessageErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/messages/{message_id}\",\n    ...options,\n  });\n\n/**\n * List events for an SMS message\n *\n * Returns the lifecycle event timeline for a message, in chronological order.\n */\nexport const listSmsMessageEvents = <ThrowOnError extends boolean = false>(\n  options: Options<ListSmsMessageEventsData, ThrowOnError>,\n): RequestResult<\n  ListSmsMessageEventsResponses,\n  ListSmsMessageEventsErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    ListSmsMessageEventsResponses,\n    ListSmsMessageEventsErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/messages/{message_id}/events\",\n    ...options,\n  });\n\n/**\n * List SMS templates\n *\n * Returns the SMS templates you can send from, including our built-in templates. Filter by scope, category, or language; the catalog is small and returned in full, so this list is not paginated. To read one template's variables before sending with it, use [Get an SMS template](/docs/api/reference/get-sms-template).\n *\n */\nexport const listSmsTemplates = <ThrowOnError extends boolean = false>(\n  options?: Options<ListSmsTemplatesData, ThrowOnError>,\n): RequestResult<\n  ListSmsTemplatesResponses,\n  ListSmsTemplatesErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    ListSmsTemplatesResponses,\n    ListSmsTemplatesErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/templates\",\n    ...options,\n  });\n\n/**\n * Get an SMS template\n *\n * Returns a single SMS template: its body preview, category, the `variables` it expects (each with its accepted format), and the languages it is available in. Fetch a template before sending with it to see which `parameters` keys are required; an unknown reference returns a `404`. To browse the whole catalog, use [List SMS templates](/docs/api/reference/list-sms-templates) instead.\n *\n */\nexport const getSmsTemplate = <ThrowOnError extends boolean = false>(\n  options: Options<GetSmsTemplateData, ThrowOnError>,\n): RequestResult<GetSmsTemplateResponses, GetSmsTemplateErrors, ThrowOnError> =>\n  (options.client ?? client).get<\n    GetSmsTemplateResponses,\n    GetSmsTemplateErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/templates/{template_ref}\",\n    ...options,\n  });\n\n/**\n * List SMS suppressions\n *\n * Returns the suppressions currently stopping your messages, most recent opt-out first. Pass `destination` to look up one subscriber before sending to them.\n *\n * A suppression covers one sender and one subscriber, so the same number can appear more than once: opting out of one of your senders does not opt out of the others.\n *\n * Ended suppressions are excluded. A subscriber who opted back in is reachable again and does not appear in this list.\n *\n */\nexport const listSmsSuppressions = <ThrowOnError extends boolean = false>(\n  options?: Options<ListSmsSuppressionsData, ThrowOnError>,\n): RequestResult<\n  ListSmsSuppressionsResponses,\n  ListSmsSuppressionsErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    ListSmsSuppressionsResponses,\n    ListSmsSuppressionsErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/suppressions\",\n    ...options,\n  });\n\n/**\n * Create an SMS suppression\n *\n * Stops a sender's messages to a subscriber, with reason `manual`, blocking every category including transactional. Both ends are required: a suppression covers a sender-and-subscriber pair, so stopping all of your senders means one call per sender.\n *\n * Adding is idempotent. A `201` means a new suppression was recorded, and a `200` means a `manual` one for that pair was already in place and is returned unchanged. A pair already stopped for another reason, such as the subscriber having texted a stop keyword, still gets its own `manual` record, and messages stay stopped until every one of them has ended.\n *\n */\nexport const createSmsSuppression = <ThrowOnError extends boolean = false>(\n  options: Options<CreateSmsSuppressionData, ThrowOnError>,\n): RequestResult<\n  CreateSmsSuppressionResponses,\n  CreateSmsSuppressionErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    CreateSmsSuppressionResponses,\n    CreateSmsSuppressionErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/suppressions\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Delete an SMS suppression\n *\n * Ends a suppression, so the sender reaches the subscriber again. The record stays with the ending noted on it. This history helps answer later complaints or carrier audits.\n *\n * **Only the `manual` reason can be ended here.** A `keyword_stop` is the subscriber's own statement. It ends only when they text a start keyword to that sender. A `carrier_opted_out` mirrors what the carrier reported, so it ends when the carrier says so. Attempts to end either reason return `422`.\n *\n * Ending a suppression resumes messaging to someone your own records say did not want it, so do it only when you know why the `manual` record exists. An ID that does not exist in the workspace returns `404`, and one that has already ended returns `204`.\n *\n */\nexport const deleteSmsSuppression = <ThrowOnError extends boolean = false>(\n  options: Options<DeleteSmsSuppressionData, ThrowOnError>,\n): RequestResult<\n  DeleteSmsSuppressionResponses,\n  DeleteSmsSuppressionErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).delete<\n    DeleteSmsSuppressionResponses,\n    DeleteSmsSuppressionErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/suppressions/{suppression_id}\",\n    ...options,\n  });\n\n/**\n * Get an SMS suppression\n *\n * Returns one suppression: the sender and subscriber it covers, why messages are stopped, how the record came to exist, what it blocks, and whether it is still in force.\n *\n * This operation also returns a suppression that has already ended. The `blocking` field is `false`, and the `ended_*` fields say when and why. An ID you kept from a create or delete therefore stays readable. To find one when you only know the number, use `GET /v1/sms/suppressions` with the `destination` parameter. An ID that does not exist in the workspace returns `404`.\n *\n */\nexport const getSmsSuppression = <ThrowOnError extends boolean = false>(\n  options: Options<GetSmsSuppressionData, ThrowOnError>,\n): RequestResult<\n  GetSmsSuppressionResponses,\n  GetSmsSuppressionErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    GetSmsSuppressionResponses,\n    GetSmsSuppressionErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/suppressions/{suppression_id}\",\n    ...options,\n  });\n\n/**\n * List SMS keyword rules\n *\n * Returns the default and workspace keyword rules that apply to inbound messages, most specific first. Where the default catalog covers a country, opt-out, opt-in, and help keywords work without setup.\n *\n * Use the filters to narrow the full, unpaginated list. Set `scope=system` for default rules only. Set `number` for rules in evaluation order, and add `from_country` to account for the sender's country.\n *\n * Default coverage varies by country. If a country has no default rules, the service does not recognize keywords, send replies, or record opt-outs there. You can add `custom` keywords for that country. Opt-out, opt-in, and help rules require default coverage.\n *\n */\nexport const listSmsKeywordRules = <ThrowOnError extends boolean = false>(\n  options?: Options<ListSmsKeywordRulesData, ThrowOnError>,\n): RequestResult<\n  ListSmsKeywordRulesResponses,\n  ListSmsKeywordRulesErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    ListSmsKeywordRulesResponses,\n    ListSmsKeywordRulesErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/keyword-rules\",\n    ...options,\n  });\n\n/**\n * Create an SMS keyword rule\n *\n * Creates a workspace keyword rule. Use it to replace the default opt-out, opt-in, or help reply for one country, or to add a `custom` keyword.\n *\n * Your rule takes precedence over the default for the same country and keeps default keywords unless you add more. Opt-out and opt-in keywords cannot be assigned to another operation.\n *\n */\nexport const createSmsKeywordRule = <ThrowOnError extends boolean = false>(\n  options: Options<CreateSmsKeywordRuleData, ThrowOnError>,\n): RequestResult<\n  CreateSmsKeywordRuleResponses,\n  CreateSmsKeywordRuleErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    CreateSmsKeywordRuleResponses,\n    CreateSmsKeywordRuleErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/keyword-rules\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Delete an SMS keyword rule\n *\n * Deletes a rule you created. Bird's default for that operation and country applies again straight away, so deleting an opt-out rule restores Bird's reply rather than switching opt-out off. Bird's defaults cannot be deleted.\n *\n */\nexport const deleteSmsKeywordRule = <ThrowOnError extends boolean = false>(\n  options: Options<DeleteSmsKeywordRuleData, ThrowOnError>,\n): RequestResult<\n  DeleteSmsKeywordRuleResponses,\n  DeleteSmsKeywordRuleErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).delete<\n    DeleteSmsKeywordRuleResponses,\n    DeleteSmsKeywordRuleErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/keyword-rules/{id}\",\n    ...options,\n  });\n\n/**\n * Get an SMS keyword rule\n *\n * Returns one keyword rule, either one of Bird's defaults or one you created, including\n * every keyword that matches it and the reply it sends.\n *\n */\nexport const getSmsKeywordRule = <ThrowOnError extends boolean = false>(\n  options: Options<GetSmsKeywordRuleData, ThrowOnError>,\n): RequestResult<\n  GetSmsKeywordRuleResponses,\n  GetSmsKeywordRuleErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    GetSmsKeywordRuleResponses,\n    GetSmsKeywordRuleErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/keyword-rules/{id}\",\n    ...options,\n  });\n\n/**\n * Update an SMS keyword rule\n *\n * Changes the reply or the added keywords of a rule you created. Bird's defaults cannot be\n * changed. To replace one, create a rule with the same operation and country and yours\n * takes precedence.\n *\n * What the rule applies to is fixed once created, so this changes the reply and the keywords\n * only.\n *\n */\nexport const updateSmsKeywordRule = <ThrowOnError extends boolean = false>(\n  options: Options<UpdateSmsKeywordRuleData, ThrowOnError>,\n): RequestResult<\n  UpdateSmsKeywordRuleResponses,\n  UpdateSmsKeywordRuleErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).patch<\n    UpdateSmsKeywordRuleResponses,\n    UpdateSmsKeywordRuleErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/keyword-rules/{id}\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Get aggregate outbound SMS statistics\n *\n * Returns one aggregate row for the requested period. It includes SMS lifecycle counts, delivery and failure rates, and processing, delivery, and total latency percentiles (`p50`, `p95`, and `p99`). Rows use send-time attribution, so recent periods can under-report `delivered` while delivery reports arrive.\n *\n * Rate fields are `null` when their denominator is zero. For example, `delivery_rate` is `null` when no message was accepted.\n *\n * `from` and `to` must both be days or RFC 3339 instants. Day windows cover up to 365 days. Instant bounds round down to the hour and may span up to 720 hours. Mixing the forms returns `422`. Set `timezone` for local boundaries, one dimension filter at most, or `compare=previous_period` for the preceding equal-length window.\n *\n */\nexport const getSmsStatsSummary = <ThrowOnError extends boolean = false>(\n  options?: Options<GetSmsStatsSummaryData, ThrowOnError>,\n): RequestResult<\n  GetSmsStatsSummaryResponses,\n  GetSmsStatsSummaryErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetSmsStatsSummaryResponses,\n    GetSmsStatsSummaryErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/stats/summary\",\n    ...options,\n  });\n\n/**\n * Get daily outbound SMS statistics\n *\n * Returns one row of SMS lifecycle counts per calendar day. Rows use send-time attribution, so a delivery confirmation is counted on the day when its message was accepted. Recent rows can under-report `delivered` while delivery reports arrive. Days without activity contain zero counts.\n *\n * Rates and latency are whole-window aggregates available from the summary endpoint. Use the message detail endpoints for individual message status.\n *\n * A request may span up to 365 days; a longer window returns `422`. Set `timezone` for local calendar days instead of UTC.\n *\n */\nexport const getSmsStatsDaily = <ThrowOnError extends boolean = false>(\n  options?: Options<GetSmsStatsDailyData, ThrowOnError>,\n): RequestResult<\n  GetSmsStatsDailyResponses,\n  GetSmsStatsDailyErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetSmsStatsDailyResponses,\n    GetSmsStatsDailyErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/stats/daily\",\n    ...options,\n  });\n\n/**\n * Get hourly outbound SMS statistics\n *\n * Returns one row of SMS lifecycle counts per hour. Rows use send-time attribution, so a delivery confirmation is counted in the hour when its message was accepted. Recent rows can under-report `delivered` while delivery reports arrive.\n *\n * Rates and latency are whole-window aggregates available from the summary endpoint. Set `timezone` for local hours instead of UTC, including zones with sub-hour offsets.\n *\n * A request may span up to 30 days (720 rows). `from` and `to` are ISO 8601 instants; each bound rounds down to the hour and remains inclusive. An excessive or reversed window returns `422`. Use the daily endpoint for longer ranges.\n *\n */\nexport const getSmsStatsHourly = <ThrowOnError extends boolean = false>(\n  options?: Options<GetSmsStatsHourlyData, ThrowOnError>,\n): RequestResult<\n  GetSmsStatsHourlyResponses,\n  GetSmsStatsHourlyErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetSmsStatsHourlyResponses,\n    GetSmsStatsHourlyErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/stats/hourly\",\n    ...options,\n  });\n\n/**\n * Get outbound SMS statistics by originator\n *\n * Returns aggregate delivery and latency stats grouped by originator (the sender address messages were sent from) for the requested period. Rows are ranked by the `sort` metric (default `accepted`) descending and capped at the requested `limit` (default 50, hard maximum 200). Use this to compare sending performance across the senders you dispatch from.\n *\n * Rows use send-time attribution. A delivery confirmed during the period for a message accepted earlier counts against the earlier period. A recent period therefore under-reports `delivered` while delivery reports are still arriving, and its counts grow as reports arrive.\n *\n * The maximum window is 365 days; requesting a longer range returns 422.\n *\n */\nexport const getSmsStatsByOriginator = <ThrowOnError extends boolean = false>(\n  options?: Options<GetSmsStatsByOriginatorData, ThrowOnError>,\n): RequestResult<\n  GetSmsStatsByOriginatorResponses,\n  GetSmsStatsByOriginatorErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetSmsStatsByOriginatorResponses,\n    GetSmsStatsByOriginatorErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/stats/originators\",\n    ...options,\n  });\n\n/**\n * Get outbound SMS statistics by country\n *\n * Returns aggregate delivery and latency stats grouped by destination country for the requested period. Rows are ranked by the `sort` metric (default `accepted`) descending and capped at the requested `limit` (default 50, hard maximum 200). Use this to compare sending performance across the countries you send to.\n *\n * Rows use send-time attribution. A delivery confirmed during the period for a message accepted earlier counts against the earlier period. A recent period therefore under-reports `delivered` while delivery reports are still arriving, and its counts grow as reports arrive.\n *\n * The maximum window is 365 days; requesting a longer range returns 422.\n *\n */\nexport const getSmsStatsByCountry = <ThrowOnError extends boolean = false>(\n  options?: Options<GetSmsStatsByCountryData, ThrowOnError>,\n): RequestResult<\n  GetSmsStatsByCountryResponses,\n  GetSmsStatsByCountryErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetSmsStatsByCountryResponses,\n    GetSmsStatsByCountryErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/stats/countries\",\n    ...options,\n  });\n\n/**\n * Get outbound SMS statistics by category\n *\n * Returns aggregate delivery and latency stats grouped by message category for the requested period. Rows are ranked by the `sort` metric (default `accepted`) descending and capped at the requested `limit` (default 50, hard maximum 200). Use this to compare sending performance across the categories you send under.\n *\n * Rows use send-time attribution. A delivery confirmed during the period for a message accepted earlier counts against the earlier period. A recent period therefore under-reports `delivered` while delivery reports are still arriving, and its counts grow as reports arrive.\n *\n * The maximum window is 365 days; requesting a longer range returns 422.\n *\n */\nexport const getSmsStatsByCategory = <ThrowOnError extends boolean = false>(\n  options?: Options<GetSmsStatsByCategoryData, ThrowOnError>,\n): RequestResult<\n  GetSmsStatsByCategoryResponses,\n  GetSmsStatsByCategoryErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetSmsStatsByCategoryResponses,\n    GetSmsStatsByCategoryErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/stats/categories\",\n    ...options,\n  });\n\n/**\n * Get outbound SMS statistics by error code\n *\n * Returns aggregate delivery and latency statistics grouped by normalized failure reason for the requested period. The grouping key matches the `error_code` filter on the message list, so each row maps directly to the affected messages rather than a raw carrier code. Rows are ranked by the `sort` metric (default `failed`) descending and capped at the requested `limit` (default 50, hard maximum 200).\n *\n * Rows use send-time attribution. A delivery confirmed during the period for a message accepted earlier counts against the earlier period. A recent period therefore under-reports `delivered` while delivery reports are still arriving, and its counts grow as reports arrive. The maximum window is 365 days; requesting a longer range returns 422.\n *\n */\nexport const getSmsStatsByErrorCode = <ThrowOnError extends boolean = false>(\n  options?: Options<GetSmsStatsByErrorCodeData, ThrowOnError>,\n): RequestResult<\n  GetSmsStatsByErrorCodeResponses,\n  GetSmsStatsByErrorCodeErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetSmsStatsByErrorCodeResponses,\n    GetSmsStatsByErrorCodeErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/stats/error-codes\",\n    ...options,\n  });\n\n/**\n * Get outbound SMS statistics by carrier\n *\n * Returns aggregate delivery and latency stats grouped by delivery carrier for the requested period. Rows are ranked by the `sort` metric (default `accepted`) descending and capped at the requested `limit` (default 50, hard maximum 200). Use this to compare delivery performance across the carriers that handled your messages.\n *\n * Rows use send-time attribution. A delivery confirmed during the period for a message accepted earlier counts against the earlier period. A recent period therefore under-reports `delivered` while delivery reports are still arriving, and its counts grow as reports arrive.\n *\n * The maximum window is 365 days; requesting a longer range returns 422.\n *\n */\nexport const getSmsStatsByCarrier = <ThrowOnError extends boolean = false>(\n  options?: Options<GetSmsStatsByCarrierData, ThrowOnError>,\n): RequestResult<\n  GetSmsStatsByCarrierResponses,\n  GetSmsStatsByCarrierErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetSmsStatsByCarrierResponses,\n    GetSmsStatsByCarrierErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/stats/carriers\",\n    ...options,\n  });\n\n/**\n * Get outbound SMS statistics by tag\n *\n * Returns delivery and latency statistics grouped by tag (`name:value`). Rows sort by the selected metric in descending order and are capped by `limit`. The default sort is `accepted`; the default limit is 50 and the maximum is 200.\n *\n * Only tagged messages appear. A message with several tags is counted once under each, so rows do not sum to the period total.\n *\n * Rows use send-time attribution, so recent periods can under-report `delivered` while delivery reports arrive. A request may span up to 365 days; a longer window returns `422`.\n *\n */\nexport const getSmsStatsByTag = <ThrowOnError extends boolean = false>(\n  options?: Options<GetSmsStatsByTagData, ThrowOnError>,\n): RequestResult<\n  GetSmsStatsByTagResponses,\n  GetSmsStatsByTagErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetSmsStatsByTagResponses,\n    GetSmsStatsByTagErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/stats/tags\",\n    ...options,\n  });\n\n/**\n * Get outbound SMS statistics by status\n *\n * Returns one row per lifecycle status with activity in the requested period, ordered by count descending. The statuses are `accepted`, `sent`, `delivered`, `undelivered`, `failed`, `rejected`, and `expired`.\n *\n * Rows use send-time attribution. A delivery confirmed during the period for a message accepted earlier counts against the earlier period. A recent period therefore under-reports `delivered` while delivery reports are still arriving. With at most seven statuses, this breakdown has no cap, ranking, limit, or trend parameters.\n *\n * The maximum window is 365 days; requesting a longer range returns 422.\n *\n */\nexport const getSmsStatsByStatus = <ThrowOnError extends boolean = false>(\n  options?: Options<GetSmsStatsByStatusData, ThrowOnError>,\n): RequestResult<\n  GetSmsStatsByStatusResponses,\n  GetSmsStatsByStatusErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetSmsStatsByStatusResponses,\n    GetSmsStatsByStatusErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/stats/statuses\",\n    ...options,\n  });\n\n/**\n * Get aggregate inbound SMS statistics\n *\n * Returns the total number of messages your numbers received over the period, using the time the carrier received each message.\n *\n * The response contains only a count because a received message has one state. Use the outbound statistics endpoints for delivery rates and latency data about messages you send.\n *\n * The maximum window is 365 days; a longer range returns 422. Set `timezone` to resolve the period against your local calendar instead of UTC.\n *\n */\nexport const getSmsInboundStatsSummary = <ThrowOnError extends boolean = false>(\n  options?: Options<GetSmsInboundStatsSummaryData, ThrowOnError>,\n): RequestResult<\n  GetSmsInboundStatsSummaryResponses,\n  GetSmsInboundStatsSummaryErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetSmsInboundStatsSummaryResponses,\n    GetSmsInboundStatsSummaryErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/stats/inbound/summary\",\n    ...options,\n  });\n\n/**\n * Get daily inbound SMS statistics\n *\n * Returns the number of messages your numbers received, one row per calendar day. Rows use the time the carrier received each message, and days with no messages contain a zero count.\n *\n * Each row contains only a count because a received message has one state. Use the outbound statistics endpoints for lifecycle and delivery-latency data about messages you send.\n *\n * The maximum window is 365 days; a longer range returns 422. Set `timezone` to bucket rows by your local calendar day instead of UTC.\n *\n */\nexport const getSmsInboundStatsDaily = <ThrowOnError extends boolean = false>(\n  options?: Options<GetSmsInboundStatsDailyData, ThrowOnError>,\n): RequestResult<\n  GetSmsInboundStatsDailyResponses,\n  GetSmsInboundStatsDailyErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetSmsInboundStatsDailyResponses,\n    GetSmsInboundStatsDailyErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/stats/inbound/daily\",\n    ...options,\n  });\n\n/**\n * Get hourly inbound SMS statistics\n *\n * Returns the number of messages your numbers received, one row per hour. Rows use the time the carrier received each message, and hours with no messages contain a zero count.\n *\n * Each row contains only a count because a received message has one state. Use the outbound statistics endpoints for lifecycle and delivery-latency data about messages you send.\n *\n * The maximum window is 720 hours; a longer range returns 422. Set `timezone` to bucket rows by your local hour instead of UTC.\n *\n */\nexport const getSmsInboundStatsHourly = <ThrowOnError extends boolean = false>(\n  options?: Options<GetSmsInboundStatsHourlyData, ThrowOnError>,\n): RequestResult<\n  GetSmsInboundStatsHourlyResponses,\n  GetSmsInboundStatsHourlyErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetSmsInboundStatsHourlyResponses,\n    GetSmsInboundStatsHourlyErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/stats/inbound/hourly\",\n    ...options,\n  });\n\n/**\n * Get inbound SMS statistics by country\n *\n * Returns the number of messages your numbers received, grouped by the receiving number's country. Rows are ranked by volume, highest first, and use the time the carrier received each message.\n *\n * Each row contains only a count because a received message has one state. The maximum window is 365 days; a longer range returns `422`. Set `timezone` to resolve the period against your local calendar.\n *\n */\nexport const getSmsInboundStatsByCountry = <\n  ThrowOnError extends boolean = false,\n>(\n  options?: Options<GetSmsInboundStatsByCountryData, ThrowOnError>,\n): RequestResult<\n  GetSmsInboundStatsByCountryResponses,\n  GetSmsInboundStatsByCountryErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetSmsInboundStatsByCountryResponses,\n    GetSmsInboundStatsByCountryErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/stats/inbound/countries\",\n    ...options,\n  });\n\n/**\n * Get inbound SMS statistics by operator\n *\n * Returns the number of messages your numbers received, grouped by the sender's mobile operator. Rows are ranked by volume, highest first, and use the time the carrier received each message. Operators are identified by MCC-MNC when the carrier reports it.\n *\n * Each row contains only a count because a received message has one state. Messages without a reported sending operator are excluded, so the rows can sum to less than the summary total.\n *\n * The maximum window is 365 days; a longer range returns `422`. Set `timezone` to resolve the period against your local calendar.\n *\n */\nexport const getSmsInboundStatsByOperator = <\n  ThrowOnError extends boolean = false,\n>(\n  options?: Options<GetSmsInboundStatsByOperatorData, ThrowOnError>,\n): RequestResult<\n  GetSmsInboundStatsByOperatorResponses,\n  GetSmsInboundStatsByOperatorErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetSmsInboundStatsByOperatorResponses,\n    GetSmsInboundStatsByOperatorErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/stats/inbound/operators\",\n    ...options,\n  });\n\n/**\n * Get inbound SMS statistics by number\n *\n * Returns how many messages each of your numbers received. Rows are ranked by volume, highest first, and use the time the carrier received each message.\n *\n * Each row contains only a count because a received message has one state. The maximum window is 365 days; a longer range returns `422`. Set `timezone` to resolve the period against your local calendar.\n *\n */\nexport const getSmsInboundStatsByNumber = <\n  ThrowOnError extends boolean = false,\n>(\n  options?: Options<GetSmsInboundStatsByNumberData, ThrowOnError>,\n): RequestResult<\n  GetSmsInboundStatsByNumberResponses,\n  GetSmsInboundStatsByNumberErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetSmsInboundStatsByNumberResponses,\n    GetSmsInboundStatsByNumberErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/sms/stats/inbound/numbers\",\n    ...options,\n  });\n\n/**\n * Create a phone number lookup\n *\n * Returns the number's serving and issuing networks, porting state, country, and line type. The baseline fields are included in each lookup. Request additional `type` blocks for classification, presence, roaming, SIM-swap, porting-history, or credibility data. Each block reports its own `status`; only blocks with an `ok` status incur an additional charge.\n *\n * This form keeps the number out of the URL. The [URL form](/docs/api/reference/get-phone-number-lookup) performs the same lookup but cannot use an idempotency key. With this form, reuse an `Idempotency-Key` to return the stored result without another lookup or charge.\n *\n */\nexport const createPhoneNumberLookup = <ThrowOnError extends boolean = false>(\n  options: Options<CreatePhoneNumberLookupData, ThrowOnError>,\n): RequestResult<\n  CreatePhoneNumberLookupResponses,\n  CreatePhoneNumberLookupErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    CreatePhoneNumberLookupResponses,\n    CreatePhoneNumberLookupErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/lookup/phone-number\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Create an email address lookup\n *\n * Returns a deliverability `result`, a `delivery_confidence` score, address characteristics, an undeliverable `reason`, and a suggested correction when available. `result` and `reason` are open vocabularies. Handle unknown values and use `delivery_confidence` as the stable fallback. Each completed lookup incurs the same charge regardless of its result.\n *\n * This form keeps the address out of the URL. The [URL form](/docs/api/reference/get-email-lookup) performs the same lookup but cannot use an idempotency key. With this form, reuse an `Idempotency-Key` to return the stored result without another lookup or charge.\n *\n */\nexport const createEmailLookup = <ThrowOnError extends boolean = false>(\n  options: Options<CreateEmailLookupData, ThrowOnError>,\n): RequestResult<\n  CreateEmailLookupResponses,\n  CreateEmailLookupErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    CreateEmailLookupResponses,\n    CreateEmailLookupErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/lookup/email\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Create a verification\n *\n * Creates a verification and sends the recipient a one-time passcode. Provide an email address, a phone number, or both in `to`. The service sends over one channel at a time and moves to the next planned channel if delivery fails.\n *\n * Calling this again for the same recipient reuses the verification in progress. During the resend cooldown, it returns the current state without sending. After the cooldown, it sends a fresh passcode.\n *\n * The `200` response contains the current state, never the passcode. Submit the recipient's passcode with [Check a verification](/docs/api/reference/create-verification-check) before `expires_at`. An invalid recipient returns `422`; exceeding the send rate limit returns `429`.\n *\n */\nexport const createVerification = <ThrowOnError extends boolean = false>(\n  options: Options<CreateVerificationData, ThrowOnError>,\n): RequestResult<\n  CreateVerificationResponses,\n  CreateVerificationErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    CreateVerificationResponses,\n    CreateVerificationErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/verify/verifications\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Create a verification passcode check\n *\n * Checks a passcode for a recipient and returns the outcome together with the verification's current state. Identify the verification by the same `to` used to create it; you do not need to store a verification ID.\n *\n * A wrong or expired passcode returns `200 OK` with `success: false` and a `reason` such as `incorrect_code` or `expired`. `success: true` means the verification is complete. Each verification reports its final outcome once and cannot be checked again.\n *\n * An error status is returned only when the check cannot be evaluated. A `404`\n * means no verification matches the recipient or the matching one already\n * reached its final state. A `422` indicates an invalid recipient. A `429`\n * means passcodes for a recipient are being checked too quickly.\n *\n */\nexport const createVerificationCheck = <ThrowOnError extends boolean = false>(\n  options: Options<CreateVerificationCheckData, ThrowOnError>,\n): RequestResult<\n  CreateVerificationCheckResponses,\n  CreateVerificationCheckErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    CreateVerificationCheckResponses,\n    CreateVerificationCheckErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/verify/verifications/check\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Create the next verification channel attempt\n *\n * Advances an in-progress verification to the next channel in its plan and sends a fresh passcode there. Identify the verification by the same `to` recipient used to create it; no verification ID is required.\n *\n * The send bypasses the resend cooldown, and passcodes sent earlier remain valid. The response sets `last_channel` to the most recent completed send. Concurrent requests each advance the plan by at most one channel and return committed state.\n *\n * A missing in-progress verification returns `404`. A plan with no further channel returns `422 NoNextChannel`; create the verification again to resend on the current channel. If every remaining channel fails, the operation returns `422 NoAvailableChannel`. Requests that exceed the send rate limit return `429`.\n *\n */\nexport const createVerificationNextChannel = <\n  ThrowOnError extends boolean = false,\n>(\n  options: Options<CreateVerificationNextChannelData, ThrowOnError>,\n): RequestResult<\n  CreateVerificationNextChannelResponses,\n  CreateVerificationNextChannelErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    CreateVerificationNextChannelResponses,\n    CreateVerificationNextChannelErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/verify/verifications/next-channel\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * List WhatsApp messages\n *\n * Returns the workspace's WhatsApp messages as a cursor-paginated list,\n * newest first, outbound and inbound alike. Each message carries the one\n * content object it was built from: `template`, or free-form `text`,\n * `image`, `video`, `audio`, `sticker`, `document` or `location`. An inbound\n * message whose content WhatsApp models and we do not carries `unsupported`\n * instead, naming the type rather than reading back empty.\n * Filter by direction, status, contact phone number,\n * business-scoped user ID, template category, tag, or creation time; pass the response's `next_cursor` back as\n * `starting_after` to fetch the next page. To follow a single message's\n * delivery, use\n * [Get a WhatsApp message](/docs/api/reference/get-whatsapp-message)\n * instead.\n *\n * Messages are retained for **30 days**. A `created_after` earlier than that\n * is accepted and raised to the retention bound rather than rejected, so a\n * wider window returns what is still retained instead of failing. There is no\n * way to read messages older than the window.\n *\n */\nexport const listWhatsAppMessages = <ThrowOnError extends boolean = false>(\n  options?: Options<ListWhatsAppMessagesData, ThrowOnError>,\n): RequestResult<\n  ListWhatsAppMessagesResponses,\n  ListWhatsAppMessagesErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    ListWhatsAppMessagesResponses,\n    ListWhatsAppMessagesErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/whatsapp/messages\",\n    ...options,\n  });\n\n/**\n * Send a WhatsApp message\n *\n * Sends one WhatsApp message to one recipient. The request carries exactly one\n * kind of content: a message template, or free-form `text`, `image`, `video`,\n * `audio`, `sticker`, `document` or `location`. A request carrying none is\n * rejected with a `422`, and one carrying more than one is too.\n *\n * A **template** is the only content WhatsApp delivers outside an open\n * customer service window, so it is what starts a conversation. Name the\n * template, optionally pick its language variant, and fill its placeholders in\n * `components`. A Bird-managed template selects its sender number from its\n * category, so the request carries no `from`; a template your workspace\n * authored requires one. Browse your workspace's templates in the Bird\n * dashboard.\n *\n * **Free-form content** is deliverable only inside an open 24-hour customer\n * service window, which the contact opens by messaging or calling you and\n * resets each time they do it again. We do not track the window, so a send\n * outside one is accepted and then fails, carrying `service_window_expired` on\n * the message's `last_error`. Every free-form send requires `from`.\n *\n * The `202` response is the accepted message, echoing the resolved content; it\n * is not a delivery confirmation. Follow delivery with\n * [Get a WhatsApp message](/docs/api/reference/get-whatsapp-message), the\n * per-message timeline from\n * [List events for a WhatsApp message](/docs/api/reference/list-whatsapp-message-events),\n * or `whatsapp.*` webhook events.\n *\n * Each of these returns a `422`:\n *\n * - A template slug or language the catalogue does not stock.\n * - Parameter values that do not match the template's declared placeholders.\n * - A `from` this workspace cannot send from.\n * - A recipient that is neither a valid phone number nor a business-scoped user ID.\n *\n * A send from a workspace with no wallet balance fails with a `402`.\n *\n */\nexport const createWhatsAppMessage = <ThrowOnError extends boolean = false>(\n  options: Options<CreateWhatsAppMessageData, ThrowOnError>,\n): RequestResult<\n  CreateWhatsAppMessageResponses,\n  CreateWhatsAppMessageErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    CreateWhatsAppMessageResponses,\n    CreateWhatsAppMessageErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/whatsapp/messages\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Get a WhatsApp message\n *\n * Returns a single WhatsApp message: its current delivery status, per-stage timestamps (`sent_at`, `delivered_at`, `read_at`), and failure detail when it failed. It carries the one content object it was built from: `template`, or free-form `text`, `image`, `video`, `audio`, `sticker`, `document` or `location`. An inbound message whose content WhatsApp models and we do not carries `unsupported` instead, naming the type rather than reading back empty. The `status` advances asynchronously as delivery progresses, so poll this endpoint (or subscribe to `whatsapp.*` webhook events) after a send to confirm delivery. For the per-event timeline, use [List events for a WhatsApp message](/docs/api/reference/list-whatsapp-message-events) instead.\n *\n */\nexport const getWhatsAppMessage = <ThrowOnError extends boolean = false>(\n  options: Options<GetWhatsAppMessageData, ThrowOnError>,\n): RequestResult<\n  GetWhatsAppMessageResponses,\n  GetWhatsAppMessageErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    GetWhatsAppMessageResponses,\n    GetWhatsAppMessageErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/whatsapp/messages/{message_id}\",\n    ...options,\n  });\n\n/**\n * List events for a WhatsApp message\n *\n * Returns a WhatsApp message's lifecycle events in chronological order, one entry per delivery transition (`whatsapp.accepted`, `whatsapp.sent`, `whatsapp.delivered`, `whatsapp.read`, `whatsapp.failed`). The timeline is bounded and returned in full, so this list is not paginated; an unknown message ID returns `404`. For the message's current state in a single field, use [Get a WhatsApp message](/docs/api/reference/get-whatsapp-message) instead.\n *\n */\nexport const listWhatsAppMessageEvents = <ThrowOnError extends boolean = false>(\n  options: Options<ListWhatsAppMessageEventsData, ThrowOnError>,\n): RequestResult<\n  ListWhatsAppMessageEventsResponses,\n  ListWhatsAppMessageEventsErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    ListWhatsAppMessageEventsResponses,\n    ListWhatsAppMessageEventsErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/whatsapp/messages/{message_id}/events\",\n    ...options,\n  });\n\n/**\n * Get daily sending statistics\n *\n * Returns one row of aggregate sending statistics per calendar day for the workspace: UTC days by default, or your local days when `timezone` is set. Days with no activity are included with zero counts, so the series charts without client-side gap handling. Suited to charts and trend lines; for per-message exact accounting use the message detail endpoints.\n *\n * Rows use event time. For example, a complaint received on Wednesday for a message sent the prior Monday is counted in Wednesday's row.\n *\n * The maximum window is 365 days; requesting a longer range returns `422`.\n *\n */\nexport const getEmailStatsDaily = <ThrowOnError extends boolean = false>(\n  options?: Options<GetEmailStatsDailyData, ThrowOnError>,\n): RequestResult<\n  GetEmailStatsDailyResponses,\n  GetEmailStatsDailyErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetEmailStatsDailyResponses,\n    GetEmailStatsDailyErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/stats/daily\",\n    ...options,\n  });\n\n/**\n * Get hourly sending statistics\n *\n * Returns one row of aggregate sending statistics per hour for the workspace: UTC hours by default, or your local hours when `timezone` is set (a timezone with a sub-hour offset gets correctly aligned hours). Useful for inspecting send rate, deliverability, and engagement inside a single day or a recent window; hours with no activity are included with zero counts.\n *\n * Rows use event time. For example, a click recorded at 14:07 for a message sent at 09:00 lands in the 14:00 row.\n *\n * A single request may span at most 30 days (720 hourly rows); for longer ranges use the daily endpoint, which has a 365-day window. An hourly window longer than 30 days, or a `from` after `to`, returns `422`.\n *\n */\nexport const getEmailStatsHourly = <ThrowOnError extends boolean = false>(\n  options?: Options<GetEmailStatsHourlyData, ThrowOnError>,\n): RequestResult<\n  GetEmailStatsHourlyResponses,\n  GetEmailStatsHourlyErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetEmailStatsHourlyResponses,\n    GetEmailStatsHourlyErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/stats/hourly\",\n    ...options,\n  });\n\n/**\n * Get statistics by tag\n *\n * Returns delivery and engagement counts for the requested period, grouped by tag. Use it to compare performance across the tags you set at send time. Rows are ranked by the `sort` metric, `processed` by default, and capped at the requested `limit` (50 by default, 200 at most).\n *\n * Rows are computed against event time rather than send time, so engagement received during the period counts even for messages that were sent earlier.\n *\n * The window can span at most 365 days. Ask for more and you get a `422`.\n *\n */\nexport const getEmailStatsByTag = <ThrowOnError extends boolean = false>(\n  options?: Options<GetEmailStatsByTagData, ThrowOnError>,\n): RequestResult<\n  GetEmailStatsByTagResponses,\n  GetEmailStatsByTagErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetEmailStatsByTagResponses,\n    GetEmailStatsByTagErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/stats/tags\",\n    ...options,\n  });\n\n/**\n * Get aggregate email statistics\n *\n * Returns a single-row aggregate across the requested period covering delivery, bounce, complaint, open, and click counts plus the derived rates, along with processing, delivery, and total latency percentiles (p50/p95/p99). Suitable for KPI tiles, campaign reports, and email digests; the daily and hourly endpoints have the same metrics per time bucket.\n *\n * The aggregate is computed against event time (not send time), so engagement received during the period for messages sent earlier is included. Rate fields are `null` when their denominator is zero.\n *\n * The window grain follows the form of `from` and `to`: calendar days (`YYYY-MM-DD`, up to 365 days) or RFC 3339 instants (hour grain, up to 720 hours, 30 days). A rolling window such as the last 24 hours is a single request. Mixing the two forms returns `422`. Set `timezone` to compute day and hour boundaries in a local zone instead of UTC, and `compare=previous_period` to include the preceding equal-length window in the same response.\n *\n */\nexport const getEmailStatsSummary = <ThrowOnError extends boolean = false>(\n  options?: Options<GetEmailStatsSummaryData, ThrowOnError>,\n): RequestResult<\n  GetEmailStatsSummaryResponses,\n  GetEmailStatsSummaryErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetEmailStatsSummaryResponses,\n    GetEmailStatsSummaryErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/stats/summary\",\n    ...options,\n  });\n\n/**\n * Get statistics by sending IP\n *\n * Returns delivery and deliverability counts for the requested period, grouped by the specific IP address used to send each message. Use it to spot a reputation problem on one IP. Block bounces concentrated on a single IP usually mean that IP's reputation has taken a hit, and sorting by `bounces.block` puts those IPs first.\n *\n * A sending IP is only known once the receiving mail server reports an outcome: a delivery, a bounce, a deferral, or a late bounce. So this breakdown starts from the delivery stage onward. Accepted, processed, and rejected counts aren't included at all, and neither are engagement counts or processing latency. Complaints and out-of-band bounces aren't attributed to a sending IP either, so `complained` and `oob_bounces` are included but always read `0` here. Bounced, deferred, delivery latency, and total latency are the ones that have real numbers. For workspace-wide figures, use `GET /v1/email/stats/daily`. Rows are computed against event time rather than send time.\n *\n * Rows are ranked by the `sort` field, `delivered` by default, and capped at the requested `limit` (50 by default, 200 at most). The window can span at most 365 days. Ask for more and you get a `422`.\n *\n */\nexport const getEmailStatsBySendingIp = <ThrowOnError extends boolean = false>(\n  options?: Options<GetEmailStatsBySendingIpData, ThrowOnError>,\n): RequestResult<\n  GetEmailStatsBySendingIpResponses,\n  GetEmailStatsBySendingIpErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetEmailStatsBySendingIpResponses,\n    GetEmailStatsBySendingIpErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/stats/sending-ips\",\n    ...options,\n  });\n\n/**\n * Get statistics by sending domain\n *\n * Returns delivery, engagement, and deliverability counts for the requested period, grouped by sending domain: the portion of the `From` address after the `@`. Use it to compare deliverability across multiple verified domains in your workspace, for example transactional versus marketing domains, or sub-domain segregation during IP warming.\n *\n * Rows are computed against event time rather than send time, so engagement and bounces received during the period count even for messages that were sent earlier.\n *\n * Rows are ranked by the `sort` metric, `processed` by default, and capped at the requested `limit` (50 by default, 200 at most). The window can span at most 365 days. Ask for more and you get a `422`.\n *\n */\nexport const getEmailStatsBySendingDomain = <\n  ThrowOnError extends boolean = false,\n>(\n  options?: Options<GetEmailStatsBySendingDomainData, ThrowOnError>,\n): RequestResult<\n  GetEmailStatsBySendingDomainResponses,\n  GetEmailStatsBySendingDomainErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetEmailStatsBySendingDomainResponses,\n    GetEmailStatsBySendingDomainErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/stats/sending-domains\",\n    ...options,\n  });\n\n/**\n * Get statistics by category\n *\n * Returns delivery and engagement counts for the requested period, grouped by category, so you can compare deliverability and engagement between your transactional and marketing traffic. Rows are ranked by the `sort` metric, `processed` by default, and capped at the requested `limit` (50 by default, 200 at most).\n *\n * Rows are computed against event time rather than send time, so engagement received during the period counts even for messages that were sent earlier.\n *\n * The window can span at most 365 days. Ask for more and you get a `422`.\n *\n */\nexport const getEmailStatsByCategory = <ThrowOnError extends boolean = false>(\n  options?: Options<GetEmailStatsByCategoryData, ThrowOnError>,\n): RequestResult<\n  GetEmailStatsByCategoryResponses,\n  GetEmailStatsByCategoryErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetEmailStatsByCategoryResponses,\n    GetEmailStatsByCategoryErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/stats/categories\",\n    ...options,\n  });\n\n/**\n * Get statistics by mailbox provider\n *\n * Returns delivery, engagement, and deliverability counts for the requested period, grouped by recipient mailbox provider, for example `gmail`, `yahoo`, `microsoft`, or `apple`. Use it to compare how each major inbox provider treats your mail, for example to spot a delivered-rate dip or a complaint spike at one provider before it spreads. For a per-region split within a provider, use the mailbox-provider-region breakdown.\n *\n * A recipient's mailbox provider is only known once the receiving mail system reports an outcome, so this breakdown covers the delivery stage onward. Accepted, processed, and rejected counts and processing latency are not included. Rows are computed against event time rather than send time.\n *\n * Rows are ranked by the `sort` metric, `delivered` by default, and capped at the requested `limit` (50 by default, 200 at most). The window can span at most 365 days. Ask for more and you get a `422`.\n *\n */\nexport const getEmailStatsByMailboxProvider = <\n  ThrowOnError extends boolean = false,\n>(\n  options?: Options<GetEmailStatsByMailboxProviderData, ThrowOnError>,\n): RequestResult<\n  GetEmailStatsByMailboxProviderResponses,\n  GetEmailStatsByMailboxProviderErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetEmailStatsByMailboxProviderResponses,\n    GetEmailStatsByMailboxProviderErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/stats/mailbox-providers\",\n    ...options,\n  });\n\n/**\n * Get statistics by mailbox provider region\n *\n * Returns delivery, engagement, and deliverability counts for the requested period, grouped by mailbox provider and provider region pair, for example `gmail` in `NA` or `microsoft` in `EU`. The provider region is the regional grouping the receiving mail system reports for the recipient's provider. Pairing it with the provider tells apart a region label that several providers share. Use it to spot a deliverability problem isolated to one provider in one region. For a per-provider view without the region split, use the mailbox-provider breakdown.\n *\n * A provider region is only known once the receiving mail system reports an outcome, so this breakdown covers the delivery stage onward. Accepted, processed, and rejected counts and processing latency are not included. Rows are computed against event time rather than send time.\n *\n * Rows are ranked by the `sort` metric, `delivered` by default, and capped at the requested `limit` (50 by default, 200 at most). The window can span at most 365 days. Ask for more and you get a `422`.\n *\n */\nexport const getEmailStatsByMailboxProviderRegion = <\n  ThrowOnError extends boolean = false,\n>(\n  options?: Options<GetEmailStatsByMailboxProviderRegionData, ThrowOnError>,\n): RequestResult<\n  GetEmailStatsByMailboxProviderRegionResponses,\n  GetEmailStatsByMailboxProviderRegionErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetEmailStatsByMailboxProviderRegionResponses,\n    GetEmailStatsByMailboxProviderRegionErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/stats/mailbox-provider-regions\",\n    ...options,\n  });\n\n/**\n * Get statistics by recipient domain\n *\n * Returns delivery and engagement counts for the requested period, grouped by recipient mailbox domain: the part of each recipient address after the `@`, for example `gmail.com`, `yahoo.com`, or `outlook.com`. This is the finest-grained deliverability view. Where the mailbox-provider breakdown groups recipients into provider buckets such as `gmail` or `microsoft`, this keys on the exact destination domain. Use it to spot a delivery-rate dip or a complaint spike at a specific domain.\n *\n * Rows are ranked by the `sort` metric, `processed` by default, and capped at the requested `limit` (50 by default, 200 at most). Rows are computed against event time rather than send time, so engagement received during the period counts even for messages that were sent earlier.\n *\n * The window can span at most 365 days. Ask for more and you get a `422`.\n *\n */\nexport const getEmailStatsByRecipientDomain = <\n  ThrowOnError extends boolean = false,\n>(\n  options?: Options<GetEmailStatsByRecipientDomainData, ThrowOnError>,\n): RequestResult<\n  GetEmailStatsByRecipientDomainResponses,\n  GetEmailStatsByRecipientDomainErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetEmailStatsByRecipientDomainResponses,\n    GetEmailStatsByRecipientDomainErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/stats/recipient-domains\",\n    ...options,\n  });\n\n/**\n * Get statistics by template\n *\n * Returns aggregate delivery and engagement counts grouped by the template each message was sent with, so a template's deliverability and engagement can be compared side by side. Attribution is by the template used at send time; only messages sent with a template appear here, so a workspace that has sent none returns an empty list rather than an error. Each row is keyed by the template ID (`emt_…`); a template deleted after sending still appears by its ID.\n *\n * Rows are ranked by the `sort` metric (default `processed`) descending and capped at the requested `limit` (default 50, hard maximum 200). Rows are computed against event time (not send time), so engagement received during the period for messages sent earlier is included.\n *\n * The maximum window is 365 days; requesting a longer range returns `422`.\n *\n */\nexport const getEmailStatsByTemplate = <ThrowOnError extends boolean = false>(\n  options?: Options<GetEmailStatsByTemplateData, ThrowOnError>,\n): RequestResult<\n  GetEmailStatsByTemplateResponses,\n  GetEmailStatsByTemplateErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetEmailStatsByTemplateResponses,\n    GetEmailStatsByTemplateErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/stats/templates\",\n    ...options,\n  });\n\n/**\n * Get engagement by location\n *\n * Returns engagement counts (opens and clicks) for the requested period, grouped by the location they were recorded from. Use it to see where your audience engages, for example the top countries by unique opens. The reading location is only known from open and click events, so rows have engagement counts but no delivery counts or rates.\n *\n * Use `group_by` to choose the granularity: `country` (the default), `region`, or `city`. Each row has the location hierarchy down to the requested level, so a `city` grouping also reports that row's region and country. Rows are ranked by the `sort` metric, `unique_opens` by default, and capped at the requested `limit` (50 by default, 200 at most).\n *\n * Rows are computed against event time rather than send time. The window can span at most 365 days. Ask for more and you get a `422`.\n *\n */\nexport const getEmailStatsByLocation = <ThrowOnError extends boolean = false>(\n  options?: Options<GetEmailStatsByLocationData, ThrowOnError>,\n): RequestResult<\n  GetEmailStatsByLocationResponses,\n  GetEmailStatsByLocationErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetEmailStatsByLocationResponses,\n    GetEmailStatsByLocationErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/stats/locations\",\n    ...options,\n  });\n\n/**\n * Get engagement by email client\n *\n * Returns engagement counts (opens and clicks) for the requested period, grouped by the email client, operating system, or device type they were recorded from. Use it for the classic view of opens by mail client, for example the share of opens from Apple Mail compared with Gmail and Outlook. The reading environment is only known from open and click events, so rows have engagement counts but no delivery counts or rates.\n *\n * Use `group_by` to choose the facet: `email_client` (the default), `os`, or `device_type`. Each row fills in the facet you chose and leaves the other two `null`. Rows are ranked by the `sort` metric, `unique_opens` by default, and capped at the requested `limit` (50 by default, 200 at most).\n *\n * Rows are computed against event time rather than send time. The window can span at most 365 days. Ask for more and you get a `422`.\n *\n */\nexport const getEmailStatsByClient = <ThrowOnError extends boolean = false>(\n  options?: Options<GetEmailStatsByClientData, ThrowOnError>,\n): RequestResult<\n  GetEmailStatsByClientResponses,\n  GetEmailStatsByClientErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetEmailStatsByClientResponses,\n    GetEmailStatsByClientErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/stats/clients\",\n    ...options,\n  });\n\n/**\n * Get bounces by SMTP error code\n *\n * Returns bounce counts for the requested period, grouped by the SMTP error code the receiving mail server returned. It answers the question of which SMTP responses are driving your bounces. Each row reports how many recipients bounced with that code, plus the hard, soft, admin, block, and undetermined split for that code.\n *\n * This failure-only breakdown omits delivered, open, click, and rate fields because bounce codes occur only on bounce events.\n *\n * Rows are ranked by the `sort` metric, `bounced` by default, and capped at the requested `limit` (50 by default, 200 at most). They are computed against event time rather than send time. The window can span at most 365 days. Ask for more and you get a `422`.\n *\n */\nexport const getEmailStatsByBounceCode = <ThrowOnError extends boolean = false>(\n  options?: Options<GetEmailStatsByBounceCodeData, ThrowOnError>,\n): RequestResult<\n  GetEmailStatsByBounceCodeResponses,\n  GetEmailStatsByBounceCodeErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetEmailStatsByBounceCodeResponses,\n    GetEmailStatsByBounceCodeErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/stats/bounce-codes\",\n    ...options,\n  });\n\n/**\n * Get complaints by type\n *\n * Returns spam-complaint counts for the requested period, grouped by the feedback-loop complaint type the mailbox provider reported, for example `abuse`, `fraud`, or `virus`. Use it to see what kind of complaints your mail attracts.\n *\n * This breakdown only covers the complaint side. Each row has the complained count for one type and nothing else, because a complaint type is only ever recorded on a spam-complaint event.\n *\n * Rows are ranked by `complained` descending, and capped at the requested `limit` (default 50, hard maximum 200). They are computed against event time rather than send time. The window can span at most 365 days. Ask for more and you get a `422`.\n *\n */\nexport const getEmailStatsByComplaintType = <\n  ThrowOnError extends boolean = false,\n>(\n  options?: Options<GetEmailStatsByComplaintTypeData, ThrowOnError>,\n): RequestResult<\n  GetEmailStatsByComplaintTypeResponses,\n  GetEmailStatsByComplaintTypeErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetEmailStatsByComplaintTypeResponses,\n    GetEmailStatsByComplaintTypeErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/stats/complaint-types\",\n    ...options,\n  });\n\n/**\n * Get statistics by broadcast\n *\n * Returns aggregate delivery and engagement counts grouped by broadcast for the requested period, so each broadcast's deliverability and engagement can be compared side by side. Only messages sent as part of a broadcast appear here. One-off and transactional sends are not included, so a workspace that has not sent broadcasts returns an empty list rather than an error.\n *\n * Rows are ranked by the `sort` metric (default `processed`) descending and capped at the requested `limit` (default 50, hard maximum 200). Rows are computed against event time (not send time), so engagement received during the period for messages sent earlier is included.\n *\n * The maximum window is 365 days. Requesting a longer range returns a `422`. This breakdown is computed from per-message activity retained for 30 days, so it reflects roughly the last 30 days of activity even when the requested window reaches further back.\n *\n */\nexport const getEmailStatsByBroadcast = <ThrowOnError extends boolean = false>(\n  options?: Options<GetEmailStatsByBroadcastData, ThrowOnError>,\n): RequestResult<\n  GetEmailStatsByBroadcastResponses,\n  GetEmailStatsByBroadcastErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    GetEmailStatsByBroadcastResponses,\n    GetEmailStatsByBroadcastErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/stats/broadcasts\",\n    ...options,\n  });\n\n/**\n * List sending domains\n *\n * Returns all sending domains for the current workspace, newest first by default. Each item is the full domain object, including capability statuses and `dns_records`, so no per-domain follow-up read is needed. Filter with `name` to find a specific domain.\n *\n */\nexport const listDomains = <ThrowOnError extends boolean = false>(\n  options?: Options<ListDomainsData, ThrowOnError>,\n): RequestResult<ListDomainsResponses, ListDomainsErrors, ThrowOnError> =>\n  (options?.client ?? client).get<\n    ListDomainsResponses,\n    ListDomainsErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/domains\",\n    ...options,\n  });\n\n/**\n * Create a sending domain\n *\n * Registers a new sending domain and returns the DNS records to publish\n * for it. The DKIM TXT record proves ownership, and together with the\n * return-path CNAME (which also covers SPF, so no separate SPF record is\n * needed) and a DMARC policy it gates sending. The tracking CNAME is\n * optional and gates branded link tracking only. Publish the records at\n * your DNS provider, then check progress with\n * [Trigger domain verification](/docs/api/reference/verify-domain). Published\n * records are also re-checked for you automatically. Setup walkthrough:\n * [Sending domains](/docs/guides/email/sending-domains).\n *\n * The domain starts in `pending` status. A domain already registered in\n * this workspace returns `409`, and creation beyond your organization's\n * domain quota returns `422` `E10000`. A domain that never verifies\n * ownership is removed after about 14 days, with a reminder email first.\n *\n */\nexport const createDomain = <ThrowOnError extends boolean = false>(\n  options: Options<CreateDomainData, ThrowOnError>,\n): RequestResult<CreateDomainResponses, CreateDomainErrors, ThrowOnError> =>\n  (options.client ?? client).post<\n    CreateDomainResponses,\n    CreateDomainErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/domains\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Delete a sending domain\n *\n * Removes the domain and revokes its sender authorization. New sends from a deleted domain are rejected. Historical statistics and events for past sends from this domain are preserved.\n *\n */\nexport const deleteDomain = <ThrowOnError extends boolean = false>(\n  options: Options<DeleteDomainData, ThrowOnError>,\n): RequestResult<DeleteDomainResponses, DeleteDomainErrors, ThrowOnError> =>\n  (options.client ?? client).delete<\n    DeleteDomainResponses,\n    DeleteDomainErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/domains/{domain_id}\",\n    ...options,\n  });\n\n/**\n * Get a sending domain\n *\n * Returns the domain with its capability statuses and every DNS record's current verification state. This read reports the stored result of the last check. To run a fresh DNS check, use [Trigger domain verification](/docs/api/reference/verify-domain).\n *\n */\nexport const getDomain = <ThrowOnError extends boolean = false>(\n  options: Options<GetDomainData, ThrowOnError>,\n): RequestResult<GetDomainResponses, GetDomainErrors, ThrowOnError> =>\n  (options.client ?? client).get<\n    GetDomainResponses,\n    GetDomainErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/domains/{domain_id}\",\n    ...options,\n  });\n\n/**\n * Update a sending domain\n *\n * Updates settings and configuration on a sending domain. `settings`\n * changes apply immediately. Changes to `return_path`, `tracking`, or\n * `dkim` on a verified capability are staged: the current configuration\n * keeps serving until the new one's DNS records verify, then the change\n * is promoted automatically. Staged values are visible under\n * `capabilities.*.pending`. The records to publish appear in\n * `dns_records` with `state: pending`.\n *\n * Invalid combinations are rejected. Enabling tracking toggles without a\n * tracking domain, or removing the tracking domain while a toggle is on,\n * returns `409`. Enabling inbound receiving has verification\n * prerequisites that return `422`. Each rule is detailed on its field.\n *\n */\nexport const updateDomain = <ThrowOnError extends boolean = false>(\n  options: Options<UpdateDomainData, ThrowOnError>,\n): RequestResult<UpdateDomainResponses, UpdateDomainErrors, ThrowOnError> =>\n  (options.client ?? client).patch<\n    UpdateDomainResponses,\n    UpdateDomainErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/domains/{domain_id}\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Verify a domain\n *\n * Runs a fresh DNS check across the domain's records (DKIM, return path,\n * DMARC, tracking, inbound MX, and any staged changes) and returns the\n * updated domain. Use it for an immediate result after publishing or\n * correcting records. [Get a sending domain](/docs/api/reference/get-domain)\n * only reports the last stored result. Published records are also re-checked\n * for you automatically in the background.\n *\n * A `200` with records still `pending` is not a failure: the records were\n * not found yet, which is normal while DNS propagates (minutes to hours).\n * Recently verified records are not re-queried, so the call is safe to\n * repeat while you wait.\n *\n */\nexport const verifyDomain = <ThrowOnError extends boolean = false>(\n  options: Options<VerifyDomainData, ThrowOnError>,\n): RequestResult<VerifyDomainResponses, VerifyDomainErrors, ThrowOnError> =>\n  (options.client ?? client).post<\n    VerifyDomainResponses,\n    VerifyDomainErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/domains/{domain_id}/verify\",\n    ...options,\n  });\n\n/**\n * List mailboxes\n *\n * Returns a paginated list of the workspace's mailboxes, newest first. Search across addresses and display names with `q`, look a mailbox up by its exact address, or filter by lifecycle state or domain.\n *\n */\nexport const listMailboxes = <ThrowOnError extends boolean = false>(\n  options?: Options<ListMailboxesData, ThrowOnError>,\n): RequestResult<ListMailboxesResponses, ListMailboxesErrors, ThrowOnError> =>\n  (options?.client ?? client).get<\n    ListMailboxesResponses,\n    ListMailboxesErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/mailboxes\",\n    ...options,\n  });\n\n/**\n * Create a mailbox\n *\n * Creates a mailbox. The address is `local_part@domain`. The domain defaults to `inbox.ai`, Bird's shared mailbox domain, where creating the mailbox claims the address for your organization. It is first come, first served, and reserved to your organization even after the mailbox is deleted. You may instead name one of your own domains that is enabled for receiving email. An omitted local part is generated. On a custom domain, addresses of deleted mailboxes are quarantined. The same workspace can rebind one 30 days after deletion, but other workspaces never can.\n *\n */\nexport const createMailbox = <ThrowOnError extends boolean = false>(\n  options: Options<CreateMailboxData, ThrowOnError>,\n): RequestResult<CreateMailboxResponses, CreateMailboxErrors, ThrowOnError> =>\n  (options.client ?? client).post<\n    CreateMailboxResponses,\n    CreateMailboxErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/mailboxes\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Delete a mailbox\n *\n * Deletes a mailbox. The address stops receiving mail immediately and enters quarantine. The same workspace can bind it to a new mailbox after 30 days, but other workspaces never can. The mailbox and its remembered messages are kept for 30 days, so you can bring it back with `POST /email/mailboxes/{mailbox_id}/restore`. Once those 30 days are up they are deleted for good.\n *\n */\nexport const deleteMailbox = <ThrowOnError extends boolean = false>(\n  options: Options<DeleteMailboxData, ThrowOnError>,\n): RequestResult<DeleteMailboxResponses, DeleteMailboxErrors, ThrowOnError> =>\n  (options.client ?? client).delete<\n    DeleteMailboxResponses,\n    DeleteMailboxErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/mailboxes/{mailbox_id}\",\n    ...options,\n  });\n\n/**\n * Get a mailbox\n *\n * Returns a single mailbox by ID. A mailbox deleted within its 30-day restore window is still returned, with `deleted_at` set. Once the window closes it is permanently removed and returns `404`.\n *\n */\nexport const getMailbox = <ThrowOnError extends boolean = false>(\n  options: Options<GetMailboxData, ThrowOnError>,\n): RequestResult<GetMailboxResponses, GetMailboxErrors, ThrowOnError> =>\n  (options.client ?? client).get<\n    GetMailboxResponses,\n    GetMailboxErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/mailboxes/{mailbox_id}\",\n    ...options,\n  });\n\n/**\n * Update a mailbox\n *\n * Updates a mailbox. The address and domain are immutable. Lowering the retention tier deletes any remembered message older than the new cutoff, so the request requires `confirm=true`.\n *\n */\nexport const updateMailbox = <ThrowOnError extends boolean = false>(\n  options: Options<UpdateMailboxData, ThrowOnError>,\n): RequestResult<UpdateMailboxResponses, UpdateMailboxErrors, ThrowOnError> =>\n  (options.client ?? client).patch<\n    UpdateMailboxResponses,\n    UpdateMailboxErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/mailboxes/{mailbox_id}\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Restore a deleted mailbox\n *\n * Restores a mailbox deleted less than 30 days ago. The address is bound back to the mailbox and starts receiving again, and the remembered messages and conversations are available as before the delete. Once the 30-day window has passed the mailbox and its messages are permanently deleted and can no longer be restored (`404`). Restoring a mailbox that is not deleted returns a conflict, as does an address that is no longer available.\n *\n */\nexport const restoreMailbox = <ThrowOnError extends boolean = false>(\n  options: Options<RestoreMailboxData, ThrowOnError>,\n): RequestResult<RestoreMailboxResponses, RestoreMailboxErrors, ThrowOnError> =>\n  (options.client ?? client).post<\n    RestoreMailboxResponses,\n    RestoreMailboxErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/mailboxes/{mailbox_id}/restore\",\n    ...options,\n  });\n\n/**\n * Get mailbox email statistics\n *\n * Returns the mailbox's sent and received email statistics over a time window: a period-wide summary plus a bucketed series. Sent-mail metrics have the same delivery, engagement, and latency breakdowns as the email stats endpoints. `received` counts mail that arrived at the mailbox.\n *\n * Rows are bucketed by the time the event happened rather than the time the message was sent, so engagement that arrived during the period for a message sent earlier is counted here. Statistics start when the mailbox starts sending and receiving; the mailbox's all-time `message_count` and `thread_count` live on the mailbox resource itself.\n *\n * `from` and `to` accept either calendar days (`YYYY-MM-DD`, `day` granularity only) or RFC 3339 instants (`hour` granularity only). Both bounds must use the same form. Window caps depend on `granularity`: 365 days at `day`, 30 days at `hour`. Set `timezone` to report in a local zone instead of UTC.\n *\n */\nexport const getMailboxStats = <ThrowOnError extends boolean = false>(\n  options: Options<GetMailboxStatsData, ThrowOnError>,\n): RequestResult<\n  GetMailboxStatsResponses,\n  GetMailboxStatsErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    GetMailboxStatsResponses,\n    GetMailboxStatsErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/mailboxes/{mailbox_id}/stats\",\n    ...options,\n  });\n\n/**\n * Resume a suspended mailbox\n *\n * Resumes a mailbox that was suspended because the organization dropped below the plan needed to keep it active. The mailbox can send and receive again and its conversations and messages become visible. Resuming is refused when the organization has no room for another active mailbox, or for another custom inbox.ai handle, on its current plan. Free up a slot by deleting an active mailbox, or move to a bigger plan. Resuming a mailbox that is not suspended returns a conflict.\n *\n */\nexport const resumeMailbox = <ThrowOnError extends boolean = false>(\n  options: Options<ResumeMailboxData, ThrowOnError>,\n): RequestResult<ResumeMailboxResponses, ResumeMailboxErrors, ThrowOnError> =>\n  (options.client ?? client).post<\n    ResumeMailboxResponses,\n    ResumeMailboxErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/mailboxes/{mailbox_id}/resume\",\n    ...options,\n  });\n\n/**\n * List receive rules\n *\n * Returns a paginated list of the mailbox's receive rules, oldest first. Filter by action to see only allow or only block entries.\n *\n */\nexport const listMailboxReceiveRules = <ThrowOnError extends boolean = false>(\n  options: Options<ListMailboxReceiveRulesData, ThrowOnError>,\n): RequestResult<\n  ListMailboxReceiveRulesResponses,\n  ListMailboxReceiveRulesErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    ListMailboxReceiveRulesResponses,\n    ListMailboxReceiveRulesErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/mailboxes/{mailbox_id}/receive-rules\",\n    ...options,\n  });\n\n/**\n * Create a receive rule\n *\n * Adds an allow or block rule to the mailbox. Rules match the message's envelope sender. Domain entries also match subdomains. Block rules always win, both over allow rules and over the reply admission on allowlist mailboxes. An entry is either allow or block. Rules have no update operation, so a rule that needs the other action is a new rule and the old one is removed. A mailbox holds up to 200 rules.\n *\n */\nexport const createMailboxReceiveRule = <ThrowOnError extends boolean = false>(\n  options: Options<CreateMailboxReceiveRuleData, ThrowOnError>,\n): RequestResult<\n  CreateMailboxReceiveRuleResponses,\n  CreateMailboxReceiveRuleErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    CreateMailboxReceiveRuleResponses,\n    CreateMailboxReceiveRuleErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/mailboxes/{mailbox_id}/receive-rules\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Delete a receive rule\n *\n * Removes a receive rule from the mailbox. A rule's allow or block action cannot be changed after creation; delete it and create a replacement.\n *\n */\nexport const deleteMailboxReceiveRule = <ThrowOnError extends boolean = false>(\n  options: Options<DeleteMailboxReceiveRuleData, ThrowOnError>,\n): RequestResult<\n  DeleteMailboxReceiveRuleResponses,\n  DeleteMailboxReceiveRuleErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).delete<\n    DeleteMailboxReceiveRuleResponses,\n    DeleteMailboxReceiveRuleErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/mailboxes/{mailbox_id}/receive-rules/{rule_id}\",\n    ...options,\n  });\n\n/**\n * List threads\n *\n * Returns a paginated list of conversations across the workspace's mailboxes, most recently active first. `label` selects the view: the inbox (the default when omitted), `archive`, `spam`, `blocked`, or any custom label. You can also filter by mailbox, by linked contact, by participant address, or by a subject substring.\n *\n * This listing filters; it does not search message content.\n * Conversations whose every message is trashed are excluded; restoring a message\n * returns the conversation to the list.\n *\n * `before` and `after` filter by time. To page through the results, pass the response cursors back as `starting_after` or `ending_before`.\n *\n */\nexport const listEmailThreads = <ThrowOnError extends boolean = false>(\n  options?: Options<ListEmailThreadsData, ThrowOnError>,\n): RequestResult<\n  ListEmailThreadsResponses,\n  ListEmailThreadsErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    ListEmailThreadsResponses,\n    ListEmailThreadsErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/threads\",\n    ...options,\n  });\n\n/**\n * Delete a thread\n *\n * Moves the conversation and all of its messages to the trash. Trashed messages are permanently deleted after 30 days, or sooner if the mailbox's retention period ends first. Pass `permanent=true` to permanently delete the conversation and its messages immediately.\n *\n */\nexport const deleteEmailThread = <ThrowOnError extends boolean = false>(\n  options: Options<DeleteEmailThreadData, ThrowOnError>,\n): RequestResult<\n  DeleteEmailThreadResponses,\n  DeleteEmailThreadErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).delete<\n    DeleteEmailThreadResponses,\n    DeleteEmailThreadErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/threads/{thread_id}\",\n    ...options,\n  });\n\n/**\n * Get a thread\n *\n * Returns a single conversation. Fetch the messages in the conversation with [List messages in a thread](/docs/api/reference/list-email-thread-messages). A thread whose retention tier has ended returns `410 Gone`.\n *\n */\nexport const getEmailThread = <ThrowOnError extends boolean = false>(\n  options: Options<GetEmailThreadData, ThrowOnError>,\n): RequestResult<GetEmailThreadResponses, GetEmailThreadErrors, ThrowOnError> =>\n  (options.client ?? client).get<\n    GetEmailThreadResponses,\n    GetEmailThreadErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/threads/{thread_id}\",\n    ...options,\n  });\n\n/**\n * Update a thread\n *\n * Applies label changes to a conversation, and links or unlinks a contact. Adding `spam` files the conversation, and its received messages, as spam. Adding `archive` files it away without deleting it. Adding `inbox`, or removing `spam`, `blocked`, or `archive`, returns it to the inbox, and its unread count recomputes to match. An archived conversation returns to the inbox by itself when a new message arrives that isn't spam or blocked; a junk reply or an outbound send leaves it archived. To block a sender going forward, add a receive rule instead. Any field you leave out stays unchanged.\n *\n */\nexport const updateEmailThread = <ThrowOnError extends boolean = false>(\n  options: Options<UpdateEmailThreadData, ThrowOnError>,\n): RequestResult<\n  UpdateEmailThreadResponses,\n  UpdateEmailThreadErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).patch<\n    UpdateEmailThreadResponses,\n    UpdateEmailThreadErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/threads/{thread_id}\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * List messages in a thread\n *\n * Returns the messages in a conversation, newest first, both received and sent. To page through older messages, use `starting_after`. The sort order is fixed, so to render the messages in conversation order, reverse the page yourself.\n *\n * By default, every message that is not in the trash is returned, whichever folder the conversation is in. Pass `label` to narrow the view instead: use `trash` for trashed messages, or any custom label.\n *\n * Pass `include=extracted_text` to inline each message's extracted plain text. A thread whose retention tier has ended returns `410 Gone`.\n *\n */\nexport const listEmailThreadMessages = <ThrowOnError extends boolean = false>(\n  options: Options<ListEmailThreadMessagesData, ThrowOnError>,\n): RequestResult<\n  ListEmailThreadMessagesResponses,\n  ListEmailThreadMessagesErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    ListEmailThreadMessagesResponses,\n    ListEmailThreadMessagesErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/threads/{thread_id}/messages\",\n    ...options,\n  });\n\n/**\n * Get a message in a thread\n *\n * Returns a single message in a conversation, including its extracted plain text. Metadata and extracted text stay readable for the mailbox's retention tier. A message that has aged past its retention tier returns `410 Gone`. A message that exists but does not belong to this thread returns `404`.\n *\n */\nexport const getEmailThreadMessage = <ThrowOnError extends boolean = false>(\n  options: Options<GetEmailThreadMessageData, ThrowOnError>,\n): RequestResult<\n  GetEmailThreadMessageResponses,\n  GetEmailThreadMessageErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    GetEmailThreadMessageResponses,\n    GetEmailThreadMessageErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/threads/{thread_id}/messages/{message_id}\",\n    ...options,\n  });\n\n/**\n * Get a thread message's original body\n *\n * Returns the original rendered HTML and plain-text body of a message in a conversation. The original body is available for 30 days after the message occurred. Later requests return `410 Gone`, while the message's extracted text stays readable on the message itself.\n *\n */\nexport const getEmailThreadMessageBody = <ThrowOnError extends boolean = false>(\n  options: Options<GetEmailThreadMessageBodyData, ThrowOnError>,\n): RequestResult<\n  GetEmailThreadMessageBodyResponses,\n  GetEmailThreadMessageBodyErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    GetEmailThreadMessageBodyResponses,\n    GetEmailThreadMessageBodyErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/threads/{thread_id}/messages/{message_id}/body\",\n    ...options,\n  });\n\n/**\n * List a thread message's attachments\n *\n * Returns the attachments on a message in a conversation. Attachment bytes are downloadable for 30 days after the message occurred. Later requests return `410 Gone`, while the attachment metadata stays readable on the message's `attachment_manifest`.\n *\n */\nexport const listEmailThreadMessageAttachments = <\n  ThrowOnError extends boolean = false,\n>(\n  options: Options<ListEmailThreadMessageAttachmentsData, ThrowOnError>,\n): RequestResult<\n  ListEmailThreadMessageAttachmentsResponses,\n  ListEmailThreadMessageAttachmentsErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    ListEmailThreadMessageAttachmentsResponses,\n    ListEmailThreadMessageAttachmentsErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/threads/{thread_id}/messages/{message_id}/attachments\",\n    ...options,\n  });\n\n/**\n * Reply to a thread message\n *\n * Sends a reply to a specific message in a conversation, from the mailbox's own address. Recipients are derived from the message being replied to: for a received message, its Reply-To address when present, otherwise its From address; for a message the mailbox sent, its original To recipients. Set `reply_all` to copy the original To and Cc recipients in as `Cc`, leaving out the mailbox's own address. The subject and the threading headers that keep the reply in this conversation are set automatically, and the reply is recorded in the conversation. To reply to a conversation as a whole, target its newest received message.\n *\n */\nexport const replyEmailThreadMessage = <ThrowOnError extends boolean = false>(\n  options: Options<ReplyEmailThreadMessageData, ThrowOnError>,\n): RequestResult<\n  ReplyEmailThreadMessageResponses,\n  ReplyEmailThreadMessageErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    ReplyEmailThreadMessageResponses,\n    ReplyEmailThreadMessageErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/threads/{thread_id}/messages/{message_id}/reply\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Create a message from a mailbox\n *\n * Sends a new message from the mailbox's own address and starts a new conversation with it. The request mirrors the plain send request minus `from`, because the mailbox is who the message comes from. We set the RFC 5322 Message-ID, so later replies from the recipients thread back into the conversation automatically. The send is added to the mailbox's remembered messages and returned as the conversation's first message. A mailbox always sends immediately; scheduled sends are unavailable. A suspended mailbox cannot send and returns `403`.\n *\n */\nexport const createMailboxMessage = <ThrowOnError extends boolean = false>(\n  options: Options<CreateMailboxMessageData, ThrowOnError>,\n): RequestResult<\n  CreateMailboxMessageResponses,\n  CreateMailboxMessageErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    CreateMailboxMessageResponses,\n    CreateMailboxMessageErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/mailboxes/{mailbox_id}/messages\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * List a mailbox's labels\n *\n * Returns the labels available in a mailbox. First, the built-in system\n * labels:\n *\n * - The placements `inbox`, `archive`, `spam`, `blocked`, and `sent`.\n * - `trash`.\n * - `unread`.\n *\n * Then, every custom label currently in use on its conversations and\n * messages. Apply and remove labels through the conversation and message\n * update endpoints. These actions also create and remove custom labels. A\n * custom label exists while at least one message or conversation uses it.\n *\n */\nexport const listMailboxLabels = <ThrowOnError extends boolean = false>(\n  options: Options<ListMailboxLabelsData, ThrowOnError>,\n): RequestResult<\n  ListMailboxLabelsResponses,\n  ListMailboxLabelsErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    ListMailboxLabelsResponses,\n    ListMailboxLabelsErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/email/mailboxes/{mailbox_id}/labels\",\n    ...options,\n  });\n\n/**\n * List your allocated numbers\n *\n * Returns a paginated list of the phone numbers currently allocated to your workspace, newest first. Each entry is either a dedicated number you bought or a shared number managed for you, as its `kind` field indicates. Pass `number` to look one up, or narrow the list with `country_code`, `number_type`, `prefix`, and `capabilities`. An allocated number is not always enough to send from it: some countries also require an approved registration for the sender.\n */\nexport const listWorkspaceNumbers = <ThrowOnError extends boolean = false>(\n  options?: Options<ListWorkspaceNumbersData, ThrowOnError>,\n): RequestResult<\n  ListWorkspaceNumbersResponses,\n  ListWorkspaceNumbersErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    ListWorkspaceNumbersResponses,\n    ListWorkspaceNumbersErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/numbers\",\n    ...options,\n  });\n\n/**\n * List available phone numbers\n *\n * Returns phone numbers available for purchase in a country, newest first. Narrow the search with `number_type`, `capabilities`, and `prefix`. Inventory numbers are returned first and support pagination. The final page can include a live snapshot of numbers available from suppliers.\n */\nexport const listAvailableNumbers = <ThrowOnError extends boolean = false>(\n  options: Options<ListAvailableNumbersData, ThrowOnError>,\n): RequestResult<\n  ListAvailableNumbersResponses,\n  ListAvailableNumbersErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    ListAvailableNumbersResponses,\n    ListAvailableNumbersErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/numbers/available\",\n    ...options,\n  });\n\n/**\n * Get an available phone number\n *\n * Returns a single phone number available for purchase, whether it is already in inventory or can be acquired for you. Numbers supplied through a carrier remain available only while the carrier has them, so a number listed a moment ago may already be gone. A `404` means the number is currently unavailable for sale.\n */\nexport const getAvailableNumber = <ThrowOnError extends boolean = false>(\n  options: Options<GetAvailableNumberData, ThrowOnError>,\n): RequestResult<\n  GetAvailableNumberResponses,\n  GetAvailableNumberErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    GetAvailableNumberResponses,\n    GetAvailableNumberErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/numbers/available/{number}\",\n    ...options,\n  });\n\n/**\n * List your number orders\n *\n * Returns your workspace's number orders, newest first. Filter by status to find in-progress or failed orders.\n */\nexport const listNumbersOrders = <ThrowOnError extends boolean = false>(\n  options?: Options<ListNumbersOrdersData, ThrowOnError>,\n): RequestResult<\n  ListNumbersOrdersResponses,\n  ListNumbersOrdersErrors,\n  ThrowOnError\n> =>\n  (options?.client ?? client).get<\n    ListNumbersOrdersResponses,\n    ListNumbersOrdersErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/numbers/orders\",\n    ...options,\n  });\n\n/**\n * Create a number order\n *\n * Orders a number for your workspace and starts its monthly charge. Pass a\n * number from `GET /v1/numbers/available`. Whether the number is already in\n * inventory or acquired from a supplier, the response contains an order.\n *\n * Most orders complete immediately and return `201` with `status` of\n * `completed` and `number_id` populated. Read the number with\n * `GET /v1/numbers/{number_id}`. An order that cannot complete in the request\n * returns `202`; poll `GET /v1/numbers/orders/{order_id}` until it is\n * `completed` or `failed`.\n *\n * A `412` means the workspace has not\n * completed the identity verification required to acquire a sender. Complete\n * it, then retry.\n *\n */\nexport const createNumbersOrder = <ThrowOnError extends boolean = false>(\n  options: Options<CreateNumbersOrderData, ThrowOnError>,\n): RequestResult<\n  CreateNumbersOrderResponses,\n  CreateNumbersOrderErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).post<\n    CreateNumbersOrderResponses,\n    CreateNumbersOrderErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/numbers/orders\",\n    ...options,\n    headers: {\n      \"Content-Type\": \"application/json\",\n      ...options.headers,\n    },\n  });\n\n/**\n * Get a number order\n *\n * Returns a single number order by id, including its current lifecycle state and, once completed, the number it produced.\n */\nexport const getNumbersOrder = <ThrowOnError extends boolean = false>(\n  options: Options<GetNumbersOrderData, ThrowOnError>,\n): RequestResult<\n  GetNumbersOrderResponses,\n  GetNumbersOrderErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    GetNumbersOrderResponses,\n    GetNumbersOrderErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/numbers/orders/{order_id}\",\n    ...options,\n  });\n\n/**\n * Release a dedicated number\n *\n * Releases one of your workspace's dedicated numbers and stops its monthly charge. Your workspace can no longer use the number after release. Shared numbers cannot be released because they serve multiple workspaces.\n */\nexport const releaseWorkspaceNumber = <ThrowOnError extends boolean = false>(\n  options: Options<ReleaseWorkspaceNumberData, ThrowOnError>,\n): RequestResult<\n  ReleaseWorkspaceNumberResponses,\n  ReleaseWorkspaceNumberErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).delete<\n    ReleaseWorkspaceNumberResponses,\n    ReleaseWorkspaceNumberErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/numbers/{number_id}\",\n    ...options,\n  });\n\n/**\n * Get an allocated number\n *\n * Returns a single phone number allocated to your workspace, whether it is a dedicated number you bought or a shared number managed for you. Numbers you have released are no longer returned. An allocated number is not always enough to send from it: some countries also require an approved registration for the sender.\n */\nexport const getWorkspaceNumber = <ThrowOnError extends boolean = false>(\n  options: Options<GetWorkspaceNumberData, ThrowOnError>,\n): RequestResult<\n  GetWorkspaceNumberResponses,\n  GetWorkspaceNumberErrors,\n  ThrowOnError\n> =>\n  (options.client ?? client).get<\n    GetWorkspaceNumberResponses,\n    GetWorkspaceNumberErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/numbers/{number_id}\",\n    ...options,\n  });\n\n/**\n * List calls\n *\n * Returns a paginated list of the workspace's calls, ordered by start time\n * descending.\n *\n * The `status` filter selects where in the lifecycle you look, and any\n * combination is a single page: in-flight statuses (`ringing`,\n * `in_progress`), final ones, or both together. Omit it and you get\n * completed calls, which is what this list has always returned.\n *\n * A call in flight carries no economics yet: `duration_ms`, `billable_ms`,\n * `ended_at`, and `cost` are null until it ends. It keeps the same `id`\n * throughout, so the same call answers under one identity from the first\n * ring to settlement.\n *\n */\nexport const listVoiceCalls = <ThrowOnError extends boolean = false>(\n  options?: Options<ListVoiceCallsData, ThrowOnError>,\n): RequestResult<ListVoiceCallsResponses, ListVoiceCallsErrors, ThrowOnError> =>\n  (options?.client ?? client).get<\n    ListVoiceCallsResponses,\n    ListVoiceCallsErrors,\n    ThrowOnError\n  >({\n    querySerializer: { parameters: { status: { array: { explode: false } } } },\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/voice/calls\",\n    ...options,\n  });\n\n/**\n * Get a call\n *\n * Returns a single call at any point in its lifecycle. A call that is still ringing or connected answers with its in-flight `status` and no economics: `duration_ms`, `billable_ms`, `ended_at`, and `cost` fill in once it ends, at this same URL. Returns a 404 `not_found_error` if the call does not exist in the workspace.\n *\n */\nexport const getVoiceCall = <ThrowOnError extends boolean = false>(\n  options: Options<GetVoiceCallData, ThrowOnError>,\n): RequestResult<GetVoiceCallResponses, GetVoiceCallErrors, ThrowOnError> =>\n  (options.client ?? client).get<\n    GetVoiceCallResponses,\n    GetVoiceCallErrors,\n    ThrowOnError\n  >({\n    security: [\n      { scheme: \"bearer\", type: \"http\" },\n      {\n        in: \"cookie\",\n        name: \"bird_session\",\n        type: \"apiKey\",\n      },\n    ],\n    url: \"/v1/voice/calls/{call_id}\",\n    ...options,\n  });\n","// Base for resource wrappers. Each public method builds a typed hey-api SDK\n// call and runs it through the lifecycle core, returning an APIPromise (single)\n// or PaginatedPromise (list). Resources stay thin over `call`/`paginated` so the\n// per-operation logic could later be extracted to standalone tree-shakeable\n// functions without a rewrite.\n\nimport type { Client } from \"../generated/client/index.js\";\nimport type { AttemptContext, BirdHTTPClient, FetchOutcome, RequestLifecycleOptions } from \"../core/http.js\";\nimport {\n  apiPromise,\n  paginate,\n  type APIPromise,\n  type CursorPage,\n  type PaginatedPromise,\n  type RequestOptions,\n} from \"../core/result.js\";\n\n/** Resolved per-attempt inputs handed to the hey-api SDK call. */\nexport interface CallContext {\n  signal: AbortSignal;\n  /** Merged headers: caller `headers` plus the resolved `Idempotency-Key`. */\n  headers: Record<string, string>;\n}\n\nexport abstract class Resource {\n  constructor(\n    protected readonly core: BirdHTTPClient,\n    protected readonly client: Client,\n  ) {}\n\n  /** Run a single typed call through the lifecycle. */\n  protected call<T>(\n    method: string,\n    options: RequestOptions | undefined,\n    invoke: (ctx: CallContext) => Promise<FetchOutcome<T>>,\n    schemes?: string[],\n  ): APIPromise<T> {\n    // Resolved eagerly so a missing credential throws before the lifecycle starts,\n    // never as a rejected promise with a request already in flight.\n    const credentials = this.core.credentialHeaders(schemes, options?.credentials);\n    return apiPromise(\n      this.core.request<T>(\n        (ctx) => invoke(callContext(ctx, options, credentials)),\n        lifecycle(method, options),\n      ),\n    );\n  }\n\n  /** Run a cursor-paginated list through the lifecycle (each page retried independently). */\n  protected paginated<T>(\n    method: string,\n    options: RequestOptions | undefined,\n    invoke: (ctx: CallContext, cursor: string | undefined) => Promise<FetchOutcome<CursorPage<T>>>,\n    schemes?: string[],\n  ): PaginatedPromise<T> {\n    const credentials = this.core.credentialHeaders(schemes, options?.credentials);\n    return paginate<T>((cursor) =>\n      this.core.request<CursorPage<T>>(\n        (ctx) => invoke(callContext(ctx, options, credentials), cursor),\n        lifecycle(method, options),\n      ),\n    );\n  }\n}\n\nfunction callContext(\n  ctx: AttemptContext,\n  options: RequestOptions | undefined,\n  credentials: Record<string, string> = {},\n): CallContext {\n  return {\n    signal: ctx.signal,\n    headers: { ...mergeHeaders(ctx.idempotencyKey, options?.headers), ...credentials },\n  };\n}\n\nfunction lifecycle(method: string, options: RequestOptions | undefined): RequestLifecycleOptions {\n  return {\n    method,\n    idempotencyKey: options?.idempotencyKey,\n    signal: options?.signal,\n    timeout: options?.timeout,\n    maxRetries: options?.maxRetries,\n  };\n}\n\nfunction mergeHeaders(\n  idempotencyKey: string | undefined,\n  extra: Record<string, string> | undefined,\n): Record<string, string> {\n  return {\n    ...extra,\n    ...(idempotencyKey ? { \"Idempotency-Key\": idempotencyKey } : {}),\n  };\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { cancelEmailMessage, getEmailMessage, listEmailMessages } from \"../generated/sdk.gen.js\";\nimport type { CancelEmailMessageData, EmailMessage, GetEmailMessageData, ListEmailMessagesData } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, PaginatedPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { EmailMessage };\nexport type EmailListQuery = NonNullable<ListEmailMessagesData[\"query\"]>;\n\nexport class EmailResourceBase extends Resource {\n  /**\n   * Fetch one email message by `id`, with aggregate delivery status and per-state recipient counts. The message body (`html`, `text`) is not returned. Per-recipient delivery statuses and the event log are separate sub-resources: `GET /v1/email/messages/{message_id}/recipients` and `GET /v1/email/messages/{message_id}/events`.\n   *\n   * @example \n   * const msg = await bird.email.get(\"em_abc123\");\n   * msg.status; // \"accepted\" | \"processed\" | \"delivered\" | \"bounced\" | …\n   * msg.delivered_count;\n   * msg.bounced_count;\n   */\n  get(messageId: string, options?: RequestOptions): APIPromise<EmailMessage> {\n    return this.call<EmailMessage>(\"GET\", options, ({ signal, headers }) =>\n      getEmailMessage({ client: this.client, path: { message_id: messageId }, headers, signal }));\n  }\n\n  /**\n   * List sent email messages, newest first, as a cursor page (`{data, next_cursor, …}`). Pass `next_cursor` back as `starting_after` to fetch the next page. Filter by creation time with the half-open range `created_after` (inclusive) and `created_before` (exclusive). For a single UTC day, `created_after` is that day at 00:00:00Z and `created_before` is the next day at 00:00:00Z.\n   *\n   * @example \n   * for await (const message of bird.email.list({ status: \"bounced\" })) {\n   *   console.log(message.id);\n   * }\n   */\n  list(query?: EmailListQuery, options?: RequestOptions): PaginatedPromise<EmailMessage> {\n    return this.paginated<EmailMessage>(\"GET\", options, ({ signal, headers }, cursor) =>\n      listEmailMessages({ client: this.client, query: { ...query, starting_after: cursor ?? query?.starting_after }, headers, signal }));\n  }\n\n  /**\n   * Cancel a scheduled email before it sends. Only works while the message's `status` is still `scheduled`. Once it starts sending, or was already canceled, the call returns a conflict error. Canceling does not return consumed scheduled-send quota.\n   *\n   * @example \n   * await bird.email.cancel(\"em_abc123\");\n   */\n  cancel(messageId: string, options?: RequestOptions): APIPromise<void> {\n    return this.call<void>(\"POST\", options, ({ signal, headers }) =>\n      cancelEmailMessage({ client: this.client, path: { message_id: messageId }, headers, signal }));\n  }\n}\n","// The email channel-defaults contract: the configurable shape, the type\n// relaxation a configured default buys, and the merge itself.\n//\n// Its own module because the nested email resources (mailboxes, mailbox\n// messages) need the shape too, and importing it from `email.ts` — which\n// constructs them — is a cycle the circular-deps lint rejects.\n\nimport type { EmailMessageSendRequest } from \"../generated/types.gen.js\";\n\n/**\n * Channel-level defaults set at client construction. Field names mirror the\n * send params (so they read as pre-filled fields). Any field set here becomes\n * optional in `send` and is filled when omitted (per-send value wins).\n */\nexport type EmailChannelDefaults = Partial<\n  Pick<\n    EmailMessageSendRequest,\n    | \"from\"\n    | \"reply_to\"\n    | \"category\"\n    | \"track_opens\"\n    | \"track_clicks\"\n    | \"headers\"\n    | \"tags\"\n    | \"metadata\"\n    | \"ip_pool_id\"\n  >\n>;\n\ntype PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n/** Keys with a configured default. These keys are optional in `send`. */\ntype DefaultedKeys<D> = D extends object\n  ? Extract<keyof D, keyof EmailMessageSendRequest>\n  : never;\n/** `send` params with defaulted fields made optional. */\nexport type EmailSend<D> = PartialBy<EmailMessageSendRequest, DefaultedKeys<D>>;\n/** `sendBatch` params — every item relaxed the same way `send` is. */\nexport type EmailSendBatch<D> = Array<EmailSend<D>>;\n\n/**\n * Merge configured channel defaults under one set of per-call params.\n *\n * A field handed no value (`undefined`, or a `null` from a JSON-shaped input)\n * reads as unset, so its default still fills it. Spreading the params over the\n * defaults instead would let that no-value win and drop the field off the wire,\n * which the field-by-field merges in the other SDKs cannot do.\n *\n * `accepts` narrows the merge to the fields one body declares, for a request\n * that rejects a field the send body allows.\n */\nexport function withDefaults<T extends object>(\n  defaults: EmailChannelDefaults | undefined,\n  params: T,\n  accepts?: readonly string[],\n): T {\n  if (defaults === undefined) return params;\n  const fill: Record<string, unknown> =\n    accepts === undefined\n      ? { ...defaults }\n      : Object.fromEntries(\n          Object.entries(defaults).filter(([key]) => accepts.includes(key)),\n        );\n  const merged: Record<string, unknown> = { ...fill, ...params };\n  for (const [key, value] of Object.entries(fill)) {\n    if (merged[key] === undefined || merged[key] === null) merged[key] = value;\n  }\n  return merged as T;\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { getEmailStatsByBounceCode, getEmailStatsByBroadcast, getEmailStatsByCategory, getEmailStatsByClient, getEmailStatsByComplaintType, getEmailStatsByLocation, getEmailStatsByMailboxProvider, getEmailStatsByMailboxProviderRegion, getEmailStatsByRecipientDomain, getEmailStatsBySendingDomain, getEmailStatsBySendingIp, getEmailStatsByTag, getEmailStatsByTemplate, getEmailStatsDaily, getEmailStatsHourly, getEmailStatsSummary } from \"../generated/sdk.gen.js\";\nimport type { EmailStatsByBounceCodeResponse, EmailStatsByBroadcastResponse, EmailStatsByCategoryResponse, EmailStatsByClientResponse, EmailStatsByComplaintTypeResponse, EmailStatsByLocationResponse, EmailStatsByMailboxProviderRegionResponse, EmailStatsByMailboxProviderResponse, EmailStatsByRecipientDomainResponse, EmailStatsBySendingDomainResponse, EmailStatsBySendingIpResponse, EmailStatsByTemplateResponse, EmailStatsResponse, EmailStatsSummary, EmailStatsTagsResponse, GetEmailStatsByBounceCodeData, GetEmailStatsByBroadcastData, GetEmailStatsByCategoryData, GetEmailStatsByClientData, GetEmailStatsByComplaintTypeData, GetEmailStatsByLocationData, GetEmailStatsByMailboxProviderData, GetEmailStatsByMailboxProviderRegionData, GetEmailStatsByRecipientDomainData, GetEmailStatsBySendingDomainData, GetEmailStatsBySendingIpData, GetEmailStatsByTagData, GetEmailStatsByTemplateData, GetEmailStatsDailyData, GetEmailStatsHourlyData, GetEmailStatsSummaryData } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { EmailStatsSummary };\nexport type { EmailStatsResponse };\nexport type { EmailStatsTagsResponse };\nexport type { EmailStatsByCategoryResponse };\nexport type { EmailStatsBySendingIpResponse };\nexport type { EmailStatsBySendingDomainResponse };\nexport type { EmailStatsByRecipientDomainResponse };\nexport type { EmailStatsByMailboxProviderResponse };\nexport type { EmailStatsByMailboxProviderRegionResponse };\nexport type { EmailStatsByTemplateResponse };\nexport type { EmailStatsByLocationResponse };\nexport type { EmailStatsByClientResponse };\nexport type { EmailStatsByBounceCodeResponse };\nexport type { EmailStatsByComplaintTypeResponse };\nexport type { EmailStatsByBroadcastResponse };\nexport type EmailStatsSummaryQuery = NonNullable<GetEmailStatsSummaryData[\"query\"]>;\nexport type EmailStatsDailyQuery = NonNullable<GetEmailStatsDailyData[\"query\"]>;\nexport type EmailStatsHourlyQuery = NonNullable<GetEmailStatsHourlyData[\"query\"]>;\nexport type EmailStatsByTagQuery = NonNullable<GetEmailStatsByTagData[\"query\"]>;\nexport type EmailStatsByCategoryQuery = NonNullable<GetEmailStatsByCategoryData[\"query\"]>;\nexport type EmailStatsBySendingIpQuery = NonNullable<GetEmailStatsBySendingIpData[\"query\"]>;\nexport type EmailStatsBySendingDomainQuery = NonNullable<GetEmailStatsBySendingDomainData[\"query\"]>;\nexport type EmailStatsByRecipientDomainQuery = NonNullable<GetEmailStatsByRecipientDomainData[\"query\"]>;\nexport type EmailStatsByMailboxProviderQuery = NonNullable<GetEmailStatsByMailboxProviderData[\"query\"]>;\nexport type EmailStatsByMailboxProviderRegionQuery = NonNullable<GetEmailStatsByMailboxProviderRegionData[\"query\"]>;\nexport type EmailStatsByTemplateQuery = NonNullable<GetEmailStatsByTemplateData[\"query\"]>;\nexport type EmailStatsByLocationQuery = NonNullable<GetEmailStatsByLocationData[\"query\"]>;\nexport type EmailStatsByClientQuery = NonNullable<GetEmailStatsByClientData[\"query\"]>;\nexport type EmailStatsByBounceCodeQuery = NonNullable<GetEmailStatsByBounceCodeData[\"query\"]>;\nexport type EmailStatsByComplaintTypeQuery = NonNullable<GetEmailStatsByComplaintTypeData[\"query\"]>;\nexport type EmailStatsByBroadcastQuery = NonNullable<GetEmailStatsByBroadcastData[\"query\"]>;\n\nexport class EmailStatsResource extends Resource {\n  /**\n   * Aggregate email KPIs for one period: sends, delivered, bounces, complaints, opens, clicks, their rates, and latency percentiles. The `from` and `to` values are both `YYYY-MM-DD` days or both RFC 3339 instants (hour grain). Add `compare=previous_period` for deltas versus the prior window. For a per-day or per-hour series use `email.stats.daily` or `email.stats.hourly`.\n   *\n   * @example Summary for a month\n   * const s = await bird.email.stats.summary({ from: \"2026-05-01\", to: \"2026-05-31\" });\n   * console.log(s.sends_accepted, s.delivery.delivered);\n   */\n  summary(query?: EmailStatsSummaryQuery, options?: RequestOptions): APIPromise<EmailStatsSummary> {\n    return this.call<EmailStatsSummary>(\"GET\", options, ({ signal, headers }) =>\n      getEmailStatsSummary({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Per-day email stats series (counts, rates, latency percentiles), gap-filled with zero rows, max 365 days. At most one filter of `category`, `sending_domain`, `tag`, `sending_ip`, `recipient_domain`, `template`. For hour resolution use `email.stats.hourly`; for one aggregate row use `email.stats.summary`.\n   *\n   * @example \n   * const series = await bird.email.stats.daily({ from: \"2026-05-01\", to: \"2026-05-31\" });\n   * for (const row of series.data) console.log(row.bucket, row.delivery.delivered);\n   */\n  daily(query?: EmailStatsDailyQuery, options?: RequestOptions): APIPromise<EmailStatsResponse> {\n    return this.call<EmailStatsResponse>(\"GET\", options, ({ signal, headers }) =>\n      getEmailStatsDaily({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Per-hour email stats series, gap-filled with zero rows, max 720 hours (30 days). Takes the same single-dimension filters as `email.stats.daily`; for longer ranges use `email.stats.daily`, for one aggregate row use `email.stats.summary`.\n   *\n   * @example \n   * const series = await bird.email.stats.hourly({ from: \"2026-05-01\", to: \"2026-05-02\" });\n   * for (const row of series.data) console.log(row.bucket, row.delivery.delivered);\n   */\n  hourly(query?: EmailStatsHourlyQuery, options?: RequestOptions): APIPromise<EmailStatsResponse> {\n    return this.call<EmailStatsResponse>(\"GET\", options, ({ signal, headers }) =>\n      getEmailStatsHourly({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Email delivery and engagement stats grouped by tag, one row per `name:value` pair set at send time. Rows are ranked by `sort`, `processed` by default. Set `include_trend=true` to add a per-bucket rate series to each row.\n   *\n   * @example Top 10 tags by delivered\n   * const { data } = await bird.email.stats.byTag({\n   *   from: \"2026-05-01\",\n   *   to: \"2026-05-31\",\n   *   sort: \"delivered\",\n   *   limit: 10,\n   * });\n   * for (const row of data) console.log(row.tag, row.delivery.delivered);\n   */\n  byTag(query?: EmailStatsByTagQuery, options?: RequestOptions): APIPromise<EmailStatsTagsResponse> {\n    return this.call<EmailStatsTagsResponse>(\"GET\", options, ({ signal, headers }) =>\n      getEmailStatsByTag({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Email delivery and engagement stats grouped by category, meaning `transactional` compared with `marketing`. Rows are ranked by `sort`, `processed` by default. Set `include_trend=true` to add a per-bucket rate series to each row.\n   *\n   * @example \n   * const { data } = await bird.email.stats.byCategory({ from: \"2026-05-01\", to: \"2026-05-31\" });\n   * for (const row of data) console.log(row.category, row.delivery.delivered);\n   */\n  byCategory(query?: EmailStatsByCategoryQuery, options?: RequestOptions): APIPromise<EmailStatsByCategoryResponse> {\n    return this.call<EmailStatsByCategoryResponse>(\"GET\", options, ({ signal, headers }) =>\n      getEmailStatsByCategory({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Delivery and bounce stats grouped by sending IP, with deferral counts alongside them. `sort=bounces.block` surfaces reputation-damaged IPs first. Engagement, accepted, and processed counts aren't available per IP, and complaint and out-of-band bounce counts always read `0` here. For workspace-wide figures, use `email.stats.daily`.\n   *\n   * @example \n   * const { data } = await bird.email.stats.bySendingIp({\n   *   from: \"2026-05-01\",\n   *   to: \"2026-05-31\",\n   *   sort: \"bounces.block\",\n   *   limit: 20,\n   * });\n   * for (const row of data) console.log(row.sending_ip, row.delivery.delivered);\n   */\n  bySendingIp(query?: EmailStatsBySendingIpQuery, options?: RequestOptions): APIPromise<EmailStatsBySendingIpResponse> {\n    return this.call<EmailStatsBySendingIpResponse>(\"GET\", options, ({ signal, headers }) =>\n      getEmailStatsBySendingIp({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Email delivery and engagement stats grouped by sending (`From`) domain, so you can compare deliverability across your workspace's verified domains. For per-IP reputation instead, use `email.stats.by_sending_ip`.\n   *\n   * @example \n   * const { data } = await bird.email.stats.bySendingDomain({\n   *   from: \"2026-05-01\",\n   *   to: \"2026-05-31\",\n   *   sort: \"delivery_rate\",\n   *   limit: 25,\n   * });\n   * for (const row of data) console.log(row.sending_domain, row.delivery.delivery_rate);\n   */\n  bySendingDomain(query?: EmailStatsBySendingDomainQuery, options?: RequestOptions): APIPromise<EmailStatsBySendingDomainResponse> {\n    return this.call<EmailStatsBySendingDomainResponse>(\"GET\", options, ({ signal, headers }) =>\n      getEmailStatsBySendingDomain({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Email delivery and engagement stats grouped by exact recipient mailbox domain, for example `gmail.com`. Finer-grained than `email.stats.by_mailbox_provider`, which buckets domains into providers.\n   *\n   * @example \n   * const { data } = await bird.email.stats.byRecipientDomain({\n   *   from: \"2026-05-01\",\n   *   to: \"2026-05-31\",\n   *   sort: \"bounce_rate\",\n   *   limit: 25,\n   * });\n   * for (const row of data) console.log(row.recipient_domain, row.delivery.bounce_rate);\n   */\n  byRecipientDomain(query?: EmailStatsByRecipientDomainQuery, options?: RequestOptions): APIPromise<EmailStatsByRecipientDomainResponse> {\n    return this.call<EmailStatsByRecipientDomainResponse>(\"GET\", options, ({ signal, headers }) =>\n      getEmailStatsByRecipientDomain({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Email delivery and engagement stats grouped by recipient mailbox provider, for example `gmail`, `microsoft`, or `yahoo`. It covers the delivery stage onward and omits accepted or processed counts. For a per-region split within a provider, use `email.stats.by_mailbox_provider_region`; for exact destination domains instead, use `email.stats.by_recipient_domain`.\n   *\n   * @example \n   * const { data } = await bird.email.stats.byMailboxProvider({\n   *   from: \"2026-05-01\",\n   *   to: \"2026-05-31\",\n   *   limit: 25,\n   * });\n   * for (const row of data) console.log(row.mailbox_provider, row.delivery.delivered);\n   */\n  byMailboxProvider(query?: EmailStatsByMailboxProviderQuery, options?: RequestOptions): APIPromise<EmailStatsByMailboxProviderResponse> {\n    return this.call<EmailStatsByMailboxProviderResponse>(\"GET\", options, ({ signal, headers }) =>\n      getEmailStatsByMailboxProvider({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Email delivery and engagement stats grouped by a mailbox provider and provider region pair, for example `gmail` in `NA`. It covers the delivery stage onward and omits accepted or processed counts. For the provider-level view without the region split, use `email.stats.by_mailbox_provider`.\n   *\n   * @example \n   * const { data } = await bird.email.stats.byMailboxProviderRegion({\n   *   from: \"2026-05-01\",\n   *   to: \"2026-05-31\",\n   *   limit: 25,\n   * });\n   * for (const row of data) console.log(row.mailbox_provider, row.mailbox_provider_region, row.delivery.delivered);\n   */\n  byMailboxProviderRegion(query?: EmailStatsByMailboxProviderRegionQuery, options?: RequestOptions): APIPromise<EmailStatsByMailboxProviderRegionResponse> {\n    return this.call<EmailStatsByMailboxProviderRegionResponse>(\"GET\", options, ({ signal, headers }) =>\n      getEmailStatsByMailboxProviderRegion({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Email delivery and engagement stats grouped by the template used at send time, keyed by template id (`emt_…`); only templated sends appear. A single template's trend over time comes from `email.stats.daily` with its `template` filter.\n   *\n   * @example \n   * const { data } = await bird.email.stats.byTemplate({\n   *   from: \"2026-05-01\",\n   *   to: \"2026-05-31\",\n   *   sort: \"open_rate\",\n   *   limit: 25,\n   * });\n   * for (const row of data) console.log(row.template_id, row.engagement.open_rate);\n   */\n  byTemplate(query?: EmailStatsByTemplateQuery, options?: RequestOptions): APIPromise<EmailStatsByTemplateResponse> {\n    return this.call<EmailStatsByTemplateResponse>(\"GET\", options, ({ signal, headers }) =>\n      getEmailStatsByTemplate({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Opens and clicks grouped by country, region, or city, whichever you choose with `group_by`. It only has engagement counts, no delivery counts or rates. For engagement grouped by mail client or device instead, use `email.stats.by_client`.\n   *\n   * @example \n   * const { data } = await bird.email.stats.byLocation({\n   *   from: \"2026-05-01\",\n   *   to: \"2026-05-31\",\n   *   limit: 25,\n   * });\n   * for (const row of data) console.log(row.country, row.engagement.unique_opens);\n   */\n  byLocation(query?: EmailStatsByLocationQuery, options?: RequestOptions): APIPromise<EmailStatsByLocationResponse> {\n    return this.call<EmailStatsByLocationResponse>(\"GET\", options, ({ signal, headers }) =>\n      getEmailStatsByLocation({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Opens and clicks grouped by mail client, operating system, or device type, whichever you choose with `group_by`. It only has engagement counts, no delivery counts or rates. For engagement grouped by geography instead, use `email.stats.by_location`.\n   *\n   * @example \n   * const { data } = await bird.email.stats.byClient({\n   *   from: \"2026-05-01\",\n   *   to: \"2026-05-31\",\n   *   limit: 25,\n   * });\n   * for (const row of data) console.log(row.email_client, row.engagement.unique_opens);\n   */\n  byClient(query?: EmailStatsByClientQuery, options?: RequestOptions): APIPromise<EmailStatsByClientResponse> {\n    return this.call<EmailStatsByClientResponse>(\"GET\", options, ({ signal, headers }) =>\n      getEmailStatsByClient({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Bounce counts grouped by the SMTP error code the receiving mail server returned. Each row also breaks the bounce down into its hard, soft, admin, block, and undetermined split. It omits delivered, open, and click counts because a bounce code only appears on a bounce event. For bounces broken down by destination instead, use `email.stats.by_recipient_domain` or `email.stats.by_mailbox_provider`.\n   *\n   * @example \n   * const { data } = await bird.email.stats.byBounceCode({\n   *   from: \"2026-05-01\",\n   *   to: \"2026-05-31\",\n   *   sort: \"bounced\",\n   *   limit: 25,\n   * });\n   * for (const row of data) console.log(row.smtp_error_code, row.bounced);\n   */\n  byBounceCode(query?: EmailStatsByBounceCodeQuery, options?: RequestOptions): APIPromise<EmailStatsByBounceCodeResponse> {\n    return this.call<EmailStatsByBounceCodeResponse>(\"GET\", options, ({ signal, headers }) =>\n      getEmailStatsByBounceCode({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Spam-complaint counts grouped by the feedback-loop complaint type, for example `abuse`, `fraud`, or `virus`. This complaint-only breakdown omits delivery and engagement counts. For complaints broken down by destination instead, use `email.stats.by_mailbox_provider` or `email.stats.by_recipient_domain`.\n   *\n   * @example \n   * const { data } = await bird.email.stats.byComplaintType({ from: \"2026-05-01\", to: \"2026-05-31\" });\n   * for (const row of data) console.log(row.feedback_type, row.complained);\n   */\n  byComplaintType(query?: EmailStatsByComplaintTypeQuery, options?: RequestOptions): APIPromise<EmailStatsByComplaintTypeResponse> {\n    return this.call<EmailStatsByComplaintTypeResponse>(\"GET\", options, ({ signal, headers }) =>\n      getEmailStatsByComplaintType({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Email delivery and engagement stats grouped by broadcast. Only broadcast sends appear. Reflects roughly the last 30 days of activity.\n   *\n   * @example \n   * const { data } = await bird.email.stats.byBroadcast({\n   *   from: \"2026-05-01\",\n   *   to: \"2026-05-31\",\n   *   sort: \"click_rate\",\n   *   limit: 25,\n   * });\n   * for (const row of data) console.log(row.broadcast_id, row.engagement.click_rate);\n   */\n  byBroadcast(query?: EmailStatsByBroadcastQuery, options?: RequestOptions): APIPromise<EmailStatsByBroadcastResponse> {\n    return this.call<EmailStatsByBroadcastResponse>(\"GET\", options, ({ signal, headers }) =>\n      getEmailStatsByBroadcast({ client: this.client, query, headers, signal }));\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { createMailbox, deleteMailbox, getMailbox, getMailboxStats, listMailboxLabels, listMailboxes, restoreMailbox, resumeMailbox, updateMailbox } from \"../generated/sdk.gen.js\";\nimport type { CreateMailboxData, DeleteMailboxData, EmailMailboxLabelList, GetMailboxData, GetMailboxStatsData, ListMailboxLabelsData, ListMailboxesData, Mailbox, MailboxStatsResponse, RestoreMailboxData, ResumeMailboxData, UpdateMailboxData } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, PaginatedPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { Mailbox };\nexport type { MailboxStatsResponse };\nexport type { EmailMailboxLabelList };\nexport type EmailMailboxesListQuery = NonNullable<ListMailboxesData[\"query\"]>;\nexport type EmailMailboxesCreateParams = NonNullable<CreateMailboxData[\"body\"]>;\nexport type EmailMailboxesUpdateParams = NonNullable<UpdateMailboxData[\"body\"]>;\nexport type EmailMailboxesUpdateQuery = NonNullable<UpdateMailboxData[\"query\"]>;\nexport type EmailMailboxesStatsQuery = NonNullable<GetMailboxStatsData[\"query\"]>;\n\nexport class EmailMailboxesResourceBase extends Resource {\n  /**\n   * List the workspace's mailboxes as a cursor page, newest first. Search addresses and display names with q, or filter by exact address, state, or domain.\n   *\n   * @example List mailboxes\n   * for await (const mailbox of bird.email.mailboxes.list()) {\n   *   console.log(mailbox.address);\n   * }\n   */\n  list(query?: EmailMailboxesListQuery, options?: RequestOptions): PaginatedPromise<Mailbox> {\n    return this.paginated<Mailbox>(\"GET\", options, ({ signal, headers }, cursor) =>\n      listMailboxes({ client: this.client, query: { ...query, starting_after: cursor ?? query?.starting_after }, headers, signal }));\n  }\n\n  /**\n   * Create a mailbox: a durable agent identity that owns an email address, groups mail into conversations, and remembers conversations for its retention tier.\n   *\n   * @example Create a mailbox\n   * const mailbox = await bird.email.mailboxes.create({ display_name: \"Support\" });\n   * console.log(mailbox.address); // \"abc123@inbox.ai\"\n   */\n  create(params: EmailMailboxesCreateParams = {}, options?: RequestOptions): APIPromise<Mailbox> {\n    return this.call<Mailbox>(\"POST\", options, ({ signal, headers }) =>\n      createMailbox({ client: this.client, body: params, headers, signal }));\n  }\n\n  /**\n   * Read one mailbox by ID. A mailbox deleted within its 30-day restore window is still returned, with `deleted_at` set. Once that window closes it is gone and this returns `404`.\n   *\n   * @example Get a mailbox\n   * const mailbox = await bird.email.mailboxes.get(\"mbx_01abc\");\n   * console.log(mailbox.state); // \"active\"\n   */\n  get(mailboxId: string, options?: RequestOptions): APIPromise<Mailbox> {\n    return this.call<Mailbox>(\"GET\", options, ({ signal, headers }) =>\n      getMailbox({ client: this.client, path: { mailbox_id: mailboxId }, headers, signal }));\n  }\n\n  /**\n   * Update a mailbox's display name, reply-to, receive policy, retention tier, IP pool, or metadata. Lowering the retention tier requires `confirm=true` when it would delete remembered messages older than the new cutoff.\n   *\n   * @example Change a mailbox's receive policy\n   * const mailbox = await bird.email.mailboxes.update(\"mbx_01abc\", {\n   *   receive_policy: \"open\",\n   * });\n   * console.log(mailbox.id, mailbox.receive_policy);\n   */\n  update(mailboxId: string, params: EmailMailboxesUpdateParams = {}, query?: EmailMailboxesUpdateQuery, options?: RequestOptions): APIPromise<Mailbox> {\n    return this.call<Mailbox>(\"PATCH\", options, ({ signal, headers }) =>\n      updateMailbox({ client: this.client, path: { mailbox_id: mailboxId }, body: params, query, headers, signal }));\n  }\n\n  /**\n   * Delete a mailbox. The address stops receiving immediately and is quarantined. The mailbox and its remembered messages stay restorable for 30 days through the restore endpoint, then are permanently deleted.\n   *\n   * @example Delete a mailbox\n   * await bird.email.mailboxes.delete(\"mbx_01abc\");\n   */\n  delete(mailboxId: string, options?: RequestOptions): APIPromise<void> {\n    return this.call<void>(\"DELETE\", options, ({ signal, headers }) =>\n      deleteMailbox({ client: this.client, path: { mailbox_id: mailboxId }, headers, signal }));\n  }\n\n  /**\n   * Restore a mailbox deleted less than 30 days ago: the address starts receiving again and the remembered messages are back. Past the window the mailbox is permanently deleted and returns `404`. A mailbox that is not deleted returns `409`.\n   *\n   * @example Restore a deleted mailbox\n   * const mailbox = await bird.email.mailboxes.restore(\"mbx_01abc\");\n   * console.log(mailbox.deleted_at); // null\n   */\n  restore(mailboxId: string, options?: RequestOptions): APIPromise<Mailbox> {\n    return this.call<Mailbox>(\"POST\", options, ({ signal, headers }) =>\n      restoreMailbox({ client: this.client, path: { mailbox_id: mailboxId }, headers, signal }));\n  }\n\n  /**\n   * Resume a suspended mailbox so it can send and receive again and its conversations become visible. Fails if your plan does not have room for another active mailbox (or another custom inbox.ai handle). Delete an active mailbox or upgrade first. A mailbox that is not suspended returns `409`.\n   *\n   * @example Resume a suspended mailbox\n   * const mailbox = await bird.email.mailboxes.resume(\"mbx_01abc\");\n   * console.log(mailbox.state); // \"active\"\n   */\n  resume(mailboxId: string, options?: RequestOptions): APIPromise<Mailbox> {\n    return this.call<Mailbox>(\"POST\", options, ({ signal, headers }) =>\n      resumeMailbox({ client: this.client, path: { mailbox_id: mailboxId }, headers, signal }));\n  }\n\n  /**\n   * Read a mailbox's sent and received email statistics over a window: a period summary plus a bucketed series. Rows are bucketed by event time rather than send time, so engagement that arrived during the period for messages sent earlier is counted here. Both window bounds must use the same form, calendar days or RFC 3339 instants, matching the granularity.\n   *\n   * @example Get mailbox stats\n   * const stats = await bird.email.mailboxes.stats(\"mbx_01abc\");\n   * console.log(stats.summary?.sends_accepted);\n   */\n  stats(mailboxId: string, query?: EmailMailboxesStatsQuery, options?: RequestOptions): APIPromise<MailboxStatsResponse> {\n    return this.call<MailboxStatsResponse>(\"GET\", options, ({ signal, headers }) =>\n      getMailboxStats({ client: this.client, path: { mailbox_id: mailboxId }, query, headers, signal }));\n  }\n\n  /**\n   * List the labels available in a mailbox: the built-in system labels (inbox, archive, spam, blocked, sent, trash, unread) plus every custom label in use.\n   *\n   * @example List a mailbox's labels\n   * const labels = await bird.email.mailboxes.labels(\"mbx_01abc\");\n   * console.log(labels.data.map((label) => label.name));\n   */\n  labels(mailboxId: string, options?: RequestOptions): APIPromise<EmailMailboxLabelList> {\n    return this.call<EmailMailboxLabelList>(\"GET\", options, ({ signal, headers }) =>\n      listMailboxLabels({ client: this.client, path: { mailbox_id: mailboxId }, headers, signal }));\n  }\n}\n","// `bird.email.mailboxes.messages` — the override residue over the generated\n// mailbox facade: create (address-list body).\n\nimport { createMailboxMessage } from \"../generated/sdk.gen.js\";\nimport type {\n  EmailMailboxComposeRequest,\n  EmailThreadMessage,\n} from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport { withDefaults, type EmailChannelDefaults } from \"./emailDefaults.js\";\nimport type { APIPromise, RequestOptions } from \"../core/result.js\";\n\n/** Parameters for sending a new message from a mailbox. */\nexport type EmailMailboxesMessagesCreateParams = EmailMailboxComposeRequest;\n/** A message returned from create or reply. */\nexport type { EmailThreadMessage };\n\n// A compose body rejects any field it does not declare — it has no `from` (the\n// mailbox is the sender) and no sending-infrastructure fields — so only these\n// defaults may be merged in. Exported for the type test, which fails if a\n// default a compose accepts is missing here.\nexport const COMPOSE_FIELDS = [\"reply_to\", \"category\", \"tags\", \"metadata\"] as const;\n\nexport class EmailMailboxesMessagesResource extends Resource {\n  #defaults?: EmailChannelDefaults;\n\n  constructor(\n    core: ConstructorParameters<typeof Resource>[0],\n    client: ConstructorParameters<typeof Resource>[1],\n    defaults?: EmailChannelDefaults,\n  ) {\n    super(core, client);\n    this.#defaults = defaults;\n  }\n\n  /**\n   * Send a new email from this mailbox, starting a new conversation.\n   *\n   * @example Send from a mailbox\n   * const msg = await bird.email.mailboxes.messages.create(\"mbx_01abc\", {\n   *   to: [\"customer@example.com\"],\n   *   subject: \"Hello\",\n   *   text: \"Hi there!\",\n   * });\n   */\n  create(\n    mailboxId: string,\n    params: EmailMailboxesMessagesCreateParams,\n    options?: RequestOptions,\n  ): APIPromise<EmailThreadMessage> {\n    const body = withDefaults(this.#defaults, params, COMPOSE_FIELDS);\n    return this.call<EmailThreadMessage>(\"POST\", options, ({ signal, headers }) =>\n      createMailboxMessage({\n        client: this.client,\n        path: { mailbox_id: mailboxId },\n        body,\n        headers,\n        signal,\n      }),\n    );\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { createMailboxReceiveRule, deleteMailboxReceiveRule, listMailboxReceiveRules } from \"../generated/sdk.gen.js\";\nimport type { CreateMailboxReceiveRuleData, DeleteMailboxReceiveRuleData, ListMailboxReceiveRulesData, ReceiveRule } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, PaginatedPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { ReceiveRule };\nexport type EmailMailboxesReceiveRulesListQuery = NonNullable<ListMailboxReceiveRulesData[\"query\"]>;\nexport type EmailMailboxesReceiveRulesCreateParams = NonNullable<CreateMailboxReceiveRuleData[\"body\"]>;\n\nexport class EmailMailboxesReceiveRulesResource extends Resource {\n  /**\n   * List a mailbox's allow/block receive rules as a cursor page, oldest first. Filter by action.\n   *\n   * @example List a mailbox's receive rules\n   * for await (const rule of bird.email.mailboxes.receiveRules.list(\"mbx_01abc\")) {\n   *   console.log(rule.action, rule.entry);\n   * }\n   */\n  list(mailboxId: string, query?: EmailMailboxesReceiveRulesListQuery, options?: RequestOptions): PaginatedPromise<ReceiveRule> {\n    return this.paginated<ReceiveRule>(\"GET\", options, ({ signal, headers }, cursor) =>\n      listMailboxReceiveRules({ client: this.client, path: { mailbox_id: mailboxId }, query: { ...query, starting_after: cursor ?? query?.starting_after }, headers, signal }));\n  }\n\n  /**\n   * Add an allow or block rule for a sender address or domain to a mailbox. Block always wins. Up to 200 rules per mailbox.\n   *\n   * @example Block a domain\n   * const rule = await bird.email.mailboxes.receiveRules.create(\"mbx_01abc\", {\n   *   action: \"block\",\n   *   entry: \"spam.example.com\",\n   * });\n   * console.log(rule.id);\n   */\n  create(mailboxId: string, params: EmailMailboxesReceiveRulesCreateParams, options?: RequestOptions): APIPromise<ReceiveRule> {\n    return this.call<ReceiveRule>(\"POST\", options, ({ signal, headers }) =>\n      createMailboxReceiveRule({ client: this.client, path: { mailbox_id: mailboxId }, body: params, headers, signal }));\n  }\n\n  /**\n   * Remove a receive rule from a mailbox. Rules have no update operation, so a rule's allow or block action cannot be changed after it is created.\n   *\n   * @example Delete a rule\n   * await bird.email.mailboxes.receiveRules.delete(\"mbx_01abc\", \"erl_01xyz\");\n   */\n  delete(mailboxId: string, ruleId: string, options?: RequestOptions): APIPromise<void> {\n    return this.call<void>(\"DELETE\", options, ({ signal, headers }) =>\n      deleteMailboxReceiveRule({ client: this.client, path: { mailbox_id: mailboxId, rule_id: ruleId }, headers, signal }));\n  }\n}\n","// `bird.email.mailboxes` — the generated mailbox facade plus its nested\n// collections (messages, receiveRules), which a generated class can't declare.\n\nimport { Resource } from \"./base.js\";\nimport type { EmailChannelDefaults } from \"./emailDefaults.js\";\nimport { EmailMailboxesResourceBase } from \"./emailMailboxes.gen.js\";\nimport { EmailMailboxesMessagesResource } from \"./emailMailboxesMessages.js\";\nimport { EmailMailboxesReceiveRulesResource } from \"./emailMailboxesReceiveRules.gen.js\";\n\nexport class EmailMailboxesResource extends EmailMailboxesResourceBase {\n  /** Messages sent from the mailbox's own address — `bird.email.mailboxes.messages.create(...)`. */\n  readonly messages: EmailMailboxesMessagesResource;\n\n  /** Per-sender allow/block rules — `bird.email.mailboxes.receiveRules.create(...)`, `.list(...)`, `.delete(...)`. */\n  readonly receiveRules: EmailMailboxesReceiveRulesResource;\n\n  constructor(\n    core: ConstructorParameters<typeof Resource>[0],\n    client: ConstructorParameters<typeof Resource>[1],\n    defaults?: EmailChannelDefaults,\n  ) {\n    super(core, client);\n    this.messages = new EmailMailboxesMessagesResource(core, client, defaults);\n    this.receiveRules = new EmailMailboxesReceiveRulesResource(core, client);\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { deleteEmailThread, getEmailThread, listEmailThreads, updateEmailThread } from \"../generated/sdk.gen.js\";\nimport type { DeleteEmailThreadData, EmailThread, GetEmailThreadData, ListEmailThreadsData, UpdateEmailThreadData } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, PaginatedPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { EmailThread };\nexport type EmailThreadsListQuery = NonNullable<ListEmailThreadsData[\"query\"]>;\nexport type EmailThreadsUpdateParams = NonNullable<UpdateEmailThreadData[\"body\"]>;\nexport type EmailThreadsDeleteQuery = NonNullable<DeleteEmailThreadData[\"query\"]>;\n\nexport class EmailThreadsResourceBase extends Resource {\n  /**\n   * List mailbox conversations as a cursor page, most recently active first. `label` selects the view: inbox (default), archive, spam, blocked, or a custom label. Filter by mailbox, contact, participant address, or subject substring.\n   *\n   * @example List conversation threads\n   * for await (const thread of bird.email.threads.list({ mailbox_id: \"mbx_01abc\" })) {\n   *   console.log(thread.id, thread.subject);\n   * }\n   */\n  list(query?: EmailThreadsListQuery, options?: RequestOptions): PaginatedPromise<EmailThread> {\n    return this.paginated<EmailThread>(\"GET\", options, ({ signal, headers }, cursor) =>\n      listEmailThreads({ client: this.client, query: { ...query, starting_after: cursor ?? query?.starting_after }, headers, signal }));\n  }\n\n  /**\n   * Get one conversation: participants, counts, labels, read state. Fetch its messages with the thread messages endpoint.\n   *\n   * @example Get a thread\n   * const thread = await bird.email.threads.get(\"thr_01abc\");\n   * console.log(thread.subject);\n   */\n  get(threadId: string, options?: RequestOptions): APIPromise<EmailThread> {\n    return this.call<EmailThread>(\"GET\", options, ({ signal, headers }) =>\n      getEmailThread({ client: this.client, path: { thread_id: threadId }, headers, signal }));\n  }\n\n  /**\n   * Add or remove labels on a conversation, or link and unlink a contact. Adding `spam` files it as spam, `archive` clears it out of the inbox, and `inbox` brings it back.\n   *\n   * @example Apply label changes to a thread\n   * const thread = await bird.email.threads.update(\"thr_01abc\", {\n   *   labels: { add: [\"archive\"] },\n   * });\n   * console.log(thread.id);\n   */\n  update(threadId: string, params: EmailThreadsUpdateParams = {}, options?: RequestOptions): APIPromise<EmailThread> {\n    return this.call<EmailThread>(\"PATCH\", options, ({ signal, headers }) =>\n      updateEmailThread({ client: this.client, path: { thread_id: threadId }, body: params, headers, signal }));\n  }\n\n  /**\n   * Move a conversation and all its messages to trash (purged after 30 days), or delete permanently with `?permanent=true`.\n   *\n   * @example Delete a thread\n   * await bird.email.threads.delete(\"thr_01abc\", { permanent: true });\n   */\n  delete(threadId: string, query?: EmailThreadsDeleteQuery, options?: RequestOptions): APIPromise<void> {\n    return this.call<void>(\"DELETE\", options, ({ signal, headers }) =>\n      deleteEmailThread({ client: this.client, path: { thread_id: threadId }, query, headers, signal }));\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { getEmailThreadMessage, getEmailThreadMessageBody, listEmailThreadMessageAttachments, listEmailThreadMessages, replyEmailThreadMessage } from \"../generated/sdk.gen.js\";\nimport type { EmailThreadMessage, EmailThreadMessageAttachmentList, EmailThreadMessageBody, GetEmailThreadMessageBodyData, GetEmailThreadMessageData, ListEmailThreadMessageAttachmentsData, ListEmailThreadMessagesData, ReplyEmailThreadMessageData } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, PaginatedPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { EmailThreadMessage };\nexport type { EmailThreadMessageBody };\nexport type { EmailThreadMessageAttachmentList };\nexport type EmailThreadsMessagesListQuery = NonNullable<ListEmailThreadMessagesData[\"query\"]>;\nexport type EmailThreadsMessagesReplyParams = NonNullable<ReplyEmailThreadMessageData[\"body\"]>;\n\nexport class EmailThreadsMessagesResource extends Resource {\n  /**\n   * List the messages in a conversation newest first, both directions. Page older messages with `starting_after`, and pass `include=extracted_text` to inline each message's extracted plain text.\n   *\n   * @example List a thread's messages\n   * for await (const msg of bird.email.threads.messages.list(\"thr_01abc\")) {\n   *   console.log(msg.id, msg.direction);\n   * }\n   */\n  list(threadId: string, query?: EmailThreadsMessagesListQuery, options?: RequestOptions): PaginatedPromise<EmailThreadMessage> {\n    return this.paginated<EmailThreadMessage>(\"GET\", options, ({ signal, headers }, cursor) =>\n      listEmailThreadMessages({ client: this.client, path: { thread_id: threadId }, query: { ...query, starting_after: cursor ?? query?.starting_after }, headers, signal }));\n  }\n\n  /**\n   * Get one conversation message with its extracted plain text, readable for the mailbox's full retention tier without MIME parsing.\n   *\n   * @example Get a message\n   * const msg = await bird.email.threads.messages.get(\"thr_01abc\", \"rem_01xyz\");\n   * console.log(msg.direction); // \"inbound\"\n   */\n  get(threadId: string, messageId: string, options?: RequestOptions): APIPromise<EmailThreadMessage> {\n    return this.call<EmailThreadMessage>(\"GET\", options, ({ signal, headers }) =>\n      getEmailThreadMessage({ client: this.client, path: { thread_id: threadId, message_id: messageId }, headers, signal }));\n  }\n\n  /**\n   * Get the original rendered HTML and plain-text body of a conversation message. Available for 30 days. After that, use the message's extracted_text.\n   *\n   * @example Get a message body\n   * const body = await bird.email.threads.messages.body(\"thr_01abc\", \"rem_01xyz\");\n   * console.log(body.text);\n   */\n  body(threadId: string, messageId: string, options?: RequestOptions): APIPromise<EmailThreadMessageBody> {\n    return this.call<EmailThreadMessageBody>(\"GET\", options, ({ signal, headers }) =>\n      getEmailThreadMessageBody({ client: this.client, path: { thread_id: threadId, message_id: messageId }, headers, signal }));\n  }\n\n  /**\n   * Reply to a specific conversation message from the mailbox's own address. To reply to a conversation, target its newest received message. Recipients, subject, and threading headers are derived automatically.\n   *\n   * @example Reply to a message\n   * const reply = await bird.email.threads.messages.reply(\"thr_01abc\", \"rem_01xyz\", {\n   *   text: \"Thanks for reaching out!\",\n   * });\n   * console.log(reply.id);\n   */\n  reply(threadId: string, messageId: string, params: EmailThreadsMessagesReplyParams = {}, options?: RequestOptions): APIPromise<EmailThreadMessage> {\n    return this.call<EmailThreadMessage>(\"POST\", options, ({ signal, headers }) =>\n      replyEmailThreadMessage({ client: this.client, path: { thread_id: threadId, message_id: messageId }, body: params, headers, signal }));\n  }\n\n  /**\n   * List the attachments on a conversation message. Bytes are downloadable for 30 days, and the metadata stays readable afterward on the message's attachment_manifest.\n   *\n   * @example List a message's attachments\n   * const atts = await bird.email.threads.messages.attachments(\"thr_01abc\", \"rem_01xyz\");\n   * console.log(atts.data.map((a) => a.filename));\n   */\n  attachments(threadId: string, messageId: string, options?: RequestOptions): APIPromise<EmailThreadMessageAttachmentList> {\n    return this.call<EmailThreadMessageAttachmentList>(\"GET\", options, ({ signal, headers }) =>\n      listEmailThreadMessageAttachments({ client: this.client, path: { thread_id: threadId, message_id: messageId }, headers, signal }));\n  }\n}\n","// `bird.email.threads` — the generated thread facade plus its nested messages\n// collection, which a generated class can't declare.\n\nimport { Resource } from \"./base.js\";\nimport { EmailThreadsResourceBase } from \"./emailThreads.gen.js\";\nimport { EmailThreadsMessagesResource } from \"./emailThreadsMessages.gen.js\";\n\nexport class EmailThreadsResource extends EmailThreadsResourceBase {\n  /** Messages in a conversation — `bird.email.threads.messages.list(...)`, `.reply(...)`, … */\n  readonly messages: EmailThreadsMessagesResource;\n\n  constructor(...args: ConstructorParameters<typeof Resource>) {\n    super(...args);\n    this.messages = new EmailThreadsMessagesResource(...args);\n  }\n}\n","// `bird.email` — the email channel: send email messages and read their delivery status.\n\nimport {\n  cancelEmailMessage,\n  createEmailMessage,\n  createEmailMessageBatch,\n  getEmailMessage,\n  listEmailMessages,\n} from \"../generated/sdk.gen.js\";\nimport type {\n  EmailMessage,\n  EmailMessageBatchRequest,\n  EmailMessageBatchResponse,\n  EmailMessageSendRequest,\n  ListEmailMessagesData,\n} from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport { EmailResourceBase } from \"./email.gen.js\";\nimport { withDefaults } from \"./emailDefaults.js\";\nimport type {\n  EmailChannelDefaults,\n  EmailSend,\n  EmailSendBatch,\n} from \"./emailDefaults.js\";\nimport { EmailStatsResource } from \"./emailStats.gen.js\";\nimport { EmailMailboxesResource } from \"./emailMailboxes.js\";\nimport { EmailThreadsResource } from \"./emailThreads.js\";\nimport type {\n  APIPromise,\n  PaginatedPromise,\n  RequestOptions,\n} from \"../core/result.js\";\n\n/** An email message with aggregate delivery status. */\nexport type { EmailMessage };\n/** Body for `bird.email.send`. */\nexport type EmailSendParams = EmailMessageSendRequest;\n/** Body for `bird.email.sendBatch`. Contains send params validated as a unit. */\nexport type EmailSendBatchParams = EmailMessageBatchRequest;\n/** Result of `bird.email.sendBatch`. Contains one accepted item per submitted message. */\nexport type EmailSendBatchResult = EmailMessageBatchResponse;\n/** Filters and cursor params for `bird.email.list`. */\nexport type EmailListQuery = NonNullable<ListEmailMessagesData[\"query\"]>;\nexport type {\n  EmailChannelDefaults,\n  EmailSend,\n  EmailSendBatch,\n} from \"./emailDefaults.js\";\n\nexport class EmailResource<\n  D extends EmailChannelDefaults | undefined = undefined,\n> extends EmailResourceBase {\n  #defaults?: D;\n\n  /** Email statistics — `bird.email.stats.summary(...)`, `.daily(...)`, `.byTag(...)`, … */\n  readonly stats: EmailStatsResource;\n\n  /** Durable agent mailboxes — `bird.email.mailboxes.list(...)`, `.create(...)`, … */\n  readonly mailboxes: EmailMailboxesResource;\n\n  /** Conversations across every mailbox — `bird.email.threads.list(...)`, `.get(...)`, … */\n  readonly threads: EmailThreadsResource;\n\n  constructor(\n    core: ConstructorParameters<typeof Resource>[0],\n    client: ConstructorParameters<typeof Resource>[1],\n    defaults?: D,\n  ) {\n    super(core, client);\n    this.#defaults = defaults;\n    this.stats = new EmailStatsResource(core, client);\n    this.mailboxes = new EmailMailboxesResource(core, client, defaults);\n    this.threads = new EmailThreadsResource(core, client);\n  }\n\n  /**\n   * Send an email message. Resolves once the message is accepted for delivery\n   * (the API's 202). Throws on failure — a 422 (unverified sender, all\n   * recipients suppressed, validation) is a `BirdValidationError`. Fields set as\n   * channel defaults may be omitted (per-send value wins).\n   *\n   * @example Send a message\n   * const msg = await bird.email.send({\n   *   from: { email: \"onboarding@messagebird.dev\", name: \"Bird\" },\n   *   to: [\"delivered@messagebird.dev\"],\n   *   subject: \"Hello from Bird\",\n   *   html: \"<p>My first Bird email.</p>\",\n   * });\n   * console.log(msg.id, msg.status); // \"em_…\", \"accepted\"\n   *\n   * @example Send a published template instead of inline content\n   * const msg = await bird.email.send({\n   *   from: { email: \"onboarding@messagebird.dev\", name: \"Bird\" },\n   *   to: [\"delivered@messagebird.dev\"],\n   *   category: \"transactional\",\n   *   template: {\n   *     slug: \"welcome-email\",\n   *     parameters: { first_name: \"Jane\" },\n   *   },\n   * });\n   * console.log(msg.id, msg.status);\n   *\n   * @example Sending to the sandbox bounce address, which hard-bounces every time\n   * const msg = await bird.email.send({\n   *   from: { email: \"onboarding@messagebird.dev\", name: \"Bird\" },\n   *   to: [\"bounce+signup-flow@messagebird.dev\"],\n   *   subject: \"Sandbox bounce test\",\n   *   html: \"<p>This message will hard-bounce.</p>\",\n   *   tags: [{ name: \"flow\", value: \"signup\" }],\n   *   metadata: { test_run: \"docs-capture-1\" },\n   * });\n   * console.log(msg.id, msg.status); // \"em_…\", \"accepted\"\n   *\n   * @example A richer send — cc/bcc, reply-to, tags, metadata, click-tracking off, and an idempotency key (safe to retry; the server dedupes)\n   * await bird.email.send(\n   *   {\n   *     from: \"hello@acme.com\",\n   *     to: [\"a@example.com\", \"b@example.com\"],\n   *     cc: [\"manager@example.com\"],\n   *     reply_to: [\"support@acme.com\"],\n   *     subject: \"Your March invoice\",\n   *     html: \"<p>Attached.</p>\",\n   *     tags: [{ name: \"category\", value: \"billing\" }],\n   *     metadata: { invoice_id: \"inv_123\" },\n   *     track_clicks: false,\n   *   },\n   *   { idempotencyKey: \"invoice-march/cust_1\" },\n   * );\n   *\n   * @example Branch on the typed error hierarchy\n   * import { BirdRateLimitError, BirdValidationError, BirdAPIError } from \"@messagebird/sdk\";\n   *\n   * try {\n   *   await bird.email.send({\n   *     from: { email: \"onboarding@messagebird.dev\", name: \"Bird\" },\n   *     to: [\"delivered@messagebird.dev\"],\n   *     subject: \"Hello from Bird\",\n   *     html: \"<p>My first Bird email.</p>\",\n   *   });\n   * } catch (err) {\n   *   if (err instanceof BirdRateLimitError) console.log(`rate limited; retry in ${err.retryAfter}s`);\n   *   else if (err instanceof BirdValidationError) console.error(err.details);\n   *   else if (err instanceof BirdAPIError) console.error(err.code, err.requestId);\n   *   else throw err;\n   * }\n   *\n   * @example Errors as values with `.safe()`\n   * const { data, error } = await bird.email\n   *   .send({\n   *     from: { email: \"onboarding@messagebird.dev\", name: \"Bird\" },\n   *     to: [\"delivered@messagebird.dev\"],\n   *     subject: \"Hello from Bird\",\n   *     html: \"<p>My first Bird email.</p>\",\n   *   })\n   *   .safe();\n   * if (error) console.error(error.message);\n   * else console.log(data.id);\n   */\n  send(\n    params: EmailSend<D>,\n    options?: RequestOptions,\n  ): APIPromise<EmailMessage> {\n    // EmailSend<D> guarantees the caller supplied every field not covered by a\n    // default, so the merge is a complete EmailSendParams. TS can't reprove that\n    // through withDefaults, so the assertion is necessary here.\n    const body = withDefaults(this.#defaults, params) as EmailSendParams;\n    return this.call<EmailMessage>(\"POST\", options, ({ signal, headers }) =>\n      createEmailMessage({ client: this.client, body, headers, signal }),\n    );\n  }\n\n  /**\n   * Send a batch of up to 100 independent email messages in one request. The\n   * batch is validated as a unit — if any item fails validation (unverified\n   * sender, all recipients suppressed, field-level errors) the whole batch is\n   * rejected with a `BirdValidationError` and nothing is queued. Resolves with\n   * one accepted item per submitted message, in submission order, once the batch\n   * is accepted (the API's 202). Channel defaults are applied per item, so a\n   * field set as a default may be omitted from every item (per-item value wins).\n   *\n   * @example Send a batch of messages\n   * const batch = await bird.email.sendBatch([\n   *   {\n   *     from: { email: \"onboarding@messagebird.dev\", name: \"Bird\" },\n   *     to: [\"alice@example.com\"],\n   *     subject: \"Your receipt\",\n   *     html: \"<p>Thanks, Alice.</p>\",\n   *   },\n   *   {\n   *     from: { email: \"onboarding@messagebird.dev\", name: \"Bird\" },\n   *     to: [\"bob@example.com\"],\n   *     subject: \"Your receipt\",\n   *     html: \"<p>Thanks, Bob.</p>\",\n   *   },\n   * ]);\n   * for (const item of batch.data) console.log(item.id, item.status);\n   */\n  sendBatch(\n    params: EmailSendBatch<D>,\n    options?: RequestOptions,\n  ): APIPromise<EmailSendBatchResult> {\n    const body = params.map((item) =>\n      withDefaults(this.#defaults, item),\n    ) as EmailSendBatchParams;\n    return this.call<EmailSendBatchResult>(\n      \"POST\",\n      options,\n      ({ signal, headers }) =>\n        createEmailMessageBatch({ client: this.client, body, headers, signal }),\n    );\n  }\n\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { assignAudienceContacts, createAudience, deleteAudience, getAudience, listAudienceContacts, listAudiences, unassignAudienceContact, unassignAudienceContacts, updateAudience } from \"../generated/sdk.gen.js\";\nimport type { AssignAudienceContactsData, Audience, AudienceMember, CreateAudienceData, DeleteAudienceData, GetAudienceData, ListAudienceContactsData, ListAudiencesData, UnassignAudienceContactData, UnassignAudienceContactsData, UpdateAudienceData } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, PaginatedPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { Audience };\nexport type { AudienceMember };\nexport type AudienceListQuery = NonNullable<ListAudiencesData[\"query\"]>;\nexport type AudienceCreateParams = NonNullable<CreateAudienceData[\"body\"]>;\nexport type AudienceUpdateParams = NonNullable<UpdateAudienceData[\"body\"]>;\nexport type AudienceListContactsQuery = NonNullable<ListAudienceContactsData[\"query\"]>;\nexport type AudienceAddContactsParams = NonNullable<AssignAudienceContactsData[\"body\"]>;\nexport type AudienceRemoveContactsParams = NonNullable<UnassignAudienceContactsData[\"body\"]>;\n\nexport class AudiencesResource extends Resource {\n  /**\n   * List the workspace's audiences as a cursor page, newest first. Filter by name substring with `q`.\n   *\n   * @example Iterate every audience, or take one page\n   * for await (const audience of bird.audiences.list()) {\n   *   console.log(audience.id, audience.name);\n   * }\n   */\n  list(query?: AudienceListQuery, options?: RequestOptions): PaginatedPromise<Audience> {\n    return this.paginated<Audience>(\"GET\", options, ({ signal, headers }, cursor) =>\n      listAudiences({ client: this.client, query: { ...query, starting_after: cursor ?? query?.starting_after }, headers, signal }));\n  }\n\n  /**\n   * Get a single audience by ID: name, description, and type. Members are listed separately with `audiences.list_contacts`.\n   *\n   * @example Fetch an audience by id\n   * const audience = await bird.audiences.get(\"adn_01krdgeqcxet5s7t44vh8rt9mg\");\n   * console.log(audience.name);\n   */\n  get(audienceId: string, options?: RequestOptions): APIPromise<Audience> {\n    return this.call<Audience>(\"GET\", options, ({ signal, headers }) =>\n      getAudience({ client: this.client, path: { audience_id: audienceId }, headers, signal }));\n  }\n\n  /**\n   * Create an audience in the workspace. New audiences start empty; add contacts with `audiences.add_contacts` or `contacts.batch`. Only static audiences can be created today.\n   *\n   * @example Create an audience\n   * const audience = await bird.audiences.create({ name: \"Newsletter subscribers\" });\n   * console.log(audience.id); // \"adn_…\"\n   */\n  create(params: AudienceCreateParams, options?: RequestOptions): APIPromise<Audience> {\n    return this.call<Audience>(\"POST\", options, ({ signal, headers }) =>\n      createAudience({ client: this.client, body: params, headers, signal }));\n  }\n\n  /**\n   * Update an audience's name or description. Omitted fields are unchanged; a `null` description clears it.\n   *\n   * @example Rename an audience\n   * await bird.audiences.update(\"adn_01krdgeqcxet5s7t44vh8rt9mg\", { name: \"Renamed\" });\n   */\n  update(audienceId: string, params: AudienceUpdateParams = {}, options?: RequestOptions): APIPromise<Audience> {\n    return this.call<Audience>(\"PATCH\", options, ({ signal, headers }) =>\n      updateAudience({ client: this.client, path: { audience_id: audienceId }, body: params, headers, signal }));\n  }\n\n  /**\n   * Delete an audience and its memberships; contacts themselves are not deleted. Fails while a broadcast targeting the audience is scheduled, accepted, sending, or canceling.\n   *\n   * @example Delete an audience by id\n   * await bird.audiences.delete(\"adn_01krdgeqcxet5s7t44vh8rt9mg\");\n   */\n  delete(audienceId: string, options?: RequestOptions): APIPromise<void> {\n    return this.call<void>(\"DELETE\", options, ({ signal, headers }) =>\n      deleteAudience({ client: this.client, path: { audience_id: audienceId }, headers, signal }));\n  }\n\n  /**\n   * List the contacts in a static audience by ID, as a cursor page ordered by when each contact joined (most recent first). Each entry pairs the contact with its join time.\n   *\n   * @example Iterate an audience's members\n   * for await (const member of bird.audiences.listContacts(\"adn_01krdgeqcxet5s7t44vh8rt9mg\")) {\n   *   console.log(member.contact.id, member.joined_at);\n   * }\n   */\n  listContacts(audienceId: string, query?: AudienceListContactsQuery, options?: RequestOptions): PaginatedPromise<AudienceMember> {\n    return this.paginated<AudienceMember>(\"GET\", options, ({ signal, headers }, cursor) =>\n      listAudienceContacts({ client: this.client, path: { audience_id: audienceId }, query: { ...query, starting_after: cursor ?? query?.starting_after }, headers, signal }));\n  }\n\n  /**\n   * Add up to 1,000 existing contacts to a static audience by ID. Fails entirely if any contact ID does not exist. To add contacts you have not created yet, use `contacts.batch` with `audience_ids` instead: it matches or creates each contact by email address and assigns it to the audience in one call.\n   *\n   * @example Add contacts to an audience\n   * await bird.audiences.addContacts(\"adn_01krdgeqcxet5s7t44vh8rt9mg\", {\n   *   contact_ids: [\"con_01krdgeqcxet5s7t44vh8rt9mg\"],\n   * });\n   */\n  addContacts(audienceId: string, params: AudienceAddContactsParams, options?: RequestOptions): APIPromise<void> {\n    return this.call<void>(\"POST\", options, ({ signal, headers }) =>\n      assignAudienceContacts({ client: this.client, path: { audience_id: audienceId }, body: params, headers, signal }));\n  }\n\n  /**\n   * Remove up to 1,000 contacts from a static audience by ID. Fails entirely if any contact ID does not exist; contacts are not deleted.\n   *\n   * @example Remove contacts from an audience\n   * await bird.audiences.removeContacts(\"adn_01krdgeqcxet5s7t44vh8rt9mg\", {\n   *   contact_ids: [\"con_01krdgeqcxet5s7t44vh8rt9mg\"],\n   * });\n   */\n  removeContacts(audienceId: string, params: AudienceRemoveContactsParams, options?: RequestOptions): APIPromise<void> {\n    return this.call<void>(\"POST\", options, ({ signal, headers }) =>\n      unassignAudienceContacts({ client: this.client, path: { audience_id: audienceId }, body: params, headers, signal }));\n  }\n\n  /**\n   * Remove one contact's membership from an audience. The contact itself is not deleted and stays a member of any other audiences.\n   *\n   * @example Remove one contact's membership\n   * await bird.audiences.removeContact(\n   *   \"adn_01krdgeqcxet5s7t44vh8rt9mg\",\n   *   \"con_01krdgeqcxet5s7t44vh8rt9mg\",\n   * );\n   */\n  removeContact(audienceId: string, contactId: string, options?: RequestOptions): APIPromise<void> {\n    return this.call<void>(\"DELETE\", options, ({ signal, headers }) =>\n      unassignAudienceContact({ client: this.client, path: { audience_id: audienceId, contact_id: contactId }, headers, signal }));\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { createDomain, deleteDomain, getDomain, listDomains, updateDomain, verifyDomain } from \"../generated/sdk.gen.js\";\nimport type { CreateDomainData, DeleteDomainData, Domain, GetDomainData, ListDomainsData, UpdateDomainData, VerifyDomainData } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, PaginatedPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { Domain };\nexport type DomainListQuery = NonNullable<ListDomainsData[\"query\"]>;\nexport type DomainCreateParams = NonNullable<CreateDomainData[\"body\"]>;\nexport type DomainUpdateParams = NonNullable<UpdateDomainData[\"body\"]>;\n\nexport class DomainsResource extends Resource {\n  /**\n   * List the workspace's sending domains with their verification status, as a cursor page.\n   *\n   * @example Iterate every sending domain\n   * for await (const domain of bird.domains.list()) {\n   *   console.log(domain.id, domain.status);\n   * }\n   */\n  list(query?: DomainListQuery, options?: RequestOptions): PaginatedPromise<Domain> {\n    return this.paginated<Domain>(\"GET\", options, ({ signal, headers }, cursor) =>\n      listDomains({ client: this.client, query: { ...query, starting_after: cursor ?? query?.starting_after }, headers, signal }));\n  }\n\n  /**\n   * Fetch one sending domain: verification status and the DNS records with their individual verification states.\n   *\n   * @example Fetch a sending domain by id\n   * const domain = await bird.domains.get(\"dom_01krdgeqcxet5s7t44vh8rt9mg\");\n   * console.log(domain.domain);\n   */\n  get(domainId: string, options?: RequestOptions): APIPromise<Domain> {\n    return this.call<Domain>(\"GET\", options, ({ signal, headers }) =>\n      getDomain({ client: this.client, path: { domain_id: domainId }, headers, signal }));\n  }\n\n  /**\n   * Register a new sending domain and get the DNS records to publish. Verification is a second step: the records go live at the DNS provider, then email_domains_verify confirms them. Propagation takes minutes to hours, so the first verify often still reports unverified and a later one succeeds.\n   *\n   * @example Register a sending domain\n   * const domain = await bird.domains.create({ domain: \"mail.acme.com\" });\n   * console.log(domain.id, domain.status); // \"dom_…\", \"pending\"\n   */\n  create(params: DomainCreateParams, options?: RequestOptions): APIPromise<Domain> {\n    return this.call<Domain>(\"POST\", options, ({ signal, headers }) =>\n      createDomain({ client: this.client, body: params, headers, signal }));\n  }\n\n  /**\n   * Trigger a DNS verification check for a sending domain and return the refreshed domain with per-record results. Safe to repeat while waiting for DNS propagation.\n   *\n   * @example Re-run the DNS verification check\n   * const domain = await bird.domains.verify(\"dom_01krdgeqcxet5s7t44vh8rt9mg\");\n   * console.log(domain.status); // \"verified\" once DNS is in place\n   */\n  verify(domainId: string, options?: RequestOptions): APIPromise<Domain> {\n    return this.call<Domain>(\"POST\", options, ({ signal, headers }) =>\n      verifyDomain({ client: this.client, path: { domain_id: domainId }, headers, signal }));\n  }\n\n  /**\n   * Update a sending domain's tracking and inbound configuration. Tracking: click_tracking and open_tracking apply immediately to new sends, and the tracking domain can be set, changed, or removed (the name part only, and the sending domain is appended for you). Enabling either toggle with no tracking domain configured returns 409, and removing the tracking domain while either toggle is still on also returns 409. Tracking-domain changes on a verified domain are staged behind DNS verification, so the current config keeps serving until the new records verify. Inbound receiving: inbound.enabled starts or stops receiving mail for the domain. Enabling requires the domain's DKIM to be verified first (a fresh enable on an unverified domain returns 422), and a domain already receiving inbound for another organization returns 422. The MX records to publish are always listed in dns_records regardless, marked optional until inbound.enabled is set, so receiving starts only once you set it even when those records are already published. Publishing them earlier is not free: on a domain at the zone apex they replace the MX records carrying its existing mail, changing where that mail is delivered.\n   *\n   * @example Enable tracking on a domain\n   * await bird.domains.update(\"dom_01krdgeqcxet5s7t44vh8rt9mg\", {\n   *   settings: { click_tracking: true, open_tracking: true },\n   *   tracking: { name: \"links\" },\n   * });\n   */\n  update(domainId: string, params: DomainUpdateParams = {}, options?: RequestOptions): APIPromise<Domain> {\n    return this.call<Domain>(\"PATCH\", options, ({ signal, headers }) =>\n      updateDomain({ client: this.client, path: { domain_id: domainId }, body: params, headers, signal }));\n  }\n\n  /**\n   * Delete a sending domain by ID. Revokes its sender authorization: new sends from the domain are rejected afterward, while historical statistics and events for past sends are preserved. Destructive.\n   *\n   * @example Delete a sending domain by id\n   * await bird.domains.delete(\"dom_01krdgeqcxet5s7t44vh8rt9mg\");\n   */\n  delete(domainId: string, options?: RequestOptions): APIPromise<void> {\n    return this.call<void>(\"DELETE\", options, ({ signal, headers }) =>\n      deleteDomain({ client: this.client, path: { domain_id: domainId }, headers, signal }));\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { archiveContactProperty, createContactProperty, getContactProperty, listContactProperties, unarchiveContactProperty, updateContactProperty } from \"../generated/sdk.gen.js\";\nimport type { ArchiveContactPropertyData, ContactProperty, CreateContactPropertyData, GetContactPropertyData, ListContactPropertiesData, UnarchiveContactPropertyData, UpdateContactPropertyData } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, PaginatedPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { ContactProperty };\nexport type ContactPropertyListQuery = NonNullable<ListContactPropertiesData[\"query\"]>;\nexport type ContactPropertyCreateParams = NonNullable<CreateContactPropertyData[\"body\"]>;\nexport type ContactPropertyUpdateParams = NonNullable<UpdateContactPropertyData[\"body\"]>;\n\nexport class ContactPropertiesResource extends Resource {\n  /**\n   * List the workspace's contact properties as a cursor page, newest first. Archived properties are included, marked by their archived flag.\n   *\n   * @example Iterate every contact property, or take one page\n   * for await (const prop of bird.contactProperties.list()) {\n   *   console.log(prop.key, prop.type);\n   * }\n   * const page = await bird.contactProperties.list({ limit: 50 }); // page.data, page.next_cursor\n   */\n  list(query?: ContactPropertyListQuery, options?: RequestOptions): PaginatedPromise<ContactProperty> {\n    return this.paginated<ContactProperty>(\"GET\", options, ({ signal, headers }, cursor) =>\n      listContactProperties({ client: this.client, query: { ...query, starting_after: cursor ?? query?.starting_after }, headers, signal }));\n  }\n\n  /**\n   * Get a single contact property by ID: key, type, fallback value, and archived state.\n   *\n   * @example Fetch a contact property by id\n   * const prop = await bird.contactProperties.get(\"cp_01krdgeqcxet5s7t44vh8rt9mg\");\n   * console.log(prop.key, prop.type);\n   */\n  get(propertyId: string, options?: RequestOptions): APIPromise<ContactProperty> {\n    return this.call<ContactProperty>(\"GET\", options, ({ signal, headers }) =>\n      getContactProperty({ client: this.client, path: { property_id: propertyId }, headers, signal }));\n  }\n\n  /**\n   * Define a custom contact property (key + value type) that becomes available in contact data and as a broadcast template variable. The key and type cannot change after creation; a workspace holds at most 200 properties, archived included.\n   *\n   * @example Define a custom property\n   * const prop = await bird.contactProperties.create({ key: \"plan\", type: \"string\" });\n   * console.log(prop.id); // \"cp_…\"\n   */\n  create(params: ContactPropertyCreateParams, options?: RequestOptions): APIPromise<ContactProperty> {\n    return this.call<ContactProperty>(\"POST\", options, ({ signal, headers }) =>\n      createContactProperty({ client: this.client, body: params, headers, signal }));\n  }\n\n  /**\n   * Update a contact property's fallback value. Only the fallback value can change; the key and type are fixed at creation, so a different key or type needs a new property.\n   *\n   * @example Change a property's fallback value\n   * await bird.contactProperties.update(\"cp_01krdgeqcxet5s7t44vh8rt9mg\", { fallback_value: \"free\" });\n   */\n  update(propertyId: string, params: ContactPropertyUpdateParams = {}, options?: RequestOptions): APIPromise<ContactProperty> {\n    return this.call<ContactProperty>(\"PATCH\", options, ({ signal, headers }) =>\n      updateContactProperty({ client: this.client, path: { property_id: propertyId }, body: params, headers, signal }));\n  }\n\n  /**\n   * Archive a contact property: the key is rejected in new contact writes and stops rendering in templates, while stored values remain readable. The key stays reserved and counts toward the 200-property limit; reverse with `contact_properties.unarchive`.\n   *\n   * @example Archive a property, retiring the field without deleting its data\n   * const prop = await bird.contactProperties.archive(\"cp_01krdgeqcxet5s7t44vh8rt9mg\");\n   * console.log(prop.key, prop.archived);\n   */\n  archive(propertyId: string, options?: RequestOptions): APIPromise<ContactProperty> {\n    return this.call<ContactProperty>(\"POST\", options, ({ signal, headers }) =>\n      archiveContactProperty({ client: this.client, path: { property_id: propertyId }, headers, signal }));\n  }\n\n  /**\n   * Reactivate an archived contact property so its key is accepted in contact writes and renders in templates again. Fails with a conflict if the property is not archived.\n   *\n   * @example Restore an archived property\n   * await bird.contactProperties.unarchive(\"cp_01krdgeqcxet5s7t44vh8rt9mg\");\n   */\n  unarchive(propertyId: string, options?: RequestOptions): APIPromise<ContactProperty> {\n    return this.call<ContactProperty>(\"POST\", options, ({ signal, headers }) =>\n      unarchiveContactProperty({ client: this.client, path: { property_id: propertyId }, headers, signal }));\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { createContact, createContactBatch, deleteContact, getContact, listContacts, updateContact } from \"../generated/sdk.gen.js\";\nimport type { Contact, ContactUpsertResult, CreateContactBatchData, CreateContactData, DeleteContactData, GetContactData, ListContactsData, UpdateContactData } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, PaginatedPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { Contact };\nexport type { ContactUpsertResult };\nexport type ContactListQuery = NonNullable<ListContactsData[\"query\"]>;\nexport type ContactCreateParams = NonNullable<CreateContactData[\"body\"]>;\nexport type ContactUpdateParams = NonNullable<UpdateContactData[\"body\"]>;\nexport type ContactBatchParams = NonNullable<CreateContactBatchData[\"body\"]>;\n\nexport class ContactsResource extends Resource {\n  /**\n   * List the workspace's contacts as a cursor page, newest first. Look one up by exact email, phone_number, or external_id, repeating phone_number to resolve up to 50 numbers in one call (raise limit to match), or search by email, name, or phone substring. Pass include_total for a total count.\n   *\n   * @example Iterate every contact, or take one page\n   * for await (const contact of bird.contacts.list({ q: \"acme.com\" })) {\n   *   console.log(contact.id, contact.email);\n   * }\n   * const page = await bird.contacts.list({ limit: 50 }); // page.data, page.next_cursor\n   */\n  list(query?: ContactListQuery, options?: RequestOptions): PaginatedPromise<Contact> {\n    return this.paginated<Contact>(\"GET\", options, ({ signal, headers }, cursor) =>\n      listContacts({ client: this.client, query: { ...query, starting_after: cursor ?? query?.starting_after }, headers, signal }));\n  }\n\n  /**\n   * Get a single contact by ID. Look up an ID by exact email, phone_number, or external_id with `contacts.list`.\n   *\n   * @example Fetch a contact by id\n   * const contact = await bird.contacts.get(\"con_01krdgeqcxet5s7t44vh8rt9mg\");\n   * console.log(contact.email, contact.first_name);\n   */\n  get(contactId: string, options?: RequestOptions): APIPromise<Contact> {\n    return this.call<Contact>(\"GET\", options, ({ signal, headers }) =>\n      getContact({ client: this.client, path: { contact_id: contactId }, headers, signal }));\n  }\n\n  /**\n   * Create a contact identified by an email address, an E.164 phone number, or both. Fails with a conflict if the email, phone_number, or external_id is already used by another contact. For bulk import or create-or-update semantics use `contacts.batch`.\n   *\n   * @example Create a contact\n   * const contact = await bird.contacts.create({\n   *   email: \"jane@acme.com\",\n   *   first_name: \"Jane\",\n   * });\n   * console.log(contact.id); // \"con_…\"\n   */\n  create(params: ContactCreateParams = {}, options?: RequestOptions): APIPromise<Contact> {\n    return this.call<Contact>(\"POST\", options, ({ signal, headers }) =>\n      createContact({ client: this.client, body: params, headers, signal }));\n  }\n\n  /**\n   * Update a contact's name, `external_id`, email, `phone_number`, or custom data. Only supplied fields change; custom data keys are merged, with `null` removing a key. A contact keeps at least one identifier: clearing both email and `phone_number` is rejected.\n   *\n   * @example Change a contact's fields\n   * const contact = await bird.contacts.update(\"con_01krdgeqcxet5s7t44vh8rt9mg\", {\n   *   first_name: \"Jane\",\n   * });\n   * console.log(contact.first_name);\n   */\n  update(contactId: string, params: ContactUpdateParams = {}, options?: RequestOptions): APIPromise<Contact> {\n    return this.call<Contact>(\"PATCH\", options, ({ signal, headers }) =>\n      updateContact({ client: this.client, path: { contact_id: contactId }, body: params, headers, signal }));\n  }\n\n  /**\n   * Delete a contact and remove it from every audience it belongs to. Suppression records for the address are unaffected.\n   *\n   * @example Delete a contact by id\n   * await bird.contacts.delete(\"con_01krdgeqcxet5s7t44vh8rt9mg\");\n   */\n  delete(contactId: string, options?: RequestOptions): APIPromise<void> {\n    return this.call<void>(\"DELETE\", options, ({ signal, headers }) =>\n      deleteContact({ client: this.client, path: { contact_id: contactId }, headers, signal }));\n  }\n\n  /**\n   * Create or update up to 1,000 contacts in one request. Match each entry against every supplied identifier (`email`, `phone_number`, and `external_id`), or set `match_on` to use one identifier. Optionally add all successful contacts to up to 10 audiences. Results follow submission order.\n   *\n   * @example Create or update many contacts at once, matched by the identifiers each entry carries\n   * const result = await bird.contacts.batch({\n   *   contacts: [{ email: \"jane@acme.com\", first_name: \"Jane\" }],\n   * });\n   * for (const item of result.data) {\n   *   console.log(item.entry.email, item.status);\n   * }\n   */\n  batch(params: ContactBatchParams, options?: RequestOptions): APIPromise<ContactUpsertResult> {\n    return this.call<ContactUpsertResult>(\"POST\", options, ({ signal, headers }) =>\n      createContactBatch({ client: this.client, body: params, headers, signal }));\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { getSmsMessage, listSmsMessageEvents, listSmsMessages } from \"../generated/sdk.gen.js\";\nimport type { GetSmsMessageData, ListSmsMessageEventsData, ListSmsMessagesData, SmsEventList, SmsMessage } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, PaginatedPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { SmsMessage };\nexport type { SmsEventList };\nexport type SmsListQuery = NonNullable<ListSmsMessagesData[\"query\"]>;\nexport type SmsListEventsQuery = NonNullable<ListSmsMessageEventsData[\"query\"]>;\n\nexport class SmsResourceBase extends Resource {\n  /**\n   * Get one SMS message by ID: its current delivery status, segment breakdown, cost, and failure detail if it failed.\n   *\n   * @example Read a message back\n   * const msg = await bird.sms.get(\"sms_abc123\");\n   * msg.status; // \"accepted\" | \"delivered\" | …\n   */\n  get(messageId: string, options?: RequestOptions): APIPromise<SmsMessage> {\n    return this.call<SmsMessage>(\"GET\", options, ({ signal, headers }) =>\n      getSmsMessage({ client: this.client, path: { message_id: messageId }, headers, signal }));\n  }\n\n  /**\n   * List SMS messages, newest first, as a cursor page (`data`, `next_cursor`). Pass `next_cursor` back as `starting_after` to fetch the next page. Filter by direction, status, category, recipient, sender, or tag.\n   *\n   * @example Iterate outbound messages\n   * for await (const msg of bird.sms.list({ direction: \"outbound\" })) {\n   *   console.log(msg.id, msg.status);\n   * }\n   */\n  list(query?: SmsListQuery, options?: RequestOptions): PaginatedPromise<SmsMessage> {\n    return this.paginated<SmsMessage>(\"GET\", options, ({ signal, headers }, cursor) =>\n      listSmsMessages({ client: this.client, query: { ...query, starting_after: cursor ?? query?.starting_after }, headers, signal }));\n  }\n\n  /**\n   * The lifecycle event timeline for one SMS, oldest first: what happened to it and when. Filter with `type` (for example `sms.delivered`) to keep one kind of event. Use `sms.get` for the message's current state and `sms.list` to find its ID.\n   *\n   * @example Read one message's lifecycle timeline\n   * const events = await bird.sms.listEvents(\"sms_abc123\");\n   * for (const event of events.data ?? []) {\n   *   console.log(event.type, event.occurred_at);\n   * }\n   */\n  listEvents(messageId: string, query?: SmsListEventsQuery, options?: RequestOptions): APIPromise<SmsEventList> {\n    return this.call<SmsEventList>(\"GET\", options, ({ signal, headers }) =>\n      listSmsMessageEvents({ client: this.client, path: { message_id: messageId }, query, headers, signal }));\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { getSmsStatsByCarrier, getSmsStatsByCategory, getSmsStatsByCountry, getSmsStatsByErrorCode, getSmsStatsByOriginator, getSmsStatsByStatus, getSmsStatsByTag, getSmsStatsDaily, getSmsStatsHourly, getSmsStatsSummary } from \"../generated/sdk.gen.js\";\nimport type { GetSmsStatsByCarrierData, GetSmsStatsByCategoryData, GetSmsStatsByCountryData, GetSmsStatsByErrorCodeData, GetSmsStatsByOriginatorData, GetSmsStatsByStatusData, GetSmsStatsByTagData, GetSmsStatsDailyData, GetSmsStatsHourlyData, GetSmsStatsSummaryData, SmsStatsByCarrierResponse, SmsStatsByCategoryResponse, SmsStatsByCountryResponse, SmsStatsByErrorCodeResponse, SmsStatsByOriginatorResponse, SmsStatsByStatusResponse, SmsStatsByTagResponse, SmsStatsResponse, SmsStatsSummary } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { SmsStatsSummary };\nexport type { SmsStatsResponse };\nexport type { SmsStatsByCountryResponse };\nexport type { SmsStatsByCarrierResponse };\nexport type { SmsStatsByCategoryResponse };\nexport type { SmsStatsByOriginatorResponse };\nexport type { SmsStatsByStatusResponse };\nexport type { SmsStatsByErrorCodeResponse };\nexport type { SmsStatsByTagResponse };\nexport type SmsStatsSummaryQuery = NonNullable<GetSmsStatsSummaryData[\"query\"]>;\nexport type SmsStatsDailyQuery = NonNullable<GetSmsStatsDailyData[\"query\"]>;\nexport type SmsStatsHourlyQuery = NonNullable<GetSmsStatsHourlyData[\"query\"]>;\nexport type SmsStatsByCountryQuery = NonNullable<GetSmsStatsByCountryData[\"query\"]>;\nexport type SmsStatsByCarrierQuery = NonNullable<GetSmsStatsByCarrierData[\"query\"]>;\nexport type SmsStatsByCategoryQuery = NonNullable<GetSmsStatsByCategoryData[\"query\"]>;\nexport type SmsStatsByOriginatorQuery = NonNullable<GetSmsStatsByOriginatorData[\"query\"]>;\nexport type SmsStatsByStatusQuery = NonNullable<GetSmsStatsByStatusData[\"query\"]>;\nexport type SmsStatsByErrorCodeQuery = NonNullable<GetSmsStatsByErrorCodeData[\"query\"]>;\nexport type SmsStatsByTagQuery = NonNullable<GetSmsStatsByTagData[\"query\"]>;\n\nexport class SmsStatsResourceBase extends Resource {\n  /**\n   * Aggregate SMS KPIs for one period: accepted, sent, delivered, undelivered, failed, rejected and expired counts, the derived delivery and failure rates, and latency percentiles. The `from` and `to` values are both YYYY-MM-DD days or both RFC 3339 instants (hour grain). Add `compare=previous_period` for deltas against the preceding window. For a per-day or per-hour series use `sms.stats.daily` or `sms.stats.hourly`.\n   *\n   * @example Aggregate KPIs for a window\n   * const summary = await bird.sms.stats.summary({\n   *   from: \"2026-05-01\", // both calendar days for a day window, or\n   *   to: \"2026-05-31\", //   both RFC 3339 instants for an hour window\n   * });\n   * console.log(summary.delivery, summary.latency);\n   */\n  summary(query?: SmsStatsSummaryQuery, options?: RequestOptions): APIPromise<SmsStatsSummary> {\n    return this.call<SmsStatsSummary>(\"GET\", options, ({ signal, headers }) =>\n      getSmsStatsSummary({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * One row of SMS lifecycle counts per calendar day, for charts and trend lines. The window is at most 365 days; set `timezone` to get local calendar days instead of UTC. Rates and latency percentiles are whole-window figures, so read those from `sms.stats.summary`.\n   *\n   * @example One row per calendar day\n   * const stats = await bird.sms.stats.daily({ from: \"2026-05-01\", to: \"2026-05-31\" });\n   * for (const point of stats.data ?? []) {\n   *   console.log(point.bucket, point.delivery);\n   * }\n   */\n  daily(query?: SmsStatsDailyQuery, options?: RequestOptions): APIPromise<SmsStatsResponse> {\n    return this.call<SmsStatsResponse>(\"GET\", options, ({ signal, headers }) =>\n      getSmsStatsDaily({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * One row of SMS lifecycle counts per hour, for inspecting send rate and deliverability inside a single day. The window is at most 30 days (720 rows) and both bounds round down to the hour. For longer ranges use `sms.stats.daily`.\n   *\n   * @example One row per hour, up to 30 days\n   * const stats = await bird.sms.stats.hourly({\n   *   from: \"2026-05-30T00:00:00Z\",\n   *   to: \"2026-05-31T00:00:00Z\",\n   * });\n   * for (const point of stats.data ?? []) {\n   *   console.log(point.bucket, point.delivery);\n   * }\n   */\n  hourly(query?: SmsStatsHourlyQuery, options?: RequestOptions): APIPromise<SmsStatsResponse> {\n    return this.call<SmsStatsResponse>(\"GET\", options, ({ signal, headers }) =>\n      getSmsStatsHourly({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * SMS delivery and latency stats grouped by destination country, ranked by the `sort` metric (default `accepted`) and capped by `limit` (default 50, maximum 200). Use it to find where delivery is worst before drilling into `sms.stats.by_error_code`.\n   *\n   * @example Find where delivery is worst\n   * const stats = await bird.sms.stats.byCountry({\n   *   from: \"2026-05-01\",\n   *   to: \"2026-05-31\",\n   *   sort: \"delivery_rate\",\n   * });\n   * for (const row of stats.data ?? []) {\n   *   console.log(row.country, row.delivery);\n   * }\n   */\n  byCountry(query?: SmsStatsByCountryQuery, options?: RequestOptions): APIPromise<SmsStatsByCountryResponse> {\n    return this.call<SmsStatsByCountryResponse>(\"GET\", options, ({ signal, headers }) =>\n      getSmsStatsByCountry({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * SMS delivery and latency stats grouped by the carrier that handled the message, ranked by the `sort` metric (default `accepted`) and capped by `limit` (default 50, maximum 200). Use it to compare delivery performance across carriers.\n   *\n   * @example Compare delivery across carriers\n   * const stats = await bird.sms.stats.byCarrier({ from: \"2026-05-01\", to: \"2026-05-31\" });\n   * for (const row of stats.data ?? []) {\n   *   console.log(row.carrier, row.delivery);\n   * }\n   */\n  byCarrier(query?: SmsStatsByCarrierQuery, options?: RequestOptions): APIPromise<SmsStatsByCarrierResponse> {\n    return this.call<SmsStatsByCarrierResponse>(\"GET\", options, ({ signal, headers }) =>\n      getSmsStatsByCarrier({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * SMS delivery and latency stats grouped by the category you sent under, ranked by the `sort` metric (default `accepted`) and capped by `limit` (default 50, maximum 200).\n   *\n   * @example Split a window by category\n   * const stats = await bird.sms.stats.byCategory({ from: \"2026-05-01\", to: \"2026-05-31\" });\n   * for (const row of stats.data ?? []) {\n   *   console.log(row.category, row.delivery);\n   * }\n   */\n  byCategory(query?: SmsStatsByCategoryQuery, options?: RequestOptions): APIPromise<SmsStatsByCategoryResponse> {\n    return this.call<SmsStatsByCategoryResponse>(\"GET\", options, ({ signal, headers }) =>\n      getSmsStatsByCategory({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * SMS delivery and latency stats grouped by originator, the sender address messages went out from, ranked by the `sort` metric (default `accepted`) and capped by `limit` (default 50, maximum 200). Use it to compare how your senders perform.\n   *\n   * @example Compare how each sender performs\n   * const stats = await bird.sms.stats.byOriginator({ from: \"2026-05-01\", to: \"2026-05-31\" });\n   * for (const row of stats.data ?? []) {\n   *   console.log(row.originator, row.delivery);\n   * }\n   */\n  byOriginator(query?: SmsStatsByOriginatorQuery, options?: RequestOptions): APIPromise<SmsStatsByOriginatorResponse> {\n    return this.call<SmsStatsByOriginatorResponse>(\"GET\", options, ({ signal, headers }) =>\n      getSmsStatsByOriginator({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * How many messages ended the period in each lifecycle status: accepted, sent, delivered, undelivered, failed, rejected, expired, ordered by count. The \"where did my messages end up\" view, suitable for a status-distribution chart.\n   *\n   * @example Where the window's messages ended up\n   * const stats = await bird.sms.stats.byStatus({ from: \"2026-05-01\", to: \"2026-05-31\" });\n   * for (const row of stats.data ?? []) {\n   *   console.log(row.status, row.count);\n   * }\n   */\n  byStatus(query?: SmsStatsByStatusQuery, options?: RequestOptions): APIPromise<SmsStatsByStatusResponse> {\n    return this.call<SmsStatsByStatusResponse>(\"GET\", options, ({ signal, headers }) =>\n      getSmsStatsByStatus({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * SMS stats grouped by our normalized failure reason, which answers which reasons are driving your failures. The grouping key is the same value as the `error_code` filter on `sms.list`, so a row joins straight to the messages behind it. Ranked by the `sort` metric (default `failed`) and capped by `limit`.\n   *\n   * @example Which reasons drive failures\n   * const stats = await bird.sms.stats.byErrorCode({ from: \"2026-05-01\", to: \"2026-05-31\" });\n   * for (const row of stats.data ?? []) {\n   *   // The same value as the error_code filter on bird.sms.list.\n   *   console.log(row.error_code, row.delivery);\n   * }\n   */\n  byErrorCode(query?: SmsStatsByErrorCodeQuery, options?: RequestOptions): APIPromise<SmsStatsByErrorCodeResponse> {\n    return this.call<SmsStatsByErrorCodeResponse>(\"GET\", options, ({ signal, headers }) =>\n      getSmsStatsByErrorCode({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * SMS delivery and latency stats grouped by tag (`name:value`), ranked by the `sort` metric (default `accepted`) and capped by `limit` (default 50, maximum 200). Only tagged messages appear, and one carrying several tags counts once under each, so rows do not sum to the period total.\n   *\n   * @example Compare campaigns and segments\n   * const stats = await bird.sms.stats.byTag({ from: \"2026-05-01\", to: \"2026-05-31\" });\n   * for (const row of stats.data ?? []) {\n   *   // A message carrying several tags counts once under each, so rows do not sum\n   *   // to the period total.\n   *   console.log(row.tag, row.delivery);\n   * }\n   */\n  byTag(query?: SmsStatsByTagQuery, options?: RequestOptions): APIPromise<SmsStatsByTagResponse> {\n    return this.call<SmsStatsByTagResponse>(\"GET\", options, ({ signal, headers }) =>\n      getSmsStatsByTag({ client: this.client, query, headers, signal }));\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { getSmsInboundStatsByCountry, getSmsInboundStatsByNumber, getSmsInboundStatsByOperator, getSmsInboundStatsDaily, getSmsInboundStatsHourly, getSmsInboundStatsSummary } from \"../generated/sdk.gen.js\";\nimport type { GetSmsInboundStatsByCountryData, GetSmsInboundStatsByNumberData, GetSmsInboundStatsByOperatorData, GetSmsInboundStatsDailyData, GetSmsInboundStatsHourlyData, GetSmsInboundStatsSummaryData, SmsInboundStatsByCountryResponse, SmsInboundStatsByNumberResponse, SmsInboundStatsByOperatorResponse, SmsInboundStatsResponse, SmsInboundStatsSummaryResponse } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { SmsInboundStatsSummaryResponse };\nexport type { SmsInboundStatsResponse };\nexport type { SmsInboundStatsByCountryResponse };\nexport type { SmsInboundStatsByOperatorResponse };\nexport type { SmsInboundStatsByNumberResponse };\nexport type SmsStatsInboundSummaryQuery = NonNullable<GetSmsInboundStatsSummaryData[\"query\"]>;\nexport type SmsStatsInboundDailyQuery = NonNullable<GetSmsInboundStatsDailyData[\"query\"]>;\nexport type SmsStatsInboundHourlyQuery = NonNullable<GetSmsInboundStatsHourlyData[\"query\"]>;\nexport type SmsStatsInboundByCountryQuery = NonNullable<GetSmsInboundStatsByCountryData[\"query\"]>;\nexport type SmsStatsInboundByOperatorQuery = NonNullable<GetSmsInboundStatsByOperatorData[\"query\"]>;\nexport type SmsStatsInboundByNumberQuery = NonNullable<GetSmsInboundStatsByNumberData[\"query\"]>;\n\nexport class SmsStatsInboundResource extends Resource {\n  /**\n   * Total messages your numbers received over a period. For a breakdown use `sms.stats.inbound.by_country`, `sms.stats.inbound.by_operator`, or `sms.stats.inbound.by_number`.\n   *\n   * @example Total messages received\n   * const summary = await bird.sms.stats.inbound.summary({ from: \"2026-05-01\", to: \"2026-05-31\" });\n   * console.log(summary.received);\n   */\n  summary(query?: SmsStatsInboundSummaryQuery, options?: RequestOptions): APIPromise<SmsInboundStatsSummaryResponse> {\n    return this.call<SmsInboundStatsSummaryResponse>(\"GET\", options, ({ signal, headers }) =>\n      getSmsInboundStatsSummary({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Messages your numbers received, one row per calendar day. Set `timezone` to get local calendar days instead of UTC.\n   *\n   * @example Received messages per day\n   * const stats = await bird.sms.stats.inbound.daily({ from: \"2026-05-01\", to: \"2026-05-31\" });\n   * for (const point of stats.data ?? []) {\n   *   console.log(point.bucket, point.received);\n   * }\n   */\n  daily(query?: SmsStatsInboundDailyQuery, options?: RequestOptions): APIPromise<SmsInboundStatsResponse> {\n    return this.call<SmsInboundStatsResponse>(\"GET\", options, ({ signal, headers }) =>\n      getSmsInboundStatsDaily({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Messages your numbers received, one row per hour, for inspecting inbound volume inside a single day.\n   *\n   * @example Received messages per hour\n   * const stats = await bird.sms.stats.inbound.hourly({\n   *   from: \"2026-05-30T00:00:00Z\",\n   *   to: \"2026-05-31T00:00:00Z\",\n   * });\n   * for (const point of stats.data ?? []) {\n   *   console.log(point.bucket, point.received);\n   * }\n   */\n  hourly(query?: SmsStatsInboundHourlyQuery, options?: RequestOptions): APIPromise<SmsInboundStatsResponse> {\n    return this.call<SmsInboundStatsResponse>(\"GET\", options, ({ signal, headers }) =>\n      getSmsInboundStatsHourly({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Messages your numbers received, grouped by the country of the receiving number.\n   *\n   * @example Where senders messaged from\n   * const stats = await bird.sms.stats.inbound.byCountry({ from: \"2026-05-01\", to: \"2026-05-31\" });\n   * for (const row of stats.data ?? []) {\n   *   console.log(row.country, row.received);\n   * }\n   */\n  byCountry(query?: SmsStatsInboundByCountryQuery, options?: RequestOptions): APIPromise<SmsInboundStatsByCountryResponse> {\n    return this.call<SmsInboundStatsByCountryResponse>(\"GET\", options, ({ signal, headers }) =>\n      getSmsInboundStatsByCountry({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Messages your numbers received, grouped by the sender's mobile operator. Messages whose operator the carrier did not report are excluded, so these rows can sum to less than `sms.stats.inbound.summary` for the same period.\n   *\n   * @example Received messages per operator\n   * const stats = await bird.sms.stats.inbound.byOperator({ from: \"2026-05-01\", to: \"2026-05-31\" });\n   * for (const row of stats.data ?? []) {\n   *   // Messages whose operator the carrier did not report are excluded, so these\n   *   // rows can sum to less than the inbound summary for the same period.\n   *   console.log(row.mcc_mnc, row.received);\n   * }\n   */\n  byOperator(query?: SmsStatsInboundByOperatorQuery, options?: RequestOptions): APIPromise<SmsInboundStatsByOperatorResponse> {\n    return this.call<SmsInboundStatsByOperatorResponse>(\"GET\", options, ({ signal, headers }) =>\n      getSmsInboundStatsByOperator({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * How many messages each of your numbers received, which is the view that shows whether a campaign's reply traffic is landing on the number you expect.\n   *\n   * @example Which number took the traffic\n   * const stats = await bird.sms.stats.inbound.byNumber({ from: \"2026-05-01\", to: \"2026-05-31\" });\n   * for (const row of stats.data ?? []) {\n   *   console.log(row.number, row.received);\n   * }\n   */\n  byNumber(query?: SmsStatsInboundByNumberQuery, options?: RequestOptions): APIPromise<SmsInboundStatsByNumberResponse> {\n    return this.call<SmsInboundStatsByNumberResponse>(\"GET\", options, ({ signal, headers }) =>\n      getSmsInboundStatsByNumber({ client: this.client, query, headers, signal }));\n  }\n}\n","// `bird.sms.stats` — aggregate statistics over the workspace's own SMS traffic.\n\nimport { Resource } from \"./base.js\";\nimport { SmsStatsResourceBase } from \"./smsStats.gen.js\";\nimport { SmsStatsInboundResource } from \"./smsStatsInbound.gen.js\";\n\nexport class SmsStatsResource extends SmsStatsResourceBase {\n  /** Received-message statistics — `bird.sms.stats.inbound.summary(...)`, `.byNumber(...)`, … */\n  readonly inbound: SmsStatsInboundResource;\n\n  constructor(\n    core: ConstructorParameters<typeof Resource>[0],\n    client: ConstructorParameters<typeof Resource>[1],\n  ) {\n    super(core, client);\n    this.inbound = new SmsStatsInboundResource(core, client);\n  }\n}\n","// Use the `bird.sms` channel to send SMS messages and read their status.\n\nimport {\n  createSmsMessage,\n  createSmsMessageBatch,\n} from \"../generated/sdk.gen.js\";\nimport type {\n  SmsMessage,\n  SmsMessageBatchRequest,\n  SmsMessageBatchResponse,\n  SmsMessageSendRequest,\n} from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport { SmsResourceBase } from \"./sms.gen.js\";\nimport { SmsStatsResource } from \"./smsStats.js\";\nimport type { APIPromise, RequestOptions } from \"../core/result.js\";\n\n/**\n * Body for `bird.sms.send`. Supply either `text` (with `category` and `from`)\n * or `template`.\n */\nexport type SmsSendParams = SmsMessageSendRequest;\n/** Body for `bird.sms.sendBatch`. Contains up to 100 sends. */\nexport type SmsSendBatchParams = SmsMessageBatchRequest;\n/** Result of `bird.sms.sendBatch`. */\nexport type SmsSendBatchResult = SmsMessageBatchResponse;\n/** Filters and cursor params for `bird.sms.list`. */\n\nexport class SmsResource extends SmsResourceBase {\n  /** SMS statistics: `bird.sms.stats.summary(...)`, `.daily(...)`, `.inbound.byNumber(...)`, … */\n  readonly stats: SmsStatsResource;\n\n  constructor(\n    core: ConstructorParameters<typeof Resource>[0],\n    client: ConstructorParameters<typeof Resource>[1],\n  ) {\n    super(core, client);\n    this.stats = new SmsStatsResource(core, client);\n  }\n\n  /**\n   * Send one SMS to a single recipient. Supply either `text` (with a `category` and `from`)\n   * or a stored `template` (by `id` or `slug`, with its `parameters`). The API\n   * accepts the message for delivery. Read it back with `get` for the latest status.\n   *\n   * @example Send free text\n   * const msg = await bird.sms.send({\n   *   from: \"+15557654321\",\n   *   to: \"+14155550100\",\n   *   text: \"Your verification code is 123456.\",\n   *   category: \"authentication\",\n   * });\n   * console.log(msg.id, msg.status);\n   *\n   * @example Send by template\n   * await bird.sms.send({\n   *   to: \"+14155550100\",\n   *   template: { slug: \"bird_otp_verification\", parameters: { code: \"123456\" } },\n   * });\n   */\n  send(\n    params: SmsSendParams,\n    options?: RequestOptions,\n  ): APIPromise<SmsMessage> {\n    return this.call<SmsMessage>(\"POST\", options, ({ signal, headers }) =>\n      createSmsMessage({ client: this.client, body: params, headers, signal }),\n    );\n  }\n\n  /**\n   * Send up to 100 independent SMS messages in one call. Each item is a full send\n   * (free text or template); all items are validated before any are queued.\n   *\n   * @example\n   * const result = await bird.sms.sendBatch([\n   *   {\n   *     from: \"+15557654321\",\n   *     to: \"+15551111111\",\n   *     text: \"Hi Alice!\",\n   *     category: \"marketing\",\n   *   },\n   *   {\n   *     from: \"+15557654321\",\n   *     to: \"+15552222222\",\n   *     text: \"Hi Bob!\",\n   *     category: \"marketing\",\n   *   },\n   * ]);\n   */\n  sendBatch(\n    params: SmsSendBatchParams,\n    options?: RequestOptions,\n  ): APIPromise<SmsSendBatchResult> {\n    return this.call<SmsSendBatchResult>(\n      \"POST\",\n      options,\n      ({ signal, headers }) =>\n        createSmsMessageBatch({\n          client: this.client,\n          body: params,\n          headers,\n          signal,\n        }),\n    );\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { createSmsKeywordRule, deleteSmsKeywordRule, getSmsKeywordRule, listSmsKeywordRules, updateSmsKeywordRule } from \"../generated/sdk.gen.js\";\nimport type { CreateSmsKeywordRuleData, DeleteSmsKeywordRuleData, GetSmsKeywordRuleData, ListSmsKeywordRulesData, SmsKeywordRule, SmsKeywordRuleList, UpdateSmsKeywordRuleData } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { SmsKeywordRuleList };\nexport type { SmsKeywordRule };\nexport type SmsKeywordRulesListQuery = NonNullable<ListSmsKeywordRulesData[\"query\"]>;\nexport type SmsKeywordRulesCreateParams = NonNullable<CreateSmsKeywordRuleData[\"body\"]>;\nexport type SmsKeywordRulesUpdateParams = NonNullable<UpdateSmsKeywordRuleData[\"body\"]>;\n\nexport class SmsKeywordRulesResource extends Resource {\n  /**\n   * List the default and workspace keyword rules that apply to inbound messages, most specific first. Filter by `country`, `number`, `operation`, or `scope`. Pass `number` to see one number's rules in evaluation order. Default coverage varies by country.\n   */\n  list(query?: SmsKeywordRulesListQuery, options?: RequestOptions): APIPromise<SmsKeywordRuleList> {\n    return this.call<SmsKeywordRuleList>(\"GET\", options, ({ signal, headers }) =>\n      listSmsKeywordRules({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Read one default or workspace keyword rule. Its ID prefix identifies which kind: a workspace rule can be changed with `sms_keyword_rules.update`, a Bird default cannot.\n   */\n  get(id: string, options?: RequestOptions): APIPromise<SmsKeywordRule> {\n    return this.call<SmsKeywordRule>(\"GET\", options, ({ signal, headers }) =>\n      getSmsKeywordRule({ client: this.client, path: { id: id }, headers, signal }));\n  }\n\n  /**\n   * Replace the default opt-out, opt-in, or help reply for one country, or add a `custom` keyword. A workspace rule takes precedence over the default for that country. Opt-out and opt-in keywords cannot be assigned to another operation.\n   */\n  create(params: SmsKeywordRulesCreateParams, options?: RequestOptions): APIPromise<SmsKeywordRule> {\n    return this.call<SmsKeywordRule>(\"POST\", options, ({ signal, headers }) =>\n      createSmsKeywordRule({ client: this.client, body: params, headers, signal }));\n  }\n\n  /**\n   * Change one of your own keyword rules: its reply, its extra keywords, or its self-managed attestation. Bird's default rules cannot be updated; create your own for that country instead with `sms_keyword_rules.create`. Omitting `keywords` leaves the set alone, while sending an empty list clears your additions back to Bird's.\n   */\n  update(id: string, params: SmsKeywordRulesUpdateParams = {}, options?: RequestOptions): APIPromise<SmsKeywordRule> {\n    return this.call<SmsKeywordRule>(\"PATCH\", options, ({ signal, headers }) =>\n      updateSmsKeywordRule({ client: this.client, path: { id: id }, body: params, headers, signal }));\n  }\n\n  /**\n   * Delete one of your own keyword rules, which restores Bird's default for that country and operation. Bird's own rules cannot be deleted.\n   */\n  delete(id: string, options?: RequestOptions): APIPromise<void> {\n    return this.call<void>(\"DELETE\", options, ({ signal, headers }) =>\n      deleteSmsKeywordRule({ client: this.client, path: { id: id }, headers, signal }));\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { createSmsSuppression, deleteSmsSuppression, getSmsSuppression, listSmsSuppressions } from \"../generated/sdk.gen.js\";\nimport type { CreateSmsSuppressionData, DeleteSmsSuppressionData, GetSmsSuppressionData, ListSmsSuppressionsData, SmsSuppression } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, PaginatedPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { SmsSuppression };\nexport type SmsSuppressionsListQuery = NonNullable<ListSmsSuppressionsData[\"query\"]>;\nexport type SmsSuppressionsAddParams = NonNullable<CreateSmsSuppressionData[\"body\"]>;\n\nexport class SmsSuppressionsResource extends Resource {\n  /**\n   * List the workspace's SMS suppressions (sender-and-subscriber pairs blocked from delivery) as a cursor page.\n   */\n  list(query?: SmsSuppressionsListQuery, options?: RequestOptions): PaginatedPromise<SmsSuppression> {\n    return this.paginated<SmsSuppression>(\"GET\", options, ({ signal, headers }, cursor) =>\n      listSmsSuppressions({ client: this.client, query: { ...query, starting_after: cursor ?? query?.starting_after }, headers, signal }));\n  }\n\n  /**\n   * Read one SMS suppression: the sender and subscriber it covers, why messages are stopped, what it blocks, and whether it is still in force. To check whether you may message someone, filter `sms_suppressions.list` by their number instead.\n   */\n  get(suppressionId: string, options?: RequestOptions): APIPromise<SmsSuppression> {\n    return this.call<SmsSuppression>(\"GET\", options, ({ signal, headers }) =>\n      getSmsSuppression({ client: this.client, path: { suppression_id: suppressionId }, headers, signal }));\n  }\n\n  /**\n   * Stop one of your senders from messaging one subscriber. Covers that sender only; your other senders keep reaching them.\n   */\n  add(params: SmsSuppressionsAddParams, options?: RequestOptions): APIPromise<SmsSuppression> {\n    return this.call<SmsSuppression>(\"POST\", options, ({ signal, headers }) =>\n      createSmsSuppression({ client: this.client, body: params, headers, signal }));\n  }\n\n  /**\n   * End a manual SMS suppression, letting that sender message that subscriber again. Only reason `manual` can be ended this way: a subscriber's own stop keyword and a carrier's opt-out are refused.\n   */\n  remove(suppressionId: string, options?: RequestOptions): APIPromise<void> {\n    return this.call<void>(\"DELETE\", options, ({ signal, headers }) =>\n      deleteSmsSuppression({ client: this.client, path: { suppression_id: suppressionId }, headers, signal }));\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { getSmsTemplate, listSmsTemplates } from \"../generated/sdk.gen.js\";\nimport type { GetSmsTemplateData, ListSmsTemplatesData, SmsTemplate, SmsTemplateList } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { SmsTemplateList };\nexport type { SmsTemplate };\nexport type SmsTemplateListQuery = NonNullable<ListSmsTemplatesData[\"query\"]>;\n\nexport class SmsTemplatesResource extends Resource {\n  /**\n   * List the SMS templates available to your workspace, including our built-in templates. Filter by scope, category, or language. The catalog is small and returned in full; this list is not paginated. Use `sms_templates.get` to read one template's variables before sending with it.\n   *\n   * @example List the built-in templates\n   * const { data } = await bird.smsTemplates.list({ scope: \"system\" });\n   * for (const tpl of data) console.log(tpl.id, tpl.slug);\n   */\n  list(query?: SmsTemplateListQuery, options?: RequestOptions): APIPromise<SmsTemplateList> {\n    return this.call<SmsTemplateList>(\"GET\", options, ({ signal, headers }) =>\n      listSmsTemplates({ client: this.client, query, headers, signal }));\n  }\n\n  /**\n   * Get one SMS template by its slug or ID, including its body and the variables it expects. Fetch it before `sms.send` to see which parameter keys a template send requires.\n   *\n   * @example Read one template by slug or id\n   * const tpl = await bird.smsTemplates.get(\"bird_otp_verification\");\n   * console.log(tpl.body, tpl.variables);\n   */\n  get(templateRef: string, options?: RequestOptions): APIPromise<SmsTemplate> {\n    return this.call<SmsTemplate>(\"GET\", options, ({ signal, headers }) =>\n      getSmsTemplate({ client: this.client, path: { template_ref: templateRef }, headers, signal }));\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { getWhatsAppMessage, listWhatsAppMessageEvents, listWhatsAppMessages } from \"../generated/sdk.gen.js\";\nimport type { GetWhatsAppMessageData, ListWhatsAppMessageEventsData, ListWhatsAppMessagesData, WhatsAppEventList, WhatsAppMessage } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, PaginatedPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { WhatsAppMessage };\nexport type { WhatsAppEventList };\nexport type WhatsappListQuery = NonNullable<ListWhatsAppMessagesData[\"query\"]>;\nexport type WhatsappListEventsQuery = NonNullable<ListWhatsAppMessageEventsData[\"query\"]>;\n\nexport class WhatsappResourceBase extends Resource {\n  /**\n   * Get one WhatsApp message by id: current delivery status, sent/delivered/read timestamps, the one content it was built from (a template, or free-form text, image, video, audio, sticker, document or location), and failure detail if it failed. For the per-event timeline use whatsapp_list_events.\n   *\n   * @example Read a message back\n   * const msg = await bird.whatsapp.get(\"wa_abc123\");\n   * msg.status; // \"accepted\" | \"delivered\" | …\n   */\n  get(messageId: string, options?: RequestOptions): APIPromise<WhatsAppMessage> {\n    return this.call<WhatsAppMessage>(\"GET\", options, ({ signal, headers }) =>\n      getWhatsAppMessage({ client: this.client, path: { message_id: messageId }, headers, signal }));\n  }\n\n  /**\n   * List WhatsApp messages, newest first, as a cursor page ({data, next_cursor, …}). Each message carries the one content it was built from: a template, or free-form text, image, video, audio, sticker, document or location. Pass next_cursor back as starting_after to fetch the next page. Filter by direction, status, contact phone number, bsuid, template category, or tag. Use whatsapp_get for one message's current state.\n   *\n   * @example Iterate delivered messages\n   * for await (const msg of bird.whatsapp.list({ status: [\"delivered\"] })) {\n   *   console.log(msg.id, msg.status);\n   * }\n   */\n  list(query?: WhatsappListQuery, options?: RequestOptions): PaginatedPromise<WhatsAppMessage> {\n    return this.paginated<WhatsAppMessage>(\"GET\", options, ({ signal, headers }, cursor) =>\n      listWhatsAppMessages({ client: this.client, query: { ...query, starting_after: cursor ?? query?.starting_after }, headers, signal }));\n  }\n\n  /**\n   * Get one WhatsApp message's delivery timeline, oldest first: whatsapp.accepted, whatsapp.sent, whatsapp.delivered, whatsapp.read, and whatsapp.failed events, with failure detail on failed events. Not paginated; an unknown message ID returns `404`. Use `whatsapp.get` for the condensed current status.\n   *\n   * @example Read one message's delivery timeline\n   * const { data } = await bird.whatsapp.listEvents(\"wa_abc123\");\n   * for (const event of data) console.log(event.type, event.occurred_at);\n   */\n  listEvents(messageId: string, query?: WhatsappListEventsQuery, options?: RequestOptions): APIPromise<WhatsAppEventList> {\n    return this.call<WhatsAppEventList>(\"GET\", options, ({ signal, headers }) =>\n      listWhatsAppMessageEvents({ client: this.client, path: { message_id: messageId }, query, headers, signal }));\n  }\n}\n","// `bird.whatsapp` — the WhatsApp channel: send WhatsApp messages and read their\n// status and events.\n\nimport { createWhatsAppMessage } from \"../generated/sdk.gen.js\";\nimport type {\n  WhatsAppMessageSendRequest,\n  WhatsAppMessage,\n} from \"../generated/types.gen.js\";\nimport { WhatsappResourceBase } from \"./whatsapp.gen.js\";\nimport type { APIPromise, RequestOptions } from \"../core/result.js\";\n\n/** Body for `bird.whatsapp.send` — a template send, or one free-form content arm. */\nexport type WhatsappSendParams = WhatsAppMessageSendRequest;\n\nexport class WhatsappResource extends WhatsappResourceBase {\n  /**\n   * Send one message, carrying exactly one kind of content: a template, or\n   * free-form `text`, `image`, `video`, `audio`, `sticker`, `document` or\n   * `location`. Every send but a Bird-managed template needs `from`, a number\n   * this workspace owns. The result is `accepted`, not yet delivered — read it\n   * back with `get` to confirm.\n   *\n   * @example\n   * const msg = await bird.whatsapp.send({\n   *   to: \"+15551234567\",\n   *   template: {\n   *     slug: \"bird_otp\",\n   *     components: [{ type: \"body\", parameters: [{ type: \"text\", text: \"123456\" }] }],\n   *   },\n   * });\n   * console.log(msg.id, msg.status);\n   */\n  send(\n    params: WhatsappSendParams,\n    options?: RequestOptions,\n  ): APIPromise<WhatsAppMessage> {\n    return this.call<WhatsAppMessage>(\"POST\", options, ({ signal, headers }) =>\n      createWhatsAppMessage({\n        client: this.client,\n        body: params,\n        headers,\n        signal,\n      }),\n    );\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { getVoiceCall, listVoiceCalls } from \"../generated/sdk.gen.js\";\nimport type { GetVoiceCallData, ListVoiceCallsData, VoiceCall } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, PaginatedPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { VoiceCall };\nexport type VoiceListQuery = NonNullable<ListVoiceCallsData[\"query\"]>;\n\nexport class VoiceResource extends Resource {\n  /**\n   * List the workspace's calls, newest first. Filter to `ringing`/`in_progress` for the calls in progress right now, to final statuses for completed records, or to any mix of the two. Use `from`/`to` for one known party number in international form, and `number` to search either side by fragment. These are per-call records and do not include aggregate rates or totals. Use `voice.get` to follow one call to settlement.\n   *\n   * @example Iterate the calls happening right now\n   * for await (const call of bird.voice.list({ status: [\"ringing\", \"in_progress\"] })) {\n   *   console.log(call.id, call.status);\n   * }\n   */\n  list(query?: VoiceListQuery, options?: RequestOptions): PaginatedPromise<VoiceCall> {\n    return this.paginated<VoiceCall>(\"GET\", options, ({ signal, headers }, cursor) =>\n      listVoiceCalls({ client: this.client, query: { ...query, starting_after: cursor ?? query?.starting_after }, headers, signal }));\n  }\n\n  /**\n   * Fetch one call by ID, at any point in its lifecycle. A call still ringing or connected carries no economics yet: `duration_ms`, `billable_ms`, `ended_at`, and `cost` are null until it ends, and the same ID then returns the settled record. Poll here to watch one known call; use `voice.list` to find calls in the first place. When a call was refused, `rejection_reason` names the gate that turned it away.\n   *\n   * @example Read one call back\n   * const call = await bird.voice.get(\"vcl_01k0p3v9wera3v6q6xw3e9y2mh\");\n   * // A call still ringing or connected carries no economics yet.\n   * call.status; // \"answered\" | \"no_answer\" | \"ringing\" | …\n   */\n  get(callId: string, options?: RequestOptions): APIPromise<VoiceCall> {\n    return this.call<VoiceCall>(\"GET\", options, ({ signal, headers }) =>\n      getVoiceCall({ client: this.client, path: { call_id: callId }, headers, signal }));\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { createVerification, createVerificationCheck, createVerificationNextChannel } from \"../generated/sdk.gen.js\";\nimport type { CreateVerificationCheckData, CreateVerificationData, CreateVerificationNextChannelData, Verification, VerificationCheckResult } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { Verification };\nexport type { VerificationCheckResult };\nexport type VerifyVerificationsCreateParams = NonNullable<CreateVerificationData[\"body\"]>;\nexport type VerifyVerificationsCheckParams = NonNullable<CreateVerificationCheckData[\"body\"]>;\nexport type VerifyVerificationsNextChannelParams = NonNullable<CreateVerificationNextChannelData[\"body\"]>;\n\nexport class VerifyVerificationsResource extends Resource {\n  /**\n   * Start a verification and send a one-time passcode to the email address, phone number, or both in `to`. Delivery uses one planned channel at a time and fails over when necessary. Calling again for the same recipient reuses the verification in progress and sends after the resend cooldown. The passcode is never returned; submit the recipient's code with `verify.verifications.check`. SMS, WhatsApp, and Telegram delivery draw on the workspace's balance.\n   *\n   * @example Start a verification over SMS\n   * const verification = await bird.verify.verifications.create({\n   *   to: { phone_number: \"+15551234567\" },\n   * });\n   * console.log(verification.id, verification.status);\n   */\n  create(params: VerifyVerificationsCreateParams, options?: RequestOptions): APIPromise<Verification> {\n    return this.call<Verification>(\"POST\", options, ({ signal, headers }) =>\n      createVerification({ client: this.client, body: params, headers, signal }));\n  }\n\n  /**\n   * Check a passcode a recipient submitted. Identify the verification by the same `to` recipient used to start it; no verification ID is needed. A wrong or expired code returns HTTP 200 with `success: false` and a `reason` (for example `incorrect_code` or `expired`). A verification that has already reached a final state is no longer checkable and returns 404, as does a missing verification; malformed input or rate limiting is also an error status.\n   *\n   * @example Check a submitted passcode\n   * const result = await bird.verify.verifications.check({\n   *   to: { phone_number: \"+15551234567\" },\n   *   code: \"123456\",\n   * });\n   * console.log(result.success);\n   */\n  check(params: VerifyVerificationsCheckParams, options?: RequestOptions): APIPromise<VerificationCheckResult> {\n    return this.call<VerificationCheckResult>(\"POST\", options, ({ signal, headers }) =>\n      createVerificationCheck({ client: this.client, body: params, headers, signal }));\n  }\n\n  /**\n   * Advance an in-progress verification to its next channel and send a fresh passcode. Identify it with the same `to` recipient used to create it; no verification ID is required. This bypasses the resend cooldown, and earlier passcodes remain valid. `last_channel` identifies the most recent completed send. `422 NoNextChannel` means the plan is exhausted; create the verification again to resend on the current channel.\n   *\n   * @example Send the code again on the next channel\n   * const verification = await bird.verify.verifications.nextChannel({\n   *   to: { phone_number: \"+15551234567\" },\n   * });\n   * console.log(verification.last_channel);\n   */\n  nextChannel(params: VerifyVerificationsNextChannelParams, options?: RequestOptions): APIPromise<Verification> {\n    return this.call<Verification>(\"POST\", options, ({ signal, headers }) =>\n      createVerificationNextChannel({ client: this.client, body: params, headers, signal }));\n  }\n}\n","// `bird.verify` — the Verify product. `bird.verify.verifications.create(...)` starts\n// a verification (sends a one-time passcode); `.check(...)` checks the passcode a\n// recipient submits.\n\nimport { Resource } from \"./base.js\";\nimport { VerifyVerificationsResource } from \"./verifyVerifications.gen.js\";\n\n/** The Verify product namespace — holds the `verifications` collection. */\nexport class VerifyResource {\n  readonly verifications: VerifyVerificationsResource;\n  constructor(...args: ConstructorParameters<typeof Resource>) {\n    this.verifications = new VerifyVerificationsResource(...args);\n  }\n}\n","// `bird.webhooks` — verifies a delivered payload's Standard Webhooks signature\n// and returns it as a typed, discriminated event union. Pure crypto: it never\n// touches the transport layer, so it carries no client/core dependency.\n\nimport { Webhook } from \"standardwebhooks\";\nimport type { WebhookEvent } from \"../generated/types.gen.js\";\nimport { BirdWebhookVerificationError } from \"../errors.js\";\n\n/** A verified webhook event, discriminated on `type`. */\nexport type BirdWebhookEvent = WebhookEvent;\n\n/** Inbound request headers, as a `Headers` object or a plain record. */\nexport type WebhookHeaders = Headers | Record<string, string>;\n\n/** Client-level webhooks config (`new BirdClient({ webhooks: { secret } })`). */\nexport interface WebhookOptions {\n  /** Signing secret used by `unwrap`; a per-call `secret` overrides it. */\n  secret?: string;\n}\n\nexport class WebhooksResource {\n  readonly #secret?: string;\n\n  constructor(config?: WebhookOptions) {\n    this.#secret = config?.secret;\n  }\n\n  /**\n   * Verify a webhook delivery and return the typed event.\n   *\n   * **Pass the raw request body**, exactly as received — do NOT parse it first.\n   * The Standard Webhooks signature is computed over the raw bytes, so parsing\n   * and re-serializing before verifying is the classic webhook bug.\n   *\n   * The secret comes from `webhooks.secret` on the client; pass `{ secret }` to\n   * override per call. Throws {@link BirdWebhookVerificationError} on a bad\n   * signature, a stale timestamp, or missing/malformed headers. Unknown event\n   * types are returned as-is (handle them in a `default` case) so a newer server\n   * event can't break an older SDK.\n   *\n   * @example One call verifies the signature and returns the typed event\n   * // Pass the RAW request body; set the secret via new BirdClient({ webhooks: { secret } }).\n   * const event = bird.webhooks.unwrap(rawBody, headers);\n   * console.log(event.type); // discriminated union: narrow on event.type\n   *\n   * @example Verify and dispatch: pass the raw request body, never the parsed JSON\n   * // new BirdClient({ apiKey, webhooks: { secret } })\n   * try {\n   *   const event = bird.webhooks.unwrap(rawBody, req.headers);\n   *   switch (event.type) {\n   *     case \"email.delivered\":\n   *       markDelivered(event.data.email_id, event.data.recipient); // narrowed by event.type\n   *       break;\n   *     case \"email.bounced\":\n   *     case \"email.complained\":\n   *       suppress(event.data.recipient);\n   *       break;\n   *     default: // unknown future event types — an older SDK won't break on a new one\n   *   }\n   * } catch (err) {\n   *   if (err instanceof BirdWebhookVerificationError) {\n   *     // reject with 400 — bad signature, stale timestamp, or missing/malformed headers\n   *   } else throw err;\n   * }\n   */\n  unwrap(\n    payload: string,\n    headers: WebhookHeaders,\n    options?: WebhookOptions,\n  ): BirdWebhookEvent {\n    const secret = options?.secret ?? this.#secret;\n    if (!secret) {\n      throw new Error(\n        \"No webhook secret. Set `webhooks: { secret }` on the client, or pass `{ secret }` to unwrap.\",\n      );\n    }\n    const wh = new Webhook(secret);\n    let verified: unknown;\n    try {\n      verified = wh.verify(payload, toHeaderRecord(headers));\n    } catch (err) {\n      throw new BirdWebhookVerificationError(\n        err instanceof Error\n          ? err.message\n          : \"Webhook signature verification failed\",\n      );\n    }\n    // `verify` returns `unknown`; the payload is authenticated and the wire\n    // schema is `additionalProperties: false`, so the assertion is sound here.\n    return verified as BirdWebhookEvent;\n  }\n}\n\nfunction toHeaderRecord(headers: WebhookHeaders): Record<string, string> {\n  return headers instanceof Headers ? Object.fromEntries(headers) : headers;\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { publishRealtimeAppBatch, publishRealtimeAppEvent } from \"../generated/sdk.gen.js\";\nimport type { PublishRealtimeAppBatchData, PublishRealtimeAppEventData, RealtimeBatchPublishResult, RealtimePublishResult } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { RealtimePublishResult };\nexport type { RealtimeBatchPublishResult };\nexport type RealtimePublishParams = NonNullable<PublishRealtimeAppEventData[\"body\"]>;\nexport type RealtimePublishBatchParams = NonNullable<PublishRealtimeAppBatchData[\"body\"]>;\n\nexport class RealtimeResourceBase extends Resource {\n  /**\n   * @example Broadcast an event to a channel\n   * const result = await bird.realtime.publish(\"rap_01krdgeqcxet5s7t44vh8rt9mg\", {\n   *   event: \"order.updated\",\n   *   channels: [\"orders\", \"presence-lobby\"],\n   *   data: { order_id: \"ord_123\", status: \"shipped\" },\n   * });\n   * console.log(result.data?.length); // one entry per channel\n   */\n  publish(realtimeAppId: string, params: RealtimePublishParams, options?: RequestOptions): APIPromise<RealtimePublishResult> {\n    return this.call<RealtimePublishResult>(\"POST\", options, ({ signal, headers }) =>\n      publishRealtimeAppEvent({ client: this.client, path: { realtime_app_id: realtimeAppId }, body: params, headers, signal }), [\"RealtimeKey\", \"RealtimeSecret\"]);\n  }\n\n  /**\n   * @example Publish two events in one call\n   * await bird.realtime.publishBatch(\"rap_01krdgeqcxet5s7t44vh8rt9mg\", {\n   *   events: [\n   *     { event: \"order.created\", channel: \"orders\", data: { id: 1 } },\n   *     { event: \"order.updated\", channel: \"orders\", data: { id: 2 } },\n   *   ],\n   * });\n   */\n  publishBatch(realtimeAppId: string, params: RealtimePublishBatchParams, options?: RequestOptions): APIPromise<RealtimeBatchPublishResult> {\n    return this.call<RealtimeBatchPublishResult>(\"POST\", options, ({ signal, headers }) =>\n      publishRealtimeAppBatch({ client: this.client, path: { realtime_app_id: realtimeAppId }, body: params, headers, signal }), [\"RealtimeKey\", \"RealtimeSecret\"]);\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { getRealtimeAppChannel, listRealtimeAppChannelMembers, listRealtimeAppChannels } from \"../generated/sdk.gen.js\";\nimport type { GetRealtimeAppChannelData, ListRealtimeAppChannelMembersData, ListRealtimeAppChannelsData, RealtimeChannelInfo, RealtimeChannelMembers, RealtimeChannelsList } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { RealtimeChannelsList };\nexport type { RealtimeChannelInfo };\nexport type { RealtimeChannelMembers };\nexport type RealtimeChannelListQuery = NonNullable<ListRealtimeAppChannelsData[\"query\"]>;\nexport type RealtimeChannelGetQuery = NonNullable<GetRealtimeAppChannelData[\"query\"]>;\n\nexport class RealtimeChannelsResource extends Resource {\n  /**\n   * @example List the occupied presence channels with their member counts\n   * const { data } = await bird.realtime.channels.list(\"rap_01krdgeqcxet5s7t44vh8rt9mg\", {\n   *   prefix: \"presence-\",\n   *   include: [\"member_count\"],\n   * });\n   * for (const channel of data) console.log(channel.name, channel.member_count);\n   */\n  list(realtimeAppId: string, query?: RealtimeChannelListQuery, options?: RequestOptions): APIPromise<RealtimeChannelsList> {\n    return this.call<RealtimeChannelsList>(\"GET\", options, ({ signal, headers }) =>\n      listRealtimeAppChannels({ client: this.client, path: { realtime_app_id: realtimeAppId }, query, headers, signal }), [\"RealtimeKey\", \"RealtimeSecret\"]);\n  }\n\n  /**\n   * @example Check whether anyone is in a channel\n   * const channel = await bird.realtime.channels.get(\"rap_01krdgeqcxet5s7t44vh8rt9mg\", \"presence-lobby\", {\n   *   include: [\"member_count\"],\n   * });\n   * console.log(channel.occupied, channel.member_count);\n   */\n  get(realtimeAppId: string, channelName: string, query?: RealtimeChannelGetQuery, options?: RequestOptions): APIPromise<RealtimeChannelInfo> {\n    return this.call<RealtimeChannelInfo>(\"GET\", options, ({ signal, headers }) =>\n      getRealtimeAppChannel({ client: this.client, path: { realtime_app_id: realtimeAppId, channel_name: channelName }, query, headers, signal }), [\"RealtimeKey\", \"RealtimeSecret\"]);\n  }\n\n  /**\n   * @example Who is in the lobby\n   * const { members } = await bird.realtime.channels.members(\"rap_01krdgeqcxet5s7t44vh8rt9mg\", \"presence-lobby\");\n   * for (const member of members) console.log(member.member_id);\n   */\n  members(realtimeAppId: string, channelName: string, options?: RequestOptions): APIPromise<RealtimeChannelMembers> {\n    return this.call<RealtimeChannelMembers>(\"GET\", options, ({ signal, headers }) =>\n      listRealtimeAppChannelMembers({ client: this.client, path: { realtime_app_id: realtimeAppId, channel_name: channelName }, headers, signal }), [\"RealtimeKey\", \"RealtimeSecret\"]);\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { disconnectRealtimeAppMember, sendRealtimeAppMemberEvent } from \"../generated/sdk.gen.js\";\nimport type { DisconnectRealtimeAppMemberData, SendRealtimeAppMemberEventData } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, RequestOptions } from \"../core/result.js\";\n\nexport type RealtimeMemberSendParams = NonNullable<SendRealtimeAppMemberEventData[\"body\"]>;\n\nexport class RealtimeMembersResource extends Resource {\n  /**\n   * @example Notify one person wherever they are signed in\n   * await bird.realtime.members.send(\"rap_01krdgeqcxet5s7t44vh8rt9mg\", \"user_42\", {\n   *   event: \"order-shipped\",\n   *   data: { order_id: \"ord_123\" },\n   * });\n   */\n  send(realtimeAppId: string, memberId: string, params: RealtimeMemberSendParams, options?: RequestOptions): APIPromise<void> {\n    return this.call<void>(\"POST\", options, ({ signal, headers }) =>\n      sendRealtimeAppMemberEvent({ client: this.client, path: { realtime_app_id: realtimeAppId, member_id: memberId }, body: params, headers, signal }), [\"RealtimeKey\", \"RealtimeSecret\"]);\n  }\n\n  /**\n   * @example Kick a member off every connection\n   * await bird.realtime.members.disconnect(\"rap_01krdgeqcxet5s7t44vh8rt9mg\", \"user_42\");\n   */\n  disconnect(realtimeAppId: string, memberId: string, options?: RequestOptions): APIPromise<void> {\n    return this.call<void>(\"POST\", options, ({ signal, headers }) =>\n      disconnectRealtimeAppMember({ client: this.client, path: { realtime_app_id: realtimeAppId, member_id: memberId }, headers, signal }), [\"RealtimeKey\", \"RealtimeSecret\"]);\n  }\n}\n","// Code generated by beak gen:realtime-encryption from clients/typescript/realtime/src/secretbox.ts. DO NOT EDIT.\n\n// XSalsa20-Poly1305 secretbox (the NaCl construction), implemented from the\n// specification. It exists because encrypted channels fix this exact cipher on\n// the wire and WebCrypto does not provide it. Poly1305 uses BigInt: the\n// payload cap is 10 KB (640 blocks), so auditability wins over a limb\n// implementation's speed. Like every JS crypto, this is not constant-time in a\n// way the runtime can guarantee; the tag check at least avoids early exit.\n//\n// This file is the canonical implementation; the server SDK's copy is\n// generated from it (beak gen:realtime-encryption-vectors) so the two cannot\n// drift.\n\n// \"expand 32-byte k\"\nconst SIGMA = new Uint8Array([\n  101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107,\n]);\n\nfunction rotl(x: number, c: number): number {\n  return (x << c) | (x >>> (32 - c));\n}\n\nfunction load32(b: Uint8Array, i: number): number {\n  return (\n    (b[i]! | (b[i + 1]! << 8) | (b[i + 2]! << 16) | (b[i + 3]! << 24)) >>> 0\n  );\n}\n\nfunction store32(b: Uint8Array, i: number, v: number): void {\n  b[i] = v & 0xff;\n  b[i + 1] = (v >>> 8) & 0xff;\n  b[i + 2] = (v >>> 16) & 0xff;\n  b[i + 3] = (v >>> 24) & 0xff;\n}\n\n/**\n * The Salsa20 core over the 4x4 state built from `key` and a 16-byte `input`.\n * With `feedForward` this is the Salsa20 block function (stream generation);\n * without it, the state words at the diagonal and input positions form the\n * HSalsa20 output used for XSalsa20's subkey derivation.\n */\nfunction salsa20Core(\n  key: Uint8Array,\n  input: Uint8Array,\n  feedForward: boolean,\n): Uint8Array {\n  const j = new Int32Array(16);\n  j[0] = load32(SIGMA, 0);\n  j[1] = load32(key, 0);\n  j[2] = load32(key, 4);\n  j[3] = load32(key, 8);\n  j[4] = load32(key, 12);\n  j[5] = load32(SIGMA, 4);\n  j[6] = load32(input, 0);\n  j[7] = load32(input, 4);\n  j[8] = load32(input, 8);\n  j[9] = load32(input, 12);\n  j[10] = load32(SIGMA, 8);\n  j[11] = load32(key, 16);\n  j[12] = load32(key, 20);\n  j[13] = load32(key, 24);\n  j[14] = load32(key, 28);\n  j[15] = load32(SIGMA, 12);\n\n  let x0 = j[0]!, x1 = j[1]!, x2 = j[2]!, x3 = j[3]!;\n  let x4 = j[4]!, x5 = j[5]!, x6 = j[6]!, x7 = j[7]!;\n  let x8 = j[8]!, x9 = j[9]!, x10 = j[10]!, x11 = j[11]!;\n  let x12 = j[12]!, x13 = j[13]!, x14 = j[14]!, x15 = j[15]!;\n  for (let round = 0; round < 20; round += 2) {\n    x4 ^= rotl((x0 + x12) | 0, 7);\n    x8 ^= rotl((x4 + x0) | 0, 9);\n    x12 ^= rotl((x8 + x4) | 0, 13);\n    x0 ^= rotl((x12 + x8) | 0, 18);\n    x9 ^= rotl((x5 + x1) | 0, 7);\n    x13 ^= rotl((x9 + x5) | 0, 9);\n    x1 ^= rotl((x13 + x9) | 0, 13);\n    x5 ^= rotl((x1 + x13) | 0, 18);\n    x14 ^= rotl((x10 + x6) | 0, 7);\n    x2 ^= rotl((x14 + x10) | 0, 9);\n    x6 ^= rotl((x2 + x14) | 0, 13);\n    x10 ^= rotl((x6 + x2) | 0, 18);\n    x3 ^= rotl((x15 + x11) | 0, 7);\n    x7 ^= rotl((x3 + x15) | 0, 9);\n    x11 ^= rotl((x7 + x3) | 0, 13);\n    x15 ^= rotl((x11 + x7) | 0, 18);\n    x1 ^= rotl((x0 + x3) | 0, 7);\n    x2 ^= rotl((x1 + x0) | 0, 9);\n    x3 ^= rotl((x2 + x1) | 0, 13);\n    x0 ^= rotl((x3 + x2) | 0, 18);\n    x6 ^= rotl((x5 + x4) | 0, 7);\n    x7 ^= rotl((x6 + x5) | 0, 9);\n    x4 ^= rotl((x7 + x6) | 0, 13);\n    x5 ^= rotl((x4 + x7) | 0, 18);\n    x11 ^= rotl((x10 + x9) | 0, 7);\n    x8 ^= rotl((x11 + x10) | 0, 9);\n    x9 ^= rotl((x8 + x11) | 0, 13);\n    x10 ^= rotl((x9 + x8) | 0, 18);\n    x12 ^= rotl((x15 + x14) | 0, 7);\n    x13 ^= rotl((x12 + x15) | 0, 9);\n    x14 ^= rotl((x13 + x12) | 0, 13);\n    x15 ^= rotl((x14 + x13) | 0, 18);\n  }\n\n  const x = [x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15];\n  const out = new Uint8Array(feedForward ? 64 : 32);\n  if (feedForward) {\n    for (let i = 0; i < 16; i++) store32(out, 4 * i, (x[i]! + j[i]!) | 0);\n    return out;\n  }\n  const picks = [0, 5, 10, 15, 6, 7, 8, 9];\n  for (let i = 0; i < 8; i++) store32(out, 4 * i, x[picks[i]!]!);\n  return out;\n}\n\n/**\n * The XSalsa20 keystream for a 24-byte nonce: an HSalsa20 subkey from the\n * nonce's first 16 bytes, then Salsa20 blocks over the remaining 8 bytes plus\n * a little-endian 64-bit block counter.\n */\nfunction xsalsa20Stream(\n  length: number,\n  nonce: Uint8Array,\n  key: Uint8Array,\n): Uint8Array {\n  const subkey = salsa20Core(key, nonce.subarray(0, 16), false);\n  const input = new Uint8Array(16);\n  input.set(nonce.subarray(16, 24));\n  const stream = new Uint8Array(length);\n  for (let block = 0; block * 64 < length; block++) {\n    // The counter fits a float well past any 10 KB payload; bytes 12-15 stay 0.\n    store32(input, 8, block);\n    const chunk = salsa20Core(subkey, input, true);\n    stream.set(chunk.subarray(0, Math.min(64, length - block * 64)), block * 64);\n  }\n  return stream;\n}\n\nconst P1305 = (1n << 130n) - 5n;\nconst CLAMP = 0x0ffffffc0ffffffc0ffffffc0fffffffn;\nconst MASK128 = (1n << 128n) - 1n;\n\nfunction leToBigInt(b: Uint8Array): bigint {\n  let v = 0n;\n  for (let i = b.length - 1; i >= 0; i--) v = (v << 8n) | BigInt(b[i]!);\n  return v;\n}\n\nfunction poly1305(msg: Uint8Array, key: Uint8Array): Uint8Array {\n  const r = leToBigInt(key.subarray(0, 16)) & CLAMP;\n  const s = leToBigInt(key.subarray(16, 32));\n  let acc = 0n;\n  for (let i = 0; i < msg.length; i += 16) {\n    const block = msg.subarray(i, Math.min(i + 16, msg.length));\n    acc = ((acc + leToBigInt(block) + (1n << BigInt(8 * block.length))) * r) % P1305;\n  }\n  acc = (acc + s) & MASK128;\n  const tag = new Uint8Array(16);\n  for (let i = 0; i < 16; i++) {\n    tag[i] = Number(acc & 0xffn);\n    acc >>= 8n;\n  }\n  return tag;\n}\n\nfunction tagsEqual(a: Uint8Array, b: Uint8Array): boolean {\n  let d = 0;\n  for (let i = 0; i < 16; i++) d |= a[i]! ^ b[i]!;\n  return d === 0;\n}\n\n/**\n * Seal `plaintext` under a 24-byte `nonce` and 32-byte `key`, returning the\n * 16-byte Poly1305 tag followed by the ciphertext (the NaCl box layout).\n */\nexport function seal(\n  plaintext: Uint8Array,\n  nonce: Uint8Array,\n  key: Uint8Array,\n): Uint8Array {\n  const stream = xsalsa20Stream(32 + plaintext.length, nonce, key);\n  const out = new Uint8Array(16 + plaintext.length);\n  for (let i = 0; i < plaintext.length; i++) {\n    out[16 + i] = plaintext[i]! ^ stream[32 + i]!;\n  }\n  out.set(poly1305(out.subarray(16), stream.subarray(0, 32)));\n  return out;\n}\n\n/**\n * Open a sealed box (tag || ciphertext). Returns the plaintext, or null when\n * the tag does not authenticate under this key and nonce — a wrong or rotated\n * key and a tampered message are indistinguishable by design.\n */\nexport function open(\n  box: Uint8Array,\n  nonce: Uint8Array,\n  key: Uint8Array,\n): Uint8Array | null {\n  if (box.length < 16 || nonce.length !== 24 || key.length !== 32) return null;\n  const ciphertext = box.subarray(16);\n  const stream = xsalsa20Stream(32 + ciphertext.length, nonce, key);\n  if (!tagsEqual(poly1305(ciphertext, stream.subarray(0, 32)), box.subarray(0, 16))) {\n    return null;\n  }\n  const out = new Uint8Array(ciphertext.length);\n  for (let i = 0; i < ciphertext.length; i++) {\n    out[i] = ciphertext[i]! ^ stream[32 + i]!;\n  }\n  return out;\n}\n","// Crypto for Realtime end-to-end encrypted channels (`private-encrypted-…`).\n// The wire contract: a channel's key is SHA-256(channel_name || master_key),\n// carried to clients as base64 `shared_secret` in the channel-auth response;\n// an event's payload is an XSalsa20-Poly1305 box over the JSON-serialized\n// data, published as `{nonce, ciphertext}` (both base64). The master key is\n// the customer's alone — it is never sent to Bird.\n//\n// Hashing and HMAC use WebCrypto (edge-safe); the box cipher is not in\n// WebCrypto, so it comes from the generated copy of the realtime client's\n// implementation.\n\nimport { BirdError } from \"../errors.js\";\nimport { seal } from \"./secretbox.gen.js\";\n\nexport const ENCRYPTED_CHANNEL_PREFIX = \"private-encrypted-\";\n\nexport function isEncryptedChannel(name: string): boolean {\n  return name.startsWith(ENCRYPTED_CHANNEL_PREFIX);\n}\n\n/** The `{nonce, ciphertext}` envelope published as an encrypted event's data. */\nexport interface EncryptedEnvelope {\n  nonce: string;\n  ciphertext: string;\n}\n\n/**\n * Decode and validate the configured master key: 32 bytes, base64. Validated\n * here so a bad key fails with a message naming the config, not a cipher\n * internals error at publish time.\n */\nexport function decodeMasterKey(masterKey: string | undefined): Uint8Array {\n  if (!masterKey) {\n    throw new BirdError(\n      \"Publishing to a private-encrypted- channel requires the encryption \" +\n        \"master key. Set `realtime: { encryptionMasterKey }` on the client — \" +\n        \"generate one as 32 random bytes, base64-encoded.\",\n    );\n  }\n  let decoded: Uint8Array | null = null;\n  try {\n    decoded = Uint8Array.from(atob(masterKey), (c) => c.charCodeAt(0));\n  } catch {\n    decoded = null;\n  }\n  if (!decoded || decoded.length !== 32) {\n    throw new BirdError(\n      \"realtime.encryptionMasterKey must be 32 bytes, base64-encoded.\",\n    );\n  }\n  return decoded;\n}\n\n/** SHA-256(channel_name || master_key) — the channel's secretbox key. */\nexport async function deriveSharedSecret(\n  channelName: string,\n  masterKey: Uint8Array,\n): Promise<Uint8Array> {\n  const channel = new TextEncoder().encode(channelName);\n  const input = new Uint8Array(channel.length + masterKey.length);\n  input.set(channel);\n  input.set(masterKey, channel.length);\n  return new Uint8Array(await crypto.subtle.digest(\"SHA-256\", input));\n}\n\n/** Encrypt an event payload for one encrypted channel. */\nexport async function encryptForChannel(\n  channelName: string,\n  data: unknown,\n  masterKey: Uint8Array,\n): Promise<EncryptedEnvelope> {\n  const key = await deriveSharedSecret(channelName, masterKey);\n  const nonce = crypto.getRandomValues(new Uint8Array(24));\n  const plaintext = new TextEncoder().encode(JSON.stringify(data ?? null));\n  const box = seal(plaintext, nonce, key);\n  return { nonce: toBase64(nonce), ciphertext: toBase64(box) };\n}\n\n/** `hex(HMAC-SHA256(secret, payload))` — the channel-auth signature. */\nexport async function hmacSha256Hex(\n  secret: string,\n  payload: string,\n): Promise<string> {\n  const key = await crypto.subtle.importKey(\n    \"raw\",\n    new TextEncoder().encode(secret),\n    { name: \"HMAC\", hash: \"SHA-256\" },\n    false,\n    [\"sign\"],\n  );\n  const sig = new Uint8Array(\n    await crypto.subtle.sign(\"HMAC\", key, new TextEncoder().encode(payload)),\n  );\n  return Array.from(sig, (b) => b.toString(16).padStart(2, \"0\")).join(\"\");\n}\n\nexport function toBase64(bytes: Uint8Array): string {\n  let raw = \"\";\n  for (const b of bytes) raw += String.fromCharCode(b);\n  return btoa(raw);\n}\n","// `bird.realtime` — publish to Realtime channels, plus the `channels` and\n// `members` collections nested under it.\n//\n// Every Realtime operation authenticates to the Realtime edge with the app's own\n// key/secret pair on top of the workspace API key. Those are credentials, so pass\n// them as client config (`realtime: { key, secret }`); the request core stamps\n// them on the operations that declare them.\n\nimport type {\n  RealtimeChannelInclude,\n  RealtimeChannelListItem,\n  RealtimeChannelMember,\n} from \"../generated/types.gen.js\";\nimport {\n  publishRealtimeAppBatch,\n  publishRealtimeAppEvent,\n} from \"../generated/sdk.gen.js\";\nimport {\n  RealtimeResourceBase,\n  type RealtimePublishParams,\n  type RealtimePublishBatchParams,\n  type RealtimePublishResult,\n  type RealtimeBatchPublishResult,\n} from \"./realtime.gen.js\";\nimport { RealtimeChannelsResource } from \"./realtimeChannels.gen.js\";\nimport { RealtimeMembersResource } from \"./realtimeMembers.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, RequestOptions } from \"../core/result.js\";\nimport {\n  decodeMasterKey,\n  deriveSharedSecret,\n  encryptForChannel,\n  hmacSha256Hex,\n  isEncryptedChannel,\n  toBase64,\n} from \"../core/realtime-crypto.js\";\nimport { BirdError } from \"../errors.js\";\n\nexport type {\n  RealtimePublishBatchParams,\n  RealtimeBatchPublishResult,\n} from \"./realtime.gen.js\";\n\n// The rest of the Realtime surface, re-exported here so `bird.realtime`'s public\n// types have one import site regardless of which file generates them.\nexport type { RealtimeChannelInclude, RealtimeChannelListItem, RealtimeChannelMember };\nexport type {\n  RealtimePublishParams,\n  RealtimePublishResult,\n} from \"./realtime.gen.js\";\nexport type {\n  RealtimeChannelsList,\n  RealtimeChannelInfo,\n  RealtimeChannelMembers,\n  RealtimeChannelListQuery,\n  RealtimeChannelGetQuery,\n} from \"./realtimeChannels.gen.js\";\nexport type { RealtimeMemberSendParams } from \"./realtimeMembers.gen.js\";\n\n/**\n * Realtime app credentials — `new BirdClient({ realtime: { key, secret } })`.\n * They come from the app's credentials (shown once at creation) and must belong\n * to the calling workspace.\n */\nexport interface RealtimeOptions {\n  /** The Realtime app key, sent as `X-Realtime-Key`. */\n  key?: string;\n  /** The Realtime app secret, sent as `X-Realtime-Secret`. */\n  secret?: string;\n  /**\n   * The end-to-end encryption master key for `private-encrypted-` channels:\n   * 32 random bytes, base64-encoded. Yours alone — it is used locally to\n   * encrypt publishes and derive each channel's `shared_secret`, and is never\n   * sent to Bird. Losing it makes rotating to a new one the only recovery.\n   */\n  encryptionMasterKey?: string;\n}\n\n/**\n * What `authorizeChannel` returns: the JSON your auth endpoint sends back to\n * the browser client, field names already on the wire spelling.\n */\nexport interface ChannelAuthorization {\n  /** `<key>:<hmac>` signature the edge verifies. */\n  auth: string;\n  /** Echo of the signed member data (presence channels). */\n  member_data?: string;\n  /** The channel's decryption key, base64 (encrypted channels). */\n  shared_secret?: string;\n}\n\n/**\n * `bird.realtime` — publish events to a Realtime app's channels and inspect its\n * live state. Reached as `bird.realtime.*`.\n */\nexport class RealtimeResource extends RealtimeResourceBase {\n  /** Channel state — `bird.realtime.channels.list(...)`, `.get(...)`, `.members(...)`. */\n  readonly channels: RealtimeChannelsResource;\n\n  /** Members — `bird.realtime.members.send(...)`, `.disconnect(...)`. */\n  readonly members: RealtimeMembersResource;\n\n  readonly #options?: RealtimeOptions;\n\n  constructor(\n    core: ConstructorParameters<typeof Resource>[0],\n    client: ConstructorParameters<typeof Resource>[1],\n    options?: RealtimeOptions,\n  ) {\n    super(core, client);\n    this.channels = new RealtimeChannelsResource(core, client);\n    this.members = new RealtimeMembersResource(core, client);\n    this.#options = options;\n  }\n\n  /**\n   * Publish, with end-to-end encryption when the channel asks for it: a\n   * `private-encrypted-` channel's payload is sealed locally under the\n   * configured master key before the request leaves the process. One channel\n   * per encrypted publish — each channel derives its own key, so a fan-out\n   * would deliver ciphertext other channels' subscribers cannot open.\n   *\n   * @example Publish to an encrypted channel\n   * // Client config: realtime: { key, secret, encryptionMasterKey }\n   * await bird.realtime.publish(\"rap_01krdgeqcxet5s7t44vh8rt9mg\", {\n   *   event: \"order.updated\",\n   *   channels: [\"private-encrypted-orders\"],\n   *   data: { order_id: \"ord_123\", status: \"shipped\" },\n   * });\n   */\n  override publish(\n    realtimeAppId: string,\n    params: RealtimePublishParams,\n    options?: RequestOptions,\n  ): APIPromise<RealtimePublishResult> {\n    const encrypted = params.channels.filter(isEncryptedChannel);\n    if (encrypted.length === 0) {\n      return super.publish(realtimeAppId, params, options);\n    }\n    if (params.channels.length > 1) {\n      throw new BirdError(\n        \"A publish to a private-encrypted- channel must name exactly that \" +\n          \"one channel: every channel derives its own key, so a multi-channel \" +\n          \"publish would hand the other channels undecryptable ciphertext. \" +\n          \"Publish per channel instead.\",\n      );\n    }\n    const masterKey = decodeMasterKey(this.#options?.encryptionMasterKey);\n    return this.call<RealtimePublishResult>(\n      \"POST\",\n      options,\n      async ({ signal, headers }) => {\n        const body = {\n          ...params,\n          data: await encryptForChannel(encrypted[0]!, params.data, masterKey),\n        };\n        return publishRealtimeAppEvent({\n          client: this.client,\n          path: { realtime_app_id: realtimeAppId },\n          body,\n          headers,\n          signal,\n        });\n      },\n      [\"RealtimeKey\", \"RealtimeSecret\"],\n    );\n  }\n\n  /**\n   * Publish a batch, sealing each event addressed to a `private-encrypted-`\n   * channel under that channel's derived key (batch events carry one channel\n   * each, so items encrypt independently).\n   */\n  override publishBatch(\n    realtimeAppId: string,\n    params: RealtimePublishBatchParams,\n    options?: RequestOptions,\n  ): APIPromise<RealtimeBatchPublishResult> {\n    if (!params.events.some((e) => isEncryptedChannel(e.channel))) {\n      return super.publishBatch(realtimeAppId, params, options);\n    }\n    const masterKey = decodeMasterKey(this.#options?.encryptionMasterKey);\n    return this.call<RealtimeBatchPublishResult>(\n      \"POST\",\n      options,\n      async ({ signal, headers }) => {\n        const events = await Promise.all(\n          params.events.map(async (e) =>\n            isEncryptedChannel(e.channel)\n              ? { ...e, data: await encryptForChannel(e.channel, e.data, masterKey) }\n              : e,\n          ),\n        );\n        return publishRealtimeAppBatch({\n          client: this.client,\n          path: { realtime_app_id: realtimeAppId },\n          body: { ...params, events },\n          headers,\n          signal,\n        });\n      },\n      [\"RealtimeKey\", \"RealtimeSecret\"],\n    );\n  }\n\n  /**\n   * Sign a channel subscription for the browser client — the body your auth\n   * endpoint returns. Runs locally (no request): the signature is\n   * `HMAC-SHA256(secret, \"<connectionId>:<channelName>[:<memberData>]\")`,\n   * prefixed with the app key. For a presence channel pass `memberData`, the\n   * exact JSON string carrying `member_id` (and optionally `member_info`) —\n   * it is signed and echoed byte-identical. For a `private-encrypted-`\n   * channel the response also carries the channel's `shared_secret`, derived\n   * from the configured encryption master key.\n   *\n   * @example An Express auth endpoint\n   * app.post(\"/bird/auth\", async (req, res) => {\n   *   const { connection_id, channel_name } = req.body;\n   *   if (!mayJoin(req.session.user, channel_name)) return res.sendStatus(403);\n   *   res.json(\n   *     await bird.realtime.authorizeChannel({\n   *       connectionId: connection_id,\n   *       channelName: channel_name,\n   *     }),\n   *   );\n   * });\n   */\n  async authorizeChannel(params: {\n    /** The subscribing connection's id, as POSTed by the client. */\n    connectionId: string;\n    /** The channel being subscribed, as POSTed by the client. */\n    channelName: string;\n    /** Presence channels: the member-identity JSON string to sign and echo. */\n    memberData?: string;\n  }): Promise<ChannelAuthorization> {\n    const { key, secret } = this.#options ?? {};\n    if (!key || !secret) {\n      throw new BirdError(\n        \"authorizeChannel signs with the Realtime app credentials. Set \" +\n          \"`realtime: { key, secret }` on the client.\",\n      );\n    }\n    const toSign =\n      params.memberData === undefined\n        ? `${params.connectionId}:${params.channelName}`\n        : `${params.connectionId}:${params.channelName}:${params.memberData}`;\n    const out: ChannelAuthorization = {\n      auth: `${key}:${await hmacSha256Hex(secret, toSign)}`,\n    };\n    if (params.memberData !== undefined) out.member_data = params.memberData;\n    if (isEncryptedChannel(params.channelName)) {\n      const masterKey = decodeMasterKey(this.#options?.encryptionMasterKey);\n      out.shared_secret = toBase64(\n        await deriveSharedSecret(params.channelName, masterKey),\n      );\n    }\n    return out;\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { createEmailLookup, createPhoneNumberLookup } from \"../generated/sdk.gen.js\";\nimport type { CreateEmailLookupData, CreatePhoneNumberLookupData, EmailLookup, PhoneNumberLookup } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { PhoneNumberLookup };\nexport type { EmailLookup };\nexport type LookupPhoneNumberParams = NonNullable<CreatePhoneNumberLookupData[\"body\"]>;\nexport type LookupEmailParams = NonNullable<CreateEmailLookupData[\"body\"]>;\n\nexport class LookupResource extends Resource {\n  /**\n   * Create a lookup for a phone number's networks, porting state, country, and line type. Pass `type` to request separately billed `classification`, `porting`, `presence`, `roaming`, `sim_swap`, or `score` blocks. Each block reports its own status, and only blocks with an `ok` status add a charge; the lookup does not contact the number.\n   *\n   * @example Look up a number, buying two extra blocks\n   * const answer = await bird.lookup.phoneNumber({\n   *   phone_number: \"+31612345678\",\n   *   type: [\"classification\", \"score\"],\n   * });\n   * console.log(answer.country_code, answer.line_type);\n   * // Only a block whose status is ok carries a value, and only that one is billed.\n   * if (answer.score?.status === \"ok\") console.log(answer.score.value);\n   */\n  phoneNumber(params: LookupPhoneNumberParams, options?: RequestOptions): APIPromise<PhoneNumberLookup> {\n    return this.call<PhoneNumberLookup>(\"POST\", options, ({ signal, headers }) =>\n      createPhoneNumberLookup({ client: this.client, body: params, headers, signal }));\n  }\n\n  /**\n   * Create a deliverability lookup for one email address. Returns `result`, `delivery_confidence`, address `flags`, an undeliverable `reason`, and `did_you_mean` when a correction is available. Treat unknown `result` and `reason` values as valid additions and use `delivery_confidence` as the fallback; each completed lookup incurs the same charge.\n   *\n   * @example Check whether an address is worth sending to\n   * const answer = await bird.lookup.email({ email: \"aisha.khan@example.com\" });\n   * // result is an open vocabulary; delivery_confidence is always comparable.\n   * console.log(answer.result, answer.delivery_confidence);\n   */\n  email(params: LookupEmailParams, options?: RequestOptions): APIPromise<EmailLookup> {\n    return this.call<EmailLookup>(\"POST\", options, ({ signal, headers }) =>\n      createEmailLookup({ client: this.client, body: params, headers, signal }));\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { getWorkspaceNumber, listWorkspaceNumbers, releaseWorkspaceNumber } from \"../generated/sdk.gen.js\";\nimport type { GetWorkspaceNumberData, ListWorkspaceNumbersData, Number, ReleaseWorkspaceNumberData } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, PaginatedPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { Number };\nexport type NumbersListQuery = NonNullable<ListWorkspaceNumbersData[\"query\"]>;\n\nexport class NumbersResourceBase extends Resource {\n  /**\n   * Pages the numbers allocated to the workspace, dedicated and shared alike. Narrows on country, type, prefix and capability, so one number is reached without walking every page.\n   *\n   * @example List the numbers allocated to you\n   * for await (const allocated of bird.numbers.list({ country_code: \"GB\" })) {\n   *   // kind tells a number you bought from one Bird manages for several workspaces.\n   *   console.log(allocated.number, allocated.kind, allocated.status);\n   * }\n   */\n  list(query?: NumbersListQuery, options?: RequestOptions): PaginatedPromise<Number> {\n    return this.paginated<Number>(\"GET\", options, ({ signal, headers }, cursor) =>\n      listWorkspaceNumbers({ client: this.client, query: { ...query, starting_after: cursor ?? query?.starting_after }, headers, signal }));\n  }\n\n  /**\n   * Reads one allocated number by the id `numbers.list` returns. Carries its status and, where a country demands ownership paperwork, what is still outstanding on it.\n   *\n   * @example Read one number allocated to you\n   * const allocated = await bird.numbers.get(\"nda_01krdgeqcxet5s7t44vh8rt9mg\");\n   * // A country that asks for ownership paperwork answers here; most answer null.\n   * console.log(allocated.status, allocated.ownership ?? \"no paperwork required\");\n   */\n  get(numberId: string, options?: RequestOptions): APIPromise<Number> {\n    return this.call<Number>(\"GET\", options, ({ signal, headers }) =>\n      getWorkspaceNumber({ client: this.client, path: { number_id: numberId }, headers, signal }));\n  }\n\n  /**\n   * Gives a dedicated number back and stops its monthly charge. Irreversible: the number leaves the workspace and the channels built on it stop sending. A shared number cannot be released.\n   *\n   * @example Give a dedicated number back\n   * // Releasing stops the monthly charge and the number stops working for you.\n   * // Only a dedicated number can be released; a shared one answers E14002.\n   * await bird.numbers.release(\"nda_01krdgeqcxet5s7t44vh8rt9mg\");\n   */\n  release(numberId: string, options?: RequestOptions): APIPromise<void> {\n    return this.call<void>(\"DELETE\", options, ({ signal, headers }) =>\n      releaseWorkspaceNumber({ client: this.client, path: { number_id: numberId }, headers, signal }));\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { getAvailableNumber, listAvailableNumbers } from \"../generated/sdk.gen.js\";\nimport type { AvailableNumber, GetAvailableNumberData, ListAvailableNumbersData } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, PaginatedPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { AvailableNumber };\nexport type NumbersAvailableListQuery = NonNullable<ListAvailableNumbersData[\"query\"]>;\n\nexport class NumbersAvailableResource extends Resource {\n  /**\n   * Searches one country's numbers on sale. Our own inventory answers first and pages; the last page can carry a live carrier snapshot, so a number seen here may be gone by the time it is ordered.\n   *\n   * @example Find a number to buy in one country\n   * // The search is always country-scoped, so country_code is required.\n   * const page = await bird.numbers.available.list({\n   *   country_code: \"GB\",\n   *   capabilities: [\"sms\", \"voice\"],\n   * });\n   * for (const candidate of page.data) {\n   *   console.log(candidate.number, candidate.number_type);\n   * }\n   */\n  list(query: NumbersAvailableListQuery, options?: RequestOptions): PaginatedPromise<AvailableNumber> {\n    return this.paginated<AvailableNumber>(\"GET\", options, ({ signal, headers }, cursor) =>\n      listAvailableNumbers({ client: this.client, query: { ...query, starting_after: cursor ?? query?.starting_after }, headers, signal }));\n  }\n\n  /**\n   * Re-checks one number from `numbers.available.list` against the carrier, so a stale search result is caught before it is ordered.\n   *\n   * @example Check one number is still for sale\n   * // A number a carrier supplies is only on sale while the carrier still has it,\n   * // so a 404 here means someone else took it.\n   * const candidate = await bird.numbers.available.get(\"+447700900201\");\n   * console.log(candidate.country_code, candidate.capabilities);\n   */\n  get(number: string, options?: RequestOptions): APIPromise<AvailableNumber> {\n    return this.call<AvailableNumber>(\"GET\", options, ({ signal, headers }) =>\n      getAvailableNumber({ client: this.client, path: { number: number }, headers, signal }));\n  }\n}\n","// Code generated by surface-gen; DO NOT EDIT.\nimport { createNumbersOrder, getNumbersOrder, listNumbersOrders } from \"../generated/sdk.gen.js\";\nimport type { CreateNumbersOrderData, GetNumbersOrderData, ListNumbersOrdersData, NumbersOrder } from \"../generated/types.gen.js\";\nimport { Resource } from \"./base.js\";\nimport type { APIPromise, PaginatedPromise, RequestOptions } from \"../core/result.js\";\n\nexport type { NumbersOrder };\nexport type NumbersOrdersCreateParams = NonNullable<CreateNumbersOrderData[\"body\"]>;\nexport type NumbersOrdersListQuery = NonNullable<ListNumbersOrdersData[\"query\"]>;\n\nexport class NumbersOrdersResource extends Resource {\n  /**\n   * Buys a number and starts its monthly charge. Most orders settle inline; one waiting on a carrier comes back pending and is followed with `numbers.orders.get`. A setup fee already taken is not refunded if the order then fails.\n   *\n   * @example Buy a number\n   * const order = await bird.numbers.orders.create({ number: \"+447700900201\" });\n   * // Most orders finish inside the request. One that has to wait on a carrier\n   * // comes back without a number_id. Poll it until it is completed or failed.\n   * if (order.status === \"completed\") {\n   *   console.log(\"allocated as\", order.number_id);\n   * } else {\n   *   console.log(\"still\", order.status, \"; poll\", order.id);\n   * }\n   */\n  create(params: NumbersOrdersCreateParams, options?: RequestOptions): APIPromise<NumbersOrder> {\n    return this.call<NumbersOrder>(\"POST\", options, ({ signal, headers }) =>\n      createNumbersOrder({ client: this.client, body: params, headers, signal }));\n  }\n\n  /**\n   * Pages the workspace's purchase attempts, newest first, filtered by status. An order outlives its attempt, so a failure stays readable with the reason it carried.\n   *\n   * @example Find the purchases that did not complete\n   * const page = await bird.numbers.orders.list({ status: \"failed\" });\n   * for (const order of page.data) {\n   *   console.log(order.number, order.failure_reason ?? \"\");\n   * }\n   */\n  list(query?: NumbersOrdersListQuery, options?: RequestOptions): PaginatedPromise<NumbersOrder> {\n    return this.paginated<NumbersOrder>(\"GET\", options, ({ signal, headers }, cursor) =>\n      listNumbersOrders({ client: this.client, query: { ...query, starting_after: cursor ?? query?.starting_after }, headers, signal }));\n  }\n\n  /**\n   * Reads one order's current state, and the number it produced once completed. This is the poll for an order that came back pending.\n   *\n   * @example Poll an order that did not finish inline\n   * const order = await bird.numbers.orders.get(\"nor_01krdgeqcxet5s7t44vh8rt9mg\");\n   * // failure_reason says what went wrong, and only ever on a failed order.\n   * console.log(order.status, order.failure_reason ?? \"\");\n   */\n  get(orderId: string, options?: RequestOptions): APIPromise<NumbersOrder> {\n    return this.call<NumbersOrder>(\"GET\", options, ({ signal, headers }) =>\n      getNumbersOrder({ client: this.client, path: { order_id: orderId }, headers, signal }));\n  }\n}\n","// `bird.numbers` — the numbers a workspace holds, plus the `available` search\n// and the `orders` that turn one into the other.\n//\n// Buying is an order rather than a direct create: most complete inside the\n// request, but one that has to wait on a carrier comes back pending and is\n// polled through `bird.numbers.orders.get(...)`.\n\nimport { Resource } from \"./base.js\";\nimport {\n  NumbersResourceBase,\n  type Number,\n  type NumbersListQuery,\n} from \"./numbers.gen.js\";\nimport {\n  NumbersAvailableResource,\n  type AvailableNumber,\n  type NumbersAvailableListQuery,\n} from \"./numbersAvailable.gen.js\";\nimport {\n  NumbersOrdersResource,\n  type NumbersOrder,\n  type NumbersOrdersListQuery,\n} from \"./numbersOrders.gen.js\";\n\nexport type {\n  AvailableNumber,\n  Number,\n  NumbersAvailableListQuery,\n  NumbersListQuery,\n  NumbersOrder,\n  NumbersOrdersListQuery,\n};\n\nexport class NumbersResource extends NumbersResourceBase {\n  /** Numbers on sale — `bird.numbers.available.list(...)`, `.get(...)`. */\n  readonly available: NumbersAvailableResource;\n\n  /** Purchases — `bird.numbers.orders.create(...)`, `.list(...)`, `.get(...)`. */\n  readonly orders: NumbersOrdersResource;\n\n  constructor(\n    core: ConstructorParameters<typeof Resource>[0],\n    client: ConstructorParameters<typeof Resource>[1],\n  ) {\n    super(core, client);\n    this.available = new NumbersAvailableResource(core, client);\n    this.orders = new NumbersOrdersResource(core, client);\n  }\n}\n","import {\n  createClient,\n  createConfig,\n  type Client,\n} from \"./generated/client/index.js\";\nimport { baseUrlForRegion, regionFromApiKey } from \"./region.js\";\nimport { detectCaller } from \"./detect-caller.js\";\nimport {\n  BirdHTTPClient,\n  type AttemptContext,\n  type FetchOutcome,\n} from \"./core/http.js\";\nimport {\n  apiPromise,\n  type APIPromise,\n  type RequestOptions,\n} from \"./core/result.js\";\nimport { EmailResource, type EmailChannelDefaults } from \"./resources/email.js\";\nimport { AudiencesResource } from \"./resources/audiences.gen.js\";\nimport { DomainsResource } from \"./resources/domains.gen.js\";\nimport { ContactPropertiesResource } from \"./resources/contactProperties.gen.js\";\nimport { ContactsResource } from \"./resources/contacts.gen.js\";\nimport { SmsResource } from \"./resources/sms.js\";\nimport { SmsKeywordRulesResource } from \"./resources/smsKeywordRules.gen.js\";\nimport { SmsSuppressionsResource } from \"./resources/smsSuppressions.gen.js\";\nimport { SmsTemplatesResource } from \"./resources/smsTemplates.gen.js\";\nimport { WhatsappResource } from \"./resources/whatsapp.js\";\nimport { VoiceResource } from \"./resources/voice.gen.js\";\nimport { VerifyResource } from \"./resources/verify.js\";\nimport { WebhooksResource, type WebhookOptions } from \"./resources/webhooks.js\";\nimport { RealtimeResource, type RealtimeOptions } from \"./resources/realtime.js\";\nimport { LookupResource } from \"./resources/lookup.gen.js\";\nimport { NumbersResource } from \"./resources/numbers.js\";\n\n// The SDK's own version, sent as User-Agent. Injected at build time from\n// package.json (tsdown/vitest `define`) so it never drifts from the published\n// version. The Bird API version (X-Bird-API-Version) is deferred; see\n// sdk-build-ledger #3.\ndeclare const __SDK_VERSION__: string;\nconst DEFAULT_TIMEOUT_MS = 60_000;\nconst DEFAULT_MAX_RETRIES = 2;\n\nexport interface BirdClientOptions {\n  apiKey: string;\n  /** Explicit base URL; overrides region resolution. For local/self-hosted use. */\n  baseUrl?: string;\n  /** Region override (e.g. `\"eu1\"`); the API key prefix is used by default. */\n  region?: string;\n  /** Per-attempt timeout in ms. Default 60_000. */\n  timeout?: number;\n  /** Max retry attempts on retryable failures (429, 5xx, network). Default 2. */\n  maxRetries?: number;\n  /** Custom fetch for testing, proxying, or edge-runtime adapters. Default global fetch. */\n  fetch?: typeof fetch;\n  /** Headers added to every request. SDK-internal headers win on conflict. */\n  defaultHeaders?: Record<string, string>;\n  /**\n   * Email channel defaults. Any field set here may be omitted in\n   * `bird.email.send` (the type enforces this); the per-send value wins.\n   */\n  email?: EmailChannelDefaults;\n  /** Webhook config. `secret` is the default used by `bird.webhooks.unwrap`. */\n  webhooks?: WebhookOptions;\n  /**\n   * Realtime app credentials. Every `bird.realtime.*` call authenticates to the\n   * Realtime edge with this key/secret pair; a call's options can override it.\n   */\n  realtime?: RealtimeOptions;\n}\n\n/** A raw request for the `bird.request` escape hatch. */\nexport interface BirdRequest {\n  method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\";\n  /**\n   * Absolute path on the API host, e.g. `/v1/email/domains`; must start\n   * with a single `/`.\n   */\n  path: string;\n  query?: Record<string, string | number | boolean | undefined>;\n  /** JSON request body. */\n  body?: unknown;\n  headers?: Record<string, string>;\n}\n\n// Extract the email-channel defaults from the literal options type. The result\n// is `undefined` when none were set and controls whether `send` requires `from`.\ntype EmailDefaultsOf<O> = O extends {\n  email: infer E extends EmailChannelDefaults;\n}\n  ? E\n  : undefined;\n\n// Precedence: explicit baseUrl, then explicit region, then the key's region\n// prefix. There is no region-less data-plane host, so an unresolvable region throws.\nfunction resolveBaseUrl(options: BirdClientOptions): string {\n  if (options.baseUrl) return options.baseUrl;\n  const region = options.region ?? regionFromApiKey(options.apiKey);\n  if (!region) {\n    throw new Error(\n      \"Unable to determine region: API key is not in the expected \" +\n        \"bk_{region}_{token} format. Pass an explicit `region` or `baseUrl`.\",\n    );\n  }\n  return baseUrlForRegion(region);\n}\n\n// The raw escape hatch accepts caller-supplied paths. Require an absolute path\n// segment (not an authority-relative URL) and assert the final origin before\n// attaching SDK auth headers.\nfunction resolveRawRequestUrl(baseUrl: string, path: string): URL {\n  if (!path.startsWith(\"/\") || path.startsWith(\"//\")) {\n    throw new TypeError(\n      \"bird.request path must be an absolute path starting with a single `/`\",\n    );\n  }\n  const base = new URL(baseUrl);\n  const url = new URL(baseUrl + path);\n  if (url.origin !== base.origin) {\n    throw new TypeError(\n      \"bird.request path must stay on the configured Bird API origin\",\n    );\n  }\n  return url;\n}\n\n/**\n * The Bird API client. Construct it with an API key. The region comes from the\n * key's prefix (`bk_{region}_…`). Pass `baseUrl` or `region` to override it.\n *\n * @example Construct and send\n * const bird = new BirdClient({ apiKey: process.env.BIRD_API_KEY! });\n * const msg = await bird.email.send({\n *   from: \"hello@acme.com\",\n *   to: [\"customer@example.com\"],\n *   subject: \"Welcome aboard\",\n *   html: \"<h1>Hi there 👋</h1>\",\n * });\n * console.log(msg.id);\n *\n * @example Set channel defaults once; a per-send value always wins\n * const bird = new BirdClient({\n *   apiKey: process.env.BIRD_API_KEY!,\n *   email: { from: \"hello@acme.com\", category: \"transactional\" },\n * });\n * // `from` and `category` are filled from the defaults; both stay optional in `send`.\n * await bird.email.send({ to: [\"customer@example.com\"], subject: \"Hi\", html: \"<p>hi</p>\" });\n *\n * @example All client options\n * const bird = new BirdClient({\n *   apiKey: process.env.BIRD_API_KEY!,\n *   region: \"eu1\", // optional; overrides the region from the key prefix\n *   baseUrl: \"http://localhost:8080\", // optional; overrides region (local or self-hosted)\n *   timeout: 60_000, // per-attempt timeout in ms (default 60_000)\n *   maxRetries: 2, // retry budget for transient failures (default 2)\n * });\n */\nexport class BirdClient<const O extends BirdClientOptions = BirdClientOptions> {\n  protected readonly core: BirdHTTPClient;\n\n  // The generated hey-api client, configured with this instance's base URL,\n  // auth, and fetch. Resources call the generated SDK functions through it.\n  readonly #client: Client;\n  readonly #baseUrl: string;\n  readonly #fetch: typeof fetch;\n  readonly #headers: Record<string, string>;\n\n  /** Email channel: `bird.email.send(...)`, `.get(...)`, `.list(...)`. */\n  readonly email: EmailResource<EmailDefaultsOf<O>>;\n\n\n  /** SMS channel: `bird.sms.send(...)`, `.get(...)`, `.list(...)`. */\n  readonly sms: SmsResource;\n\n  /** SMS templates: `bird.smsTemplates.list(...)`, `.get(...)`. */\n  readonly smsTemplates: SmsTemplatesResource;\n\n  /** SMS suppressions: `bird.smsSuppressions.list(...)`, `.add(...)`, `.remove(...)`. */\n  readonly smsSuppressions: SmsSuppressionsResource;\n\n  /** SMS keyword rules: `bird.smsKeywordRules.list(...)`, `.create(...)`, … */\n  readonly smsKeywordRules: SmsKeywordRulesResource;\n\n\n  /** WhatsApp channel: `bird.whatsapp.send(...)`, `.get(...)`, `.list(...)`, `.listEvents(...)`. */\n  readonly whatsapp: WhatsappResource;\n\n  /** Voice call log: `bird.voice.list(...)`, `.get(...)`. Your SIP equipment places calls, so this is a read surface. */\n  readonly voice: VoiceResource;\n\n  /** Verify: `bird.verify.verifications.create(...)`, `.check(...)`. */\n  readonly verify: VerifyResource;\n\n  /** Contacts: `bird.contacts.create(...)`, `.list(...)`, `.get(...)`, `.batch(...)`, … */\n  readonly contacts: ContactsResource;\n\n  /** Audiences: `bird.audiences.create(...)`, `.list(...)`, `.addContacts(...)`, … */\n  readonly audiences: AudiencesResource;\n\n  /** Contact properties: `bird.contactProperties.create(...)`, `.list(...)`, `.archive(...)`, … */\n  readonly contactProperties: ContactPropertiesResource;\n\n  /** Sending domains: `bird.domains.create(...)`, `.list(...)`, `.verify(...)`, … */\n  readonly domains: DomainsResource;\n\n  /** Recipient intelligence: `bird.lookup.email(...)`, `.phoneNumber(...)`. Every answer is billed. */\n  readonly lookup: LookupResource;\n\n  /** Numbers: `bird.numbers.available.list(...)`, `.orders.create(...)`, `.list(...)`, `.release(...)`. */\n  readonly numbers: NumbersResource;\n\n  /** Webhooks: `bird.webhooks.unwrap(payload, headers)` verifies an inbound delivery. */\n  readonly webhooks: WebhooksResource;\n\n\n\n\n  /** Realtime: `bird.realtime.publish(...)`, `.channels.list(...)`, `.members.disconnect(...)`, … */\n  readonly realtime: RealtimeResource;\n\n  constructor(options: O) {\n    const opts: BirdClientOptions = options; // widen for safe optional access\n    this.#baseUrl = resolveBaseUrl(opts);\n    this.#fetch = opts.fetch ?? fetch;\n    this.#headers = {\n      ...opts.defaultHeaders,\n      Authorization: `Bearer ${opts.apiKey}`,\n      \"User-Agent\": `bird-sdk-js/${__SDK_VERSION__}`,\n      // Bird-* client-identity headers attribute the SDK surface. The User-Agent\n      // does not. These headers are edge-safe, so they omit OS, architecture, and\n      // runtime values that require Node globals; they include only surface and version.\n      \"Bird-Surface\": \"sdk-js\",\n      \"Bird-Version\": __SDK_VERSION__,\n    };\n    // Bird-Caller identifies the driving agent harness. It is empty in a browser\n    // or when no agent environment is present, so the header is omitted.\n    const caller = detectCaller();\n    if (caller) this.#headers[\"Bird-Caller\"] = caller;\n    this.#client = createClient(\n      createConfig({\n        baseUrl: this.#baseUrl,\n        fetch: this.#fetch,\n        headers: this.#headers,\n      }),\n    );\n    this.core = new BirdHTTPClient({\n      timeout: opts.timeout ?? DEFAULT_TIMEOUT_MS,\n      maxRetries: opts.maxRetries ?? DEFAULT_MAX_RETRIES,\n      credentials: {\n        RealtimeKey: {\n          header: \"X-Realtime-Key\",\n          value: opts.realtime?.key,\n          how: \"Set `realtime: { key, secret }` on the client.\",\n        },\n        RealtimeSecret: {\n          header: \"X-Realtime-Secret\",\n          value: opts.realtime?.secret,\n          how: \"Set `realtime: { key, secret }` on the client.\",\n        },\n      },\n    });\n    // The runtime value is the configured defaults (or undefined); the precise\n    // conditional type can't be reproved from the widened access, so assert it.\n    this.email = new EmailResource<EmailDefaultsOf<O>>(\n      this.core,\n      this.#client,\n      opts.email as EmailDefaultsOf<O>,\n    );\n    this.sms = new SmsResource(this.core, this.#client);\n    this.smsTemplates = new SmsTemplatesResource(this.core, this.#client);\n    this.smsSuppressions = new SmsSuppressionsResource(this.core, this.#client);\n    this.smsKeywordRules = new SmsKeywordRulesResource(this.core, this.#client);\n    this.whatsapp = new WhatsappResource(this.core, this.#client);\n    this.voice = new VoiceResource(this.core, this.#client);\n    this.verify = new VerifyResource(this.core, this.#client);\n    this.contacts = new ContactsResource(this.core, this.#client);\n    this.audiences = new AudiencesResource(this.core, this.#client);\n    this.contactProperties = new ContactPropertiesResource(\n      this.core,\n      this.#client,\n    );\n    this.domains = new DomainsResource(this.core, this.#client);\n    this.lookup = new LookupResource(this.core, this.#client);\n    this.numbers = new NumbersResource(this.core, this.#client);\n    this.webhooks = new WebhooksResource(opts.webhooks);\n    this.realtime = new RealtimeResource(this.core, this.#client, opts.realtime);\n  }\n\n  /**\n   * Escape hatch for endpoints the typed resources don't cover. Runs the full\n   * lifecycle (auth, retries, idempotency, error mapping); you supply the\n   * response type. Prefer a typed resource method where one exists.\n   *\n   * @throws {TypeError} if `req.path` does not start with exactly one `/` or\n   *   resolves to a different origin than the configured Bird API base URL.\n   *\n   * @example Reach an endpoint outside the curated surface. Supply the response type\n   * type Suppressions = { data: Array<{ recipient: string }> };\n   * const suppressions = await bird.request<Suppressions>({ method: \"GET\", path: \"/v1/email/suppressions\" });\n   * console.log(suppressions.data.length);\n   */\n  request<T = unknown>(\n    req: BirdRequest,\n    options?: RequestOptions,\n  ): APIPromise<T> {\n    const url = resolveRawRequestUrl(this.#baseUrl, req.path);\n    return apiPromise(\n      this.core.request<T>(\n        (ctx) => this.#raw<T>(url, req, ctx, options?.headers),\n        {\n          method: req.method,\n          idempotencyKey: options?.idempotencyKey,\n          signal: options?.signal,\n          timeout: options?.timeout,\n          maxRetries: options?.maxRetries,\n        },\n      ),\n    );\n  }\n\n  async #raw<T>(\n    url: URL,\n    req: BirdRequest,\n    ctx: AttemptContext,\n    extraHeaders?: Record<string, string>,\n  ): Promise<FetchOutcome<T>> {\n    url = new URL(url);\n    if (req.query) {\n      for (const [key, value] of Object.entries(req.query)) {\n        if (value !== undefined) url.searchParams.set(key, String(value));\n      }\n    }\n    // SDK-internal headers (auth, idempotency) win over caller-supplied ones.\n    const headers: Record<string, string> = {\n      ...extraHeaders,\n      ...this.#headers,\n    };\n    if (ctx.idempotencyKey) headers[\"Idempotency-Key\"] = ctx.idempotencyKey;\n    if (req.body !== undefined) headers[\"Content-Type\"] = \"application/json\";\n\n    const response = await this.#fetch(url, {\n      method: req.method,\n      headers,\n      body: req.body !== undefined ? JSON.stringify(req.body) : undefined,\n      signal: ctx.signal,\n    });\n\n    if (response.ok) {\n      const data =\n        response.status === 204\n          ? undefined\n          : await response.json().catch(() => undefined);\n      // The caller supplies T, so the escape hatch asserts the raw JSON to that type.\n      return { data: data as T, response };\n    }\n    const error = await response\n      .clone()\n      .json()\n      .catch(() => undefined);\n    return { error, response };\n  }\n}\n","// Code generated by beak gen:event-consts. DO NOT EDIT.\n\n/**\n * Webhook event types known at this SDK version. The wire value is an open\n * string: a value added by a newer server is returned by `unwrap` unchanged,\n * so switch on these with a `default` branch.\n */\nexport const WebhookEventType = {\n  DomainFailed: \"domain.failed\",\n  DomainVerified: \"domain.verified\",\n  EmailAccepted: \"email.accepted\",\n  EmailBounced: \"email.bounced\",\n  EmailCanceled: \"email.canceled\",\n  EmailClicked: \"email.clicked\",\n  EmailComplained: \"email.complained\",\n  EmailDeferred: \"email.deferred\",\n  EmailDelivered: \"email.delivered\",\n  EmailListUnsubscribed: \"email.list_unsubscribed\",\n  EmailMailboxMessageDelivered: \"email_mailbox.message_delivered\",\n  EmailMailboxMessageFailed: \"email_mailbox.message_failed\",\n  EmailMailboxMessageReceived: \"email_mailbox.message_received\",\n  EmailMailboxMessageSent: \"email_mailbox.message_sent\",\n  EmailMailboxSuspended: \"email_mailbox.suspended\",\n  EmailMailboxThreadCreated: \"email_mailbox.thread_created\",\n  EmailOpened: \"email.opened\",\n  EmailOutOfBandBounce: \"email.out_of_band_bounce\",\n  EmailProcessed: \"email.processed\",\n  EmailReceived: \"email.received\",\n  EmailRejected: \"email.rejected\",\n  EmailScheduled: \"email.scheduled\",\n  EmailSuppressionCreated: \"email_suppression.created\",\n  EmailUnsubscribed: \"email.unsubscribed\",\n  SmsAccepted: \"sms.accepted\",\n  SmsDelivered: \"sms.delivered\",\n  SmsExpired: \"sms.expired\",\n  SmsFailed: \"sms.failed\",\n  SmsReceived: \"sms.received\",\n  SmsRejected: \"sms.rejected\",\n  SmsSent: \"sms.sent\",\n  SmsUndelivered: \"sms.undelivered\",\n  VerifyAttemptDelivered: \"verify.attempt.delivered\",\n  VerifyAttemptSent: \"verify.attempt.sent\",\n  VerifyAttemptUndelivered: \"verify.attempt.undelivered\",\n  VerifyVerificationCreated: \"verify.verification.created\",\n  VerifyVerificationFailed: \"verify.verification.failed\",\n  VerifyVerificationVerified: \"verify.verification.verified\",\n  VoiceCallAnswered: \"voice_call.answered\",\n  VoiceCallEnded: \"voice_call.ended\",\n  VoiceCallInitiated: \"voice_call.initiated\",\n  WhatsappAccepted: \"whatsapp.accepted\",\n  WhatsappDelivered: \"whatsapp.delivered\",\n  WhatsappFailed: \"whatsapp.failed\",\n  WhatsappRead: \"whatsapp.read\",\n  WhatsappReceived: \"whatsapp.received\",\n  WhatsappRejected: \"whatsapp.rejected\",\n  WhatsappSent: \"whatsapp.sent\",\n} as const;\n\n/** A known webhook event type value. */\nexport type WebhookEventTypeValue =\n  (typeof WebhookEventType)[keyof typeof WebhookEventType];\n","// Code generated by beak gen:event-consts. DO NOT EDIT.\n\n/**\n * Values of EmailEventType known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const EmailEventType = {\n  EmailAccepted: \"email.accepted\",\n  EmailBounced: \"email.bounced\",\n  EmailCanceled: \"email.canceled\",\n  EmailClicked: \"email.clicked\",\n  EmailComplained: \"email.complained\",\n  EmailDeferred: \"email.deferred\",\n  EmailDelivered: \"email.delivered\",\n  EmailListUnsubscribed: \"email.list_unsubscribed\",\n  EmailOpened: \"email.opened\",\n  EmailOutOfBandBounce: \"email.out_of_band_bounce\",\n  EmailProcessed: \"email.processed\",\n  EmailRejected: \"email.rejected\",\n  EmailScheduled: \"email.scheduled\",\n  EmailUnsubscribed: \"email.unsubscribed\",\n} as const;\n\n/** A known EmailEventType value. */\nexport type EmailEventTypeValue = (typeof EmailEventType)[keyof typeof EmailEventType];\n\n/**\n * Values of EmailLookupFlag known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const EmailLookupFlag = {\n  Disposable: \"disposable\",\n  FreeProvider: \"free_provider\",\n  Role: \"role\",\n} as const;\n\n/** A known EmailLookupFlag value. */\nexport type EmailLookupFlagValue = (typeof EmailLookupFlag)[keyof typeof EmailLookupFlag];\n\n/**\n * Values of EmailLookupReason known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const EmailLookupReason = {\n  InvalidDomain: \"invalid_domain\",\n  InvalidRecipient: \"invalid_recipient\",\n  InvalidSyntax: \"invalid_syntax\",\n} as const;\n\n/** A known EmailLookupReason value. */\nexport type EmailLookupReasonValue = (typeof EmailLookupReason)[keyof typeof EmailLookupReason];\n\n/**\n * Values of EmailLookupResult known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const EmailLookupResult = {\n  Neutral: \"neutral\",\n  Risky: \"risky\",\n  Typo: \"typo\",\n  Undeliverable: \"undeliverable\",\n  Valid: \"valid\",\n} as const;\n\n/** A known EmailLookupResult value. */\nexport type EmailLookupResultValue = (typeof EmailLookupResult)[keyof typeof EmailLookupResult];\n\n/**\n * Values of LookupFlag known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const LookupFlag = {\n  Ported: \"ported\",\n} as const;\n\n/** A known LookupFlag value. */\nexport type LookupFlagValue = (typeof LookupFlag)[keyof typeof LookupFlag];\n\n/**\n * Values of LookupPropertyStatus known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const LookupPropertyStatus = {\n  Inconclusive: \"inconclusive\",\n  Ok: \"ok\",\n  Unavailable: \"unavailable\",\n} as const;\n\n/** A known LookupPropertyStatus value. */\nexport type LookupPropertyStatusValue = (typeof LookupPropertyStatus)[keyof typeof LookupPropertyStatus];\n\n/**\n * Values of NumberCapability known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const NumberCapability = {\n  Mms: \"mms\",\n  Sms: \"sms\",\n  Voice: \"voice\",\n} as const;\n\n/** A known NumberCapability value. */\nexport type NumberCapabilityValue = (typeof NumberCapability)[keyof typeof NumberCapability];\n\n/**\n * Values of NumberType known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const NumberType = {\n  Local: \"local\",\n  Mobile: \"mobile\",\n  National: \"national\",\n  ShortCode: \"short_code\",\n  ShortCodeFteu: \"short_code_fteu\",\n  TollFree: \"toll_free\",\n} as const;\n\n/** A known NumberType value. */\nexport type NumberTypeValue = (typeof NumberType)[keyof typeof NumberType];\n\n/**\n * Values of NumbersOrderStatus known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const NumbersOrderStatus = {\n  Charging: \"charging\",\n  Completed: \"completed\",\n  Failed: \"failed\",\n  Ordering: \"ordering\",\n  Pending: \"pending\",\n} as const;\n\n/** A known NumbersOrderStatus value. */\nexport type NumbersOrderStatusValue = (typeof NumbersOrderStatus)[keyof typeof NumbersOrderStatus];\n\n/**\n * Values of SMSErrorCode known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const SMSErrorCode = {\n  BlockedByCarrier: \"blocked_by_carrier\",\n  BlockedByRecipient: \"blocked_by_recipient\",\n  ContentRejected: \"content_rejected\",\n  InsufficientBalance: \"insufficient_balance\",\n  InvalidDestination: \"invalid_destination\",\n  LandlineUnreachable: \"landline_unreachable\",\n  ProviderUnavailable: \"provider_unavailable\",\n  RecipientOptedOut: \"recipient_opted_out\",\n  SenderUnregistered: \"sender_unregistered\",\n  Unknown: \"unknown\",\n  Unreachable: \"unreachable\",\n} as const;\n\n/** A known SMSErrorCode value. */\nexport type SMSErrorCodeValue = (typeof SMSErrorCode)[keyof typeof SMSErrorCode];\n\n/**\n * Values of SMSKeywordOperation known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const SMSKeywordOperation = {\n  Custom: \"custom\",\n  Help: \"help\",\n  Start: \"start\",\n  Stop: \"stop\",\n} as const;\n\n/** A known SMSKeywordOperation value. */\nexport type SMSKeywordOperationValue = (typeof SMSKeywordOperation)[keyof typeof SMSKeywordOperation];\n\n/**\n * Values of SMSSuppressionCoverage known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const SMSSuppressionCoverage = {\n  All: \"all\",\n  NonTransactional: \"non_transactional\",\n} as const;\n\n/** A known SMSSuppressionCoverage value. */\nexport type SMSSuppressionCoverageValue = (typeof SMSSuppressionCoverage)[keyof typeof SMSSuppressionCoverage];\n\n/**\n * Values of SMSSuppressionEndReason known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const SMSSuppressionEndReason = {\n  ApiKey: \"api_key\",\n  CarrierCleared: \"carrier_cleared\",\n  KeywordStart: \"keyword_start\",\n  User: \"user\",\n} as const;\n\n/** A known SMSSuppressionEndReason value. */\nexport type SMSSuppressionEndReasonValue = (typeof SMSSuppressionEndReason)[keyof typeof SMSSuppressionEndReason];\n\n/**\n * Values of SMSSuppressionOrigin known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const SMSSuppressionOrigin = {\n  ApiKey: \"api_key\",\n  DlrEvent: \"dlr_event\",\n  Keyword: \"keyword\",\n  User: \"user\",\n} as const;\n\n/** A known SMSSuppressionOrigin value. */\nexport type SMSSuppressionOriginValue = (typeof SMSSuppressionOrigin)[keyof typeof SMSSuppressionOrigin];\n\n/**\n * Values of SMSSuppressionReason known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const SMSSuppressionReason = {\n  CarrierOptedOut: \"carrier_opted_out\",\n  KeywordStop: \"keyword_stop\",\n  Manual: \"manual\",\n} as const;\n\n/** A known SMSSuppressionReason value. */\nexport type SMSSuppressionReasonValue = (typeof SMSSuppressionReason)[keyof typeof SMSSuppressionReason];\n\n/**\n * Values of TemplateLanguageStatus known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const TemplateLanguageStatus = {\n  Draft: \"draft\",\n  Live: \"live\",\n  Superseded: \"superseded\",\n} as const;\n\n/** A known TemplateLanguageStatus value. */\nexport type TemplateLanguageStatusValue = (typeof TemplateLanguageStatus)[keyof typeof TemplateLanguageStatus];\n\n/**\n * Values of TemplateStatus known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const TemplateStatus = {\n  Active: \"active\",\n  Draft: \"draft\",\n  Inactive: \"inactive\",\n  Pending: \"pending\",\n  Rejected: \"rejected\",\n} as const;\n\n/** A known TemplateStatus value. */\nexport type TemplateStatusValue = (typeof TemplateStatus)[keyof typeof TemplateStatus];\n\n/**\n * Values of VerificationAttemptFailureReason known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const VerificationAttemptFailureReason = {\n  CarrierRejected: \"carrier_rejected\",\n  ChannelDisabled: \"channel_disabled\",\n  ChannelUnavailable: \"channel_unavailable\",\n  DeliveryTimeout: \"delivery_timeout\",\n  HardBounce: \"hard_bounce\",\n  NotBillable: \"not_billable\",\n  SoftBounce: \"soft_bounce\",\n  Undelivered: \"undelivered\",\n} as const;\n\n/** A known VerificationAttemptFailureReason value. */\nexport type VerificationAttemptFailureReasonValue = (typeof VerificationAttemptFailureReason)[keyof typeof VerificationAttemptFailureReason];\n\n/**\n * Values of VerificationChannel known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const VerificationChannel = {\n  Email: \"email\",\n  Sms: \"sms\",\n  Telegram: \"telegram\",\n  Whatsapp: \"whatsapp\",\n} as const;\n\n/** A known VerificationChannel value. */\nexport type VerificationChannelValue = (typeof VerificationChannel)[keyof typeof VerificationChannel];\n\n/**\n * Values of VerificationTerminalReason known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const VerificationTerminalReason = {\n  AttemptsExhausted: \"attempts_exhausted\",\n  TtlElapsed: \"ttl_elapsed\",\n  Undeliverable: \"undeliverable\",\n} as const;\n\n/** A known VerificationTerminalReason value. */\nexport type VerificationTerminalReasonValue = (typeof VerificationTerminalReason)[keyof typeof VerificationTerminalReason];\n\n/**\n * Values of WhatsAppErrorCode known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const WhatsAppErrorCode = {\n  InsufficientBalance: \"insufficient_balance\",\n  InternalError: \"internal_error\",\n  MediaRejected: \"media_rejected\",\n  PriceNotFound: \"price_not_found\",\n  RateLimited: \"rate_limited\",\n  RecipientSuppressed: \"recipient_suppressed\",\n  ServiceWindowExpired: \"service_window_expired\",\n  Undeliverable: \"undeliverable\",\n} as const;\n\n/** A known WhatsAppErrorCode value. */\nexport type WhatsAppErrorCodeValue = (typeof WhatsAppErrorCode)[keyof typeof WhatsAppErrorCode];\n\n/**\n * Values of WhatsAppEventType known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const WhatsAppEventType = {\n  WhatsappAccepted: \"whatsapp.accepted\",\n  WhatsappDelivered: \"whatsapp.delivered\",\n  WhatsappFailed: \"whatsapp.failed\",\n  WhatsappRead: \"whatsapp.read\",\n  WhatsappReceived: \"whatsapp.received\",\n  WhatsappRejected: \"whatsapp.rejected\",\n  WhatsappSent: \"whatsapp.sent\",\n} as const;\n\n/** A known WhatsAppEventType value. */\nexport type WhatsAppEventTypeValue = (typeof WhatsAppEventType)[keyof typeof WhatsAppEventType];\n\n/**\n * Values of WhatsAppTemplateCategory known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const WhatsAppTemplateCategory = {\n  Authentication: \"authentication\",\n  Marketing: \"marketing\",\n  Utility: \"utility\",\n} as const;\n\n/** A known WhatsAppTemplateCategory value. */\nexport type WhatsAppTemplateCategoryValue = (typeof WhatsAppTemplateCategory)[keyof typeof WhatsAppTemplateCategory];\n\n/**\n * Values of WhatsAppTemplateParameterType known at this SDK version. The wire value is an open\n * string: a value added by a newer server deserializes unchanged, so switch on\n * these with a `default` branch rather than treating the set as closed.\n */\nexport const WhatsAppTemplateParameterType = {\n  Document: \"document\",\n  Gif: \"gif\",\n  Image: \"image\",\n  Location: \"location\",\n  Text: \"text\",\n  Video: \"video\",\n} as const;\n\n/** A known WhatsAppTemplateParameterType value. */\nexport type WhatsAppTemplateParameterTypeValue = (typeof WhatsAppTemplateParameterType)[keyof typeof WhatsAppTemplateParameterType];\n"],"mappings":";;AAuEA,MAAa,qBAAqB,EAChC,iBAAiB,SACf,KAAK,UAAU,OAAO,MAAM,UAC1B,OAAO,UAAU,WAAW,MAAM,SAAS,IAAI,KACjD,EACJ;;;ACYA,SAAgB,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