attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
89 lines (84 loc) • 2.48 kB
text/typescript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { commentsCreate } from "../funcs/commentsCreate.js";
import { commentsDelete } from "../funcs/commentsDelete.js";
import { commentsGet } from "../funcs/commentsGet.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import {
DeleteV2CommentsCommentIdRequest,
DeleteV2CommentsCommentIdResponse,
} from "../models/operations/deletev2commentscommentid.js";
import {
GetV2CommentsCommentIdRequest,
GetV2CommentsCommentIdResponse,
} from "../models/operations/getv2commentscommentid.js";
import {
PostV2CommentsRequest,
PostV2CommentsResponse,
} from "../models/operations/postv2comments.js";
import { unwrapAsync } from "../types/fp.js";
export class Comments extends ClientSDK {
/**
* Create a comment
*
* @remarks
* Creates a new comment related to an existing thread, record or entry.
*
* To create comments on records, you will need the `object_configuration:read` and `record_permission:read` scopes.
*
* To create comments on list entries, you will need the `list_configuration:read` and `list_entry:read` scopes.
*
* Required scopes: `comment:read-write`.
*/
async create(
request: PostV2CommentsRequest,
options?: RequestOptions,
): Promise<PostV2CommentsResponse> {
return unwrapAsync(commentsCreate(
this,
request,
options,
));
}
/**
* Get a comment
*
* @remarks
* Get a single comment by ID.
*
* To view comments on records, you will need the `object_configuration:read` and `record_permission:read` scopes.
*
* To view comments on list entries, you will need the `list_configuration:read` and `list_entry:read` scopes.
*
* Required scopes: `comment:read`.
*/
async get(
request: GetV2CommentsCommentIdRequest,
options?: RequestOptions,
): Promise<GetV2CommentsCommentIdResponse> {
return unwrapAsync(commentsGet(
this,
request,
options,
));
}
/**
* Delete a comment
*
* @remarks
* Deletes a comment by ID. If deleting a comment at the head of a thread, all messages in the thread are also deleted.
*
* Required scopes: `comment:read-write`.
*/
async delete(
request: DeleteV2CommentsCommentIdRequest,
options?: RequestOptions,
): Promise<DeleteV2CommentsCommentIdResponse> {
return unwrapAsync(commentsDelete(
this,
request,
options,
));
}
}