UNPKG

attio-js

Version:

Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.

62 lines 3.15 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { listsCreate } from "../funcs/listsCreate.js"; import { listsGet } from "../funcs/listsGet.js"; import { listsListAll } from "../funcs/listsListAll.js"; import { listsUpdate } from "../funcs/listsUpdate.js"; import { ClientSDK } from "../lib/sdks.js"; import { unwrapAsync } from "../types/fp.js"; export class Lists extends ClientSDK { /** * List all lists * * @remarks * List all lists that your access token has access to. lists are returned in the order that they are sorted in the sidebar. * * Required scopes: `list_configuration:read`. */ async listAll(options) { return unwrapAsync(listsListAll(this, options)); } /** * Create a list * * @remarks * Creates a new list. * * Once you have your list, add attributes to it using the [Create attribute](/reference/post_v2-target-identifier-attributes) API, and add records to it using the [Add records to list](/reference/post_v2-lists-list-entries) API. * * New lists must specify which records can be added with the `parent_object` parameter which accepts either an object slug or an object ID. Permissions for the list are controlled with the `workspace_access` and `workspace_member_access` parameters. * * Please note that new lists must have either `workspace_access` set to `"full-access"` or one or more element of `workspace_member_access` with a `"full-access"` level. It is also possible to receive a `403` billing error if your workspace is not on a plan that supports either advanced workspace or workspace member-level access for lists. * * Required scopes: `list_configuration:read-write`. */ async create(request, options) { return unwrapAsync(listsCreate(this, request, options)); } /** * Get a list * * @remarks * Gets a single list in your workspace that your access token has access to. * * Required scopes: `list_configuration:read`. */ async get(request, options) { return unwrapAsync(listsGet(this, request, options)); } /** * Update a list * * @remarks * Updates an existing list. Permissions for the list are controlled with the `workspace_access` and `workspace_member_access` parameters. Please note that lists must have either `workspace_access` set to `"full-access"` or one or more element of `workspace_member_access` with a `"full-access"` level. It is also possible to receive a `403` billing error if your workspace is not on a plan that supports either advanced workspace or workspace member level access for lists. Changing the parent object of a list is not possible through the API as it can have unintended side-effects that should be considered carefully. If you wish to carry out a parent object change you should do so through the UI. * * Required scopes: `list_configuration:read-write`. */ async update(request, options) { return unwrapAsync(listsUpdate(this, request, options)); } } //# sourceMappingURL=lists.js.map