UNPKG

attio-js

Version:

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

114 lines 4.36 kB
"use strict"; /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.Attributes = void 0; const attributesCreate_js_1 = require("../funcs/attributesCreate.js"); const attributesCreateSelectOption_js_1 = require("../funcs/attributesCreateSelectOption.js"); const attributesGet_js_1 = require("../funcs/attributesGet.js"); const attributesList_js_1 = require("../funcs/attributesList.js"); const attributesListSelectOptions_js_1 = require("../funcs/attributesListSelectOptions.js"); const attributesListStatuses_js_1 = require("../funcs/attributesListStatuses.js"); const attributesUpdate_js_1 = require("../funcs/attributesUpdate.js"); const attributesUpdateOption_js_1 = require("../funcs/attributesUpdateOption.js"); const sdks_js_1 = require("../lib/sdks.js"); const fp_js_1 = require("../types/fp.js"); const statuses_js_1 = require("./statuses.js"); class Attributes extends sdks_js_1.ClientSDK { get statuses() { return (this._statuses ?? (this._statuses = new statuses_js_1.Statuses(this._options))); } /** * List attributes * * @remarks * Lists all attributes defined on a specific object or list. Attributes are returned in the order that they are sorted by in the UI. * * Required scopes: `object_configuration:read`. */ async list(request, options) { return (0, fp_js_1.unwrapAsync)((0, attributesList_js_1.attributesList)(this, request, options)); } /** * Create an attribute * * @remarks * Creates a new attribute on either an object or a list. * * To create an attribute on an object, you must also have the `object_configuration:read-write` scope. * * To create an attribute on a list, you must also have the `list_configuration:read-write` scope. */ async create(request, options) { return (0, fp_js_1.unwrapAsync)((0, attributesCreate_js_1.attributesCreate)(this, request, options)); } /** * Get an attribute * * @remarks * Gets information about a single attribute on either an object or a list. * * Required scopes: `object_configuration:read`. */ async get(request, options) { return (0, fp_js_1.unwrapAsync)((0, attributesGet_js_1.attributesGet)(this, request, options)); } /** * Update an attribute * * @remarks * Updates a single attribute on a given object or list. * * Required scopes: `object_configuration:read-write`. */ async update(request, options) { return (0, fp_js_1.unwrapAsync)((0, attributesUpdate_js_1.attributesUpdate)(this, request, options)); } /** * List select options * * @remarks * Lists all select options for a particular attribute on either an object or a list. * * Required scopes: `object_configuration:read`. */ async listSelectOptions(request, options) { return (0, fp_js_1.unwrapAsync)((0, attributesListSelectOptions_js_1.attributesListSelectOptions)(this, request, options)); } /** * Create a select option * * @remarks * Adds a select option to a select attribute on an object or a list. * * Required scopes: `object_configuration:read-write`. */ async createSelectOption(request, options) { return (0, fp_js_1.unwrapAsync)((0, attributesCreateSelectOption_js_1.attributesCreateSelectOption)(this, request, options)); } /** * Update a select option * * @remarks * Updates a select option on an attribute on either an object or a list. * * Required scopes: `object_configuration:read-write`. */ async updateOption(request, options) { return (0, fp_js_1.unwrapAsync)((0, attributesUpdateOption_js_1.attributesUpdateOption)(this, request, options)); } /** * List statuses * * @remarks * Lists all statuses for a particular status attribute on either an object or a list. * * Required scopes: `object_configuration:read`. */ async listStatuses(request, options) { return (0, fp_js_1.unwrapAsync)((0, attributesListStatuses_js_1.attributesListStatuses)(this, request, options)); } } exports.Attributes = Attributes; //# sourceMappingURL=attributes.js.map