/** * This file was auto-generated by Fern from our API Definition. */ import * as environments from "../../../../environments"; import * as core from "../../../../core"; import * as Flatfile from "../../../index"; export declare namespace Views { interface Options { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; token?: core.Supplier; /** Override the X-Disable-Hooks header */ xDisableHooks?: "true"; fetcher?: core.FetchFunction; } interface RequestOptions { /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the X-Disable-Hooks header */ xDisableHooks?: "true"; /** Additional headers to include in the request. */ headers?: Record; } } export declare class Views { protected readonly _options: Views.Options; constructor(_options?: Views.Options); /** * Returns all views for the sheet * * @param {Flatfile.ListViewsRequest} request * @param {Views.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.views.list({ * sheetId: "us_sh_YOUR_ID" * }) */ list(request: Flatfile.ListViewsRequest, requestOptions?: Views.RequestOptions): core.HttpResponsePromise; private __list; /** * Add a new view to the space * * @param {Flatfile.ViewCreate} request * @param {Views.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.views.create({ * sheetId: "us_sh_YOUR_ID", * name: "My View", * config: { * filter: "error", * filterField: "email", * q: "firstname like %John%", * sortField: "email", * sortDirection: "asc" * } * }) */ create(request: Flatfile.ViewCreate, requestOptions?: Views.RequestOptions): core.HttpResponsePromise; private __create; /** * Returns a single view * * @param {Flatfile.ViewId} viewId - ID of view to return * @param {Views.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.views.get("us_vi_YOUR_ID") */ get(viewId: Flatfile.ViewId, requestOptions?: Views.RequestOptions): core.HttpResponsePromise; private __get; /** * Updates a single view * * @param {Flatfile.ViewId} viewId - ID of view to update * @param {Flatfile.ViewUpdate} request * @param {Views.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.views.update("us_vi_YOUR_ID", { * name: "My View", * config: { * filter: "error", * filterField: "email", * q: "firstname like %John%", * sortField: "email", * sortDirection: "asc" * } * }) */ update(viewId: Flatfile.ViewId, request: Flatfile.ViewUpdate, requestOptions?: Views.RequestOptions): core.HttpResponsePromise; private __update; /** * Deletes a single view * * @param {Flatfile.ViewId} viewId - ID of view to delete * @param {Views.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.views.delete("us_vi_YOUR_ID") */ delete(viewId: Flatfile.ViewId, requestOptions?: Views.RequestOptions): core.HttpResponsePromise; private __delete; protected _getAuthorizationHeader(): Promise; }