UNPKG

attio-js

Version:

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

105 lines (99 loc) 2.4 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { notesCreate } from "../funcs/notesCreate.js"; import { notesDelete } from "../funcs/notesDelete.js"; import { notesGet } from "../funcs/notesGet.js"; import { notesList } from "../funcs/notesList.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { DeleteV2NotesNoteIdRequest, DeleteV2NotesNoteIdResponse, } from "../models/operations/deletev2notesnoteid.js"; import { GetV2NotesRequest, GetV2NotesResponse, } from "../models/operations/getv2notes.js"; import { GetV2NotesNoteIdRequest, GetV2NotesNoteIdResponse, } from "../models/operations/getv2notesnoteid.js"; import { PostV2NotesRequest, PostV2NotesResponse, } from "../models/operations/postv2notes.js"; import { unwrapAsync } from "../types/fp.js"; export class Notes extends ClientSDK { /** * List notes * * @remarks * List notes for all records or for a specific record. * * Required scopes: `note:read`, `object_configuration:read`, `record_permission:read`. */ async list( request: GetV2NotesRequest, options?: RequestOptions, ): Promise<GetV2NotesResponse> { return unwrapAsync(notesList( this, request, options, )); } /** * Create a note * * @remarks * Creates a new note for a given record. * * Required scopes: `note:read-write`, `object_configuration:read`, `record_permission:read`. */ async create( request: PostV2NotesRequest, options?: RequestOptions, ): Promise<PostV2NotesResponse> { return unwrapAsync(notesCreate( this, request, options, )); } /** * Get a note * * @remarks * Get a single note by ID. * * Required scopes: `note:read`, `object_configuration:read`, `record_permission:read`. */ async get( request: GetV2NotesNoteIdRequest, options?: RequestOptions, ): Promise<GetV2NotesNoteIdResponse> { return unwrapAsync(notesGet( this, request, options, )); } /** * Delete a note * * @remarks * Delete a single note by ID. * * Required scopes: `note:read-write`. */ async delete( request: DeleteV2NotesNoteIdRequest, options?: RequestOptions, ): Promise<DeleteV2NotesNoteIdResponse> { return unwrapAsync(notesDelete( this, request, options, )); } }