import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; import * as Webflow from "../../../index"; import { Fields } from "../resources/fields/client/Client"; import { Items } from "../resources/items/client/Client"; export declare namespace Collections { interface Options extends BaseClientOptions { } interface RequestOptions extends BaseRequestOptions { } } /** * Collections are CMS collections of items. */ export declare class Collections { protected readonly _options: Collections.Options; protected _fields: Fields | undefined; protected _items: Items | undefined; constructor(_options: Collections.Options); get fields(): Fields; get items(): Items; /** * List of all Collections within a Site. * * Required scope | `cms:read` * * @param {string} siteId - Unique identifier for a Site * @param {Collections.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Webflow.BadRequestError} * @throws {@link Webflow.UnauthorizedError} * @throws {@link Webflow.NotFoundError} * @throws {@link Webflow.TooManyRequestsError} * @throws {@link Webflow.InternalServerError} * * @example * await client.collections.list("580e63e98c9a982ac9b8b741") */ list(siteId: string, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise; private __list; /** * Create a Collection for a site with collection fields. * * Each collection includes the required _name_ and _slug_ fields, which are generated automatically. You can update the `displayName` of these fields, but the slug for them cannot be changed. Fields slugs are automatically converted to lowercase. Spaces in slugs are replaced with hyphens. * * Required scope | `cms:write` * * @param {string} siteId - Unique identifier for a Site * @param {Webflow.CollectionsCreateRequest} request * @param {Collections.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Webflow.BadRequestError} * @throws {@link Webflow.UnauthorizedError} * @throws {@link Webflow.NotFoundError} * @throws {@link Webflow.ConflictError} * @throws {@link Webflow.TooManyRequestsError} * @throws {@link Webflow.InternalServerError} * * @example * await client.collections.create("580e63e98c9a982ac9b8b741", { * displayName: "Blog Posts", * singularName: "Blog Post", * slug: "posts", * fields: [{ * isRequired: true, * type: "PlainText", * displayName: "Title", * helpText: "The title of the blog post" * }, { * isRequired: true, * type: "RichText", * displayName: "Content", * helpText: "The content of the blog post" * }, { * isRequired: true, * type: "Reference", * displayName: "Author", * helpText: "The author of the blog post", * metadata: { * collectionId: "23cc2d952d4e4631ffd4345d2743db4e" * } * }] * }) */ create(siteId: string, request: Webflow.CollectionsCreateRequest, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise; private __create; /** * Get the full details of a collection from its ID. * * Required scope | `cms:read` * * @param {string} collectionId - Unique identifier for a Collection * @param {Collections.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Webflow.BadRequestError} * @throws {@link Webflow.UnauthorizedError} * @throws {@link Webflow.NotFoundError} * @throws {@link Webflow.TooManyRequestsError} * @throws {@link Webflow.InternalServerError} * * @example * await client.collections.get("580e63fc8c9a982ac9b8b745") */ get(collectionId: string, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise; private __get; /** * Delete a collection using its ID. * * Required scope | `cms:write` * * @param {string} collectionId - Unique identifier for a Collection * @param {Collections.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Webflow.BadRequestError} * @throws {@link Webflow.UnauthorizedError} * @throws {@link Webflow.NotFoundError} * @throws {@link Webflow.TooManyRequestsError} * @throws {@link Webflow.InternalServerError} * * @example * await client.collections.delete("580e63fc8c9a982ac9b8b745") */ delete(collectionId: string, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise; private __delete; protected _getAuthorizationHeader(): Promise; }