attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
96 lines • 4.22 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { entriesAssert } from "../funcs/entriesAssert.js";
import { entriesCreate } from "../funcs/entriesCreate.js";
import { entriesDelete } from "../funcs/entriesDelete.js";
import { entriesGetEntry } from "../funcs/entriesGetEntry.js";
import { entriesOverwrite } from "../funcs/entriesOverwrite.js";
import { entriesQuery } from "../funcs/entriesQuery.js";
import { entriesUpdate } from "../funcs/entriesUpdate.js";
import { ClientSDK } from "../lib/sdks.js";
import { unwrapAsync } from "../types/fp.js";
import { EntriesAttributes } from "./entriesattributes.js";
export class Entries extends ClientSDK {
get attributes() {
return (this._attributes ?? (this._attributes = new 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 unwrapAsync(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 unwrapAsync(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 unwrapAsync(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 unwrapAsync(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 unwrapAsync(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 unwrapAsync(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 unwrapAsync(entriesDelete(this, request, options));
}
}
//# sourceMappingURL=entries.js.map