attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
110 lines • 3.8 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { attributesCreate } from "../funcs/attributesCreate.js";
import { attributesCreateSelectOption } from "../funcs/attributesCreateSelectOption.js";
import { attributesGet } from "../funcs/attributesGet.js";
import { attributesList } from "../funcs/attributesList.js";
import { attributesListSelectOptions } from "../funcs/attributesListSelectOptions.js";
import { attributesListStatuses } from "../funcs/attributesListStatuses.js";
import { attributesUpdate } from "../funcs/attributesUpdate.js";
import { attributesUpdateOption } from "../funcs/attributesUpdateOption.js";
import { ClientSDK } from "../lib/sdks.js";
import { unwrapAsync } from "../types/fp.js";
import { Statuses } from "./statuses.js";
export class Attributes extends ClientSDK {
get statuses() {
return (this._statuses ?? (this._statuses = new 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 unwrapAsync(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 unwrapAsync(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 unwrapAsync(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 unwrapAsync(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 unwrapAsync(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 unwrapAsync(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 unwrapAsync(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 unwrapAsync(attributesListStatuses(this, request, options));
}
}
//# sourceMappingURL=attributes.js.map