attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
66 lines • 3.44 kB
JavaScript
;
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.Lists = void 0;
const listsCreate_js_1 = require("../funcs/listsCreate.js");
const listsGet_js_1 = require("../funcs/listsGet.js");
const listsListAll_js_1 = require("../funcs/listsListAll.js");
const listsUpdate_js_1 = require("../funcs/listsUpdate.js");
const sdks_js_1 = require("../lib/sdks.js");
const fp_js_1 = require("../types/fp.js");
class Lists extends sdks_js_1.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 (0, fp_js_1.unwrapAsync)((0, listsListAll_js_1.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 (0, fp_js_1.unwrapAsync)((0, listsCreate_js_1.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 (0, fp_js_1.unwrapAsync)((0, listsGet_js_1.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 (0, fp_js_1.unwrapAsync)((0, listsUpdate_js_1.listsUpdate)(this, request, options));
}
}
exports.Lists = Lists;
//# sourceMappingURL=lists.js.map