intercom-client
Version:
Official Node bindings to the Intercom API
113 lines (112 loc) • 4.1 kB
text/typescript
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
import * as core from "../../../../core/index.mjs";
import * as Intercom from "../../../index.mjs";
export declare namespace DataAttributesClient {
interface Options extends BaseClientOptions {
}
interface RequestOptions extends BaseRequestOptions {
}
}
/**
* Everything about your Data Attributes
*/
export declare class DataAttributesClient {
protected readonly _options: NormalizedClientOptionsWithAuth<DataAttributesClient.Options>;
constructor(options?: DataAttributesClient.Options);
/**
* You can fetch a list of all data attributes belonging to a workspace for contacts, companies or conversations.
*
* @param {Intercom.ListDataAttributesRequest} request
* @param {DataAttributesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Intercom.UnauthorizedError}
*
* @example
* await client.dataAttributes.list({
* model: "contact",
* include_archived: true
* })
*/
list(request?: Intercom.ListDataAttributesRequest, requestOptions?: DataAttributesClient.RequestOptions): core.HttpResponsePromise<Intercom.DataAttributeList>;
private __list;
/**
* You can create a data attributes for a `contact` or a `company`.
*
* @param {Intercom.CreateDataAttributeRequest} request
* @param {DataAttributesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Intercom.BadRequestError}
* @throws {@link Intercom.UnauthorizedError}
*
* @example
* await client.dataAttributes.create({
* data_type: "string"
* })
*
* @example
* await client.dataAttributes.create({
* data_type: "integer"
* })
*
* @example
* await client.dataAttributes.create({
* options: [{
* value: "1-10"
* }]
* })
*/
create(request: Intercom.CreateDataAttributeRequest, requestOptions?: DataAttributesClient.RequestOptions): core.HttpResponsePromise<Intercom.DataAttribute>;
private __create;
/**
*
* You can update a data attribute.
*
* > 🚧 Updating the data type is not possible
* >
* > It is currently a dangerous action to execute changing a data attribute's type via the API. You will need to update the type via the UI instead.
*
* @param {Intercom.UpdateDataAttributeRequest} request
* @param {DataAttributesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Intercom.BadRequestError}
* @throws {@link Intercom.UnauthorizedError}
* @throws {@link Intercom.NotFoundError}
* @throws {@link Intercom.UnprocessableEntityError}
*
* @example
* await client.dataAttributes.update({
* data_attribute_id: 1,
* body: {
* options: [{
* value: "1-10"
* }, {
* value: "11-20"
* }]
* }
* })
*
* @example
* await client.dataAttributes.update({
* data_attribute_id: 1,
* body: {
* options: [{
* value: "1-10"
* }, {
* value: "11-50"
* }]
* }
* })
*
* @example
* await client.dataAttributes.update({
* data_attribute_id: 1,
* body: {
* "description": "Trying to archieve",
* "archived": true
* }
* })
*/
update(request: Intercom.UpdateDataAttributeRequest, requestOptions?: DataAttributesClient.RequestOptions): core.HttpResponsePromise<Intercom.DataAttribute>;
private __update;
}