attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
100 lines • 4.68 kB
JavaScript
;
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.Entries = void 0;
const entriesAssert_js_1 = require("../funcs/entriesAssert.js");
const entriesCreate_js_1 = require("../funcs/entriesCreate.js");
const entriesDelete_js_1 = require("../funcs/entriesDelete.js");
const entriesGetEntry_js_1 = require("../funcs/entriesGetEntry.js");
const entriesOverwrite_js_1 = require("../funcs/entriesOverwrite.js");
const entriesQuery_js_1 = require("../funcs/entriesQuery.js");
const entriesUpdate_js_1 = require("../funcs/entriesUpdate.js");
const sdks_js_1 = require("../lib/sdks.js");
const fp_js_1 = require("../types/fp.js");
const entriesattributes_js_1 = require("./entriesattributes.js");
class Entries extends sdks_js_1.ClientSDK {
get attributes() {
return (this._attributes ?? (this._attributes = new entriesattributes_js_1.EntriesAttributes(this._options)));
}
/**
* List entries
*
* @remarks
* Lists entries in a given list, with the option to filter and sort results.
*
* Required scopes: `list_entry:read`, `list_configuration:read`.
*/
async query(request, options) {
return (0, fp_js_1.unwrapAsync)((0, entriesQuery_js_1.entriesQuery)(this, request, options));
}
/**
* Create an entry (add record to list)
*
* @remarks
* Adds a record to a list as a new list entry. This endpoint will throw on conflicts of unique attributes. Multiple list entries are allowed for the same parent record
*
* Required scopes: `list_entry:read-write`, `list_configuration:read`.
*/
async create(request, options) {
return (0, fp_js_1.unwrapAsync)((0, entriesCreate_js_1.entriesCreate)(this, request, options));
}
/**
* Assert a list entry by parent
*
* @remarks
* Use this endpoint to create or update a list entry for a given parent record. If an entry with the specified parent record is found, that entry will be updated. If no such entry is found, a new entry will be created instead. If there are multiple entries with the same parent record, this endpoint with return the "MULTIPLE_MATCH_RESULTS" error. When writing to multi-select attributes, all values will be either created or deleted as necessary to match the list of values supplied in the request body.
*
* Required scopes: `list_entry:read-write`, `list_configuration:read`.
*/
async assert(request, options) {
return (0, fp_js_1.unwrapAsync)((0, entriesAssert_js_1.entriesAssert)(this, request, options));
}
/**
* Get a list entry
*
* @remarks
* Gets a single list entry by its `entry_id`.
*
* Required scopes: `list_entry:read`, `list_configuration:read`.
*/
async getEntry(request, options) {
return (0, fp_js_1.unwrapAsync)((0, entriesGetEntry_js_1.entriesGetEntry)(this, request, options));
}
/**
* Update a list entry (append multiselect values)
*
* @remarks
* Use this endpoint to update list entries by `entry_id`. If the update payload includes multiselect attributes, the values supplied will be created and prepended to the list of values that already exist (if any). Use the `PUT` endpoint to overwrite or remove multiselect attribute values.
*
* Required scopes: `list_entry:read-write`, `list_configuration:read`.
*/
async update(request, options) {
return (0, fp_js_1.unwrapAsync)((0, entriesUpdate_js_1.entriesUpdate)(this, request, options));
}
/**
* Update a list entry (overwrite multiselect values)
*
* @remarks
* Use this endpoint to update list entries by `entry_id`. If the update payload includes multiselect attributes, the values supplied will overwrite/remove the list of values that already exist (if any). Use the `PATCH` endpoint to add multiselect attribute values without removing those value that already exist.
*
* Required scopes: `list_entry:read-write`, `list_configuration:read`.
*/
async overwrite(request, options) {
return (0, fp_js_1.unwrapAsync)((0, entriesOverwrite_js_1.entriesOverwrite)(this, request, options));
}
/**
* Delete a list entry
*
* @remarks
* Deletes a single list entry by its `entry_id`.
*
* Required scopes: `list_entry:read-write`, `list_configuration:read`.
*/
async delete(request, options) {
return (0, fp_js_1.unwrapAsync)((0, entriesDelete_js_1.entriesDelete)(this, request, options));
}
}
exports.Entries = Entries;
//# sourceMappingURL=entries.js.map