import { inspect, InspectOptions } from "util"; import TokenPage, { TokenPaginationPayload } from "../../../base/TokenPage"; import Response from "../../../http/response"; import V3 from "../V3"; import { ApiResponse } from "../../../base/ApiResponse"; /** * Registration payload for a single custom field. The mapping is created in the account identified by the request\'s credentials. */ export declare class CustomFieldMappingRequest { "category": MappingCategory; /** * Name of the custom field, used to reference it in Insights queries. Contains only letters, digits and `_`, and must not be empty. Must be unique within the account across every `sourceType`; registering an existing name returns `409`. Cannot be changed after registration. */ "name": string; /** * Optional, free-text description of this custom field mapping, up to 150 characters. Display-only — not part of any uniqueness check. */ "description"?: string; "entityMetadata": EntityMetadata; constructor(payload: any); } /** * Partial update of a custom field mapping. Only properties present in the body are changed; absent properties keep their current value. The body must contain at least one change: an empty body is rejected with `400`. Properties that cannot be updated (such as `name`, `category` or `operatorId`) are rejected with `400` rather than ignored. */ export declare class CustomFieldMappingUpdateRequest { "entityMetadata"?: EntityMetadataUpdate; constructor(payload: any); } /** * Identifies the entity that supplies this field\'s value. `sourceType` selects the source, and the property named for that source carries its details. Exactly that one source property must be present: | `sourceType` | Required property | |---|---| | `INTELLIGENCE_OPERATOR` | `intelligenceOperator` | A request whose `sourceType` doesn\'t match the source property it sends, or that sends any other property, is rejected with `400`. */ export declare class EntityMetadata { "sourceType": SourceType; "intelligenceOperator"?: IntelligenceOperatorSource; constructor(payload: any); } /** * Updatable subset of `entityMetadata`. `sourceType` must equal the mapping\'s current `sourceType` (it cannot be changed), and the property named for that source carries the fields to update: | `sourceType` | Update property | Updatable fields | |---|---|---| | `INTELLIGENCE_OPERATOR` | `intelligenceOperator` | `field` | */ export declare class EntityMetadataUpdate { "sourceType": SourceType; "intelligenceOperator"?: IntelligenceOperatorSourceUpdate; constructor(payload: any); } /** * Details of a custom field whose value is read from a Conversational Intelligence operator\'s output. The operator must: - have an active version; - have `outputFormat` `JSON` (`TEXT` and `CLASSIFICATION` operators are rejected). Requests that reference an ineligible operator are rejected with `400`. */ export declare class IntelligenceOperatorSource { /** * The ID of the Conversational Intelligence operator whose output supplies this field\'s value. Must match `^intelligence_operator_[0-7][0-9a-z]{25}$`. Cannot be changed after registration. */ "operatorId": string; /** * Optional, display-only name of the operator. Stored as supplied and not validated against the operator. */ "operatorName"?: string; /** * Path to the property in the operator\'s output schema that supplies this field\'s value. Rules: - one or two segments separated by `.` — a top-level property (`leadScore`) or one level of nesting (`scores.leadScore`); - each segment contains only letters, digits and `_`; array indexing (such as `items[0]`) is not supported; - the path must exist in the output schema of the operator\'s latest active version and resolve to a property of type `number` or `integer`. */ "field": string; constructor(payload: any); } /** * Updatable fields of a custom field mapping sourced from a Conversational Intelligence operator. At least one field must be present. Currently only `field` can be modified; `operatorId` and `operatorName` cannot be updated. */ export declare class IntelligenceOperatorSourceUpdate { /** * New path to the property in the operator\'s output schema. Follows the same rules as `field` at registration: one or two `.`-separated segments of letters, digits and `_`, resolving to a `number` or `integer` property on the operator\'s latest active version. */ "field"?: string; constructor(payload: any); } /** * The category of the custom field. Supported values: - `MEASURE`: a numeric value that can be aggregated and queried as a measure in Conversations Insights. */ export type MappingCategory = "MEASURE"; /** * The kind of entity that supplies the custom field\'s value. Each value has a matching property on `entityMetadata` that carries that source\'s details. Supported values: - `INTELLIGENCE_OPERATOR`: the value is read from the output of a Conversational Intelligence operator. Details go in `entityMetadata.intelligenceOperator`. */ export type SourceType = "INTELLIGENCE_OPERATOR"; /** * Options to pass to patch a CustomFieldMappingInstance */ export interface CustomFieldMappingContextPatchOptions { /** */ customFieldMappingUpdateRequest: CustomFieldMappingUpdateRequest; /** ETag of the custom field mapping, as returned in the `ETag` response header. When supplied, the update is applied only if the mapping has not changed since that ETag was issued; otherwise `412` is returned. */ ifMatch?: string; } /** * Options to pass to create a CustomFieldMappingInstance */ export interface CustomFieldMappingListInstanceCreateOptions { /** */ customFieldMappingRequest: CustomFieldMappingRequest; } /** * Options to pass to each */ export interface CustomFieldMappingListInstanceEachOptions { /** The maximum number of resources to return */ pageSize?: number; /** Token for pagination */ pageToken?: string; /** Function to process each record. If this and a positional callback are passed, this one will be used */ callback?: (item: CustomFieldMappingInstance, done: (err?: Error) => void) => void; /** Function to be called upon completion of streaming */ done?: Function; /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ limit?: number; } /** * Options to pass to list */ export interface CustomFieldMappingListInstanceOptions { /** The maximum number of resources to return */ pageSize?: number; /** Token for pagination */ pageToken?: string; /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ limit?: number; } /** * Options to pass to page */ export interface CustomFieldMappingListInstancePageOptions { /** The maximum number of resources to return */ pageSize?: number; /** Token for pagination */ pageToken?: string; } export interface CustomFieldMappingContext { /** * Fetch a CustomFieldMappingInstance * * @param callback - Callback to handle processed record * * @returns Resolves to processed CustomFieldMappingInstance */ fetch(callback?: (error: Error | null, item?: CustomFieldMappingInstance) => any): Promise; /** * Fetch a CustomFieldMappingInstance and return HTTP info * * @param callback - Callback to handle processed record * * @returns Resolves to processed CustomFieldMappingInstance with HTTP metadata */ fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse) => any): Promise>; /** * Patch a CustomFieldMappingInstance * * @param params - Body for request * @param headers - header params for request * @param callback - Callback to handle processed record * * @returns Resolves to processed CustomFieldMappingInstance */ patch(params: CustomFieldMappingUpdateRequest, headers?: any, callback?: (error: Error | null, item?: CustomFieldMappingInstance) => any): Promise; /** * Patch a CustomFieldMappingInstance and return HTTP info * * @param params - Body for request * @param headers - header params for request * @param callback - Callback to handle processed record * * @returns Resolves to processed CustomFieldMappingInstance with HTTP metadata */ patchWithHttpInfo(params: CustomFieldMappingUpdateRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse) => any): Promise>; /** * Provide a user-friendly representation */ toJSON(): any; [inspect.custom](_depth: any, options: InspectOptions): any; } export interface CustomFieldMappingContextSolution { mappingId: string; } export declare class CustomFieldMappingContextImpl implements CustomFieldMappingContext { protected _version: V3; protected _solution: CustomFieldMappingContextSolution; protected _uri: string; constructor(_version: V3, mappingId: string); fetch(callback?: (error: Error | null, item?: CustomFieldMappingInstance) => any): Promise; fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse) => any): Promise>; patch(params: CustomFieldMappingUpdateRequest, headers?: any, callback?: (error: Error | null, item?: CustomFieldMappingInstance) => any): Promise; patchWithHttpInfo(params: CustomFieldMappingUpdateRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse) => any): Promise>; /** * Provide a user-friendly representation * * @returns Object */ toJSON(): CustomFieldMappingContextSolution; [inspect.custom](_depth: any, options: InspectOptions): string; } interface CustomFieldMappingPayload extends TokenPaginationPayload { items: CustomFieldMappingResource[]; } interface CustomFieldMappingResource { id: string; category: MappingCategory; name: string; description: string; entityMetadata: EntityMetadata; createdAt: Date; updatedAt: Date; } /** * A registered custom field mapping. */ export declare class CustomFieldMappingInstance { protected _version: V3; protected _solution: CustomFieldMappingContextSolution; protected _context?: CustomFieldMappingContext; constructor(_version: V3, _payload: CustomFieldMappingResource, mappingId?: string); /** * The unique identifier of the custom field mapping. */ id: string; category: MappingCategory; /** * Name of the custom field, unique within the account. */ name: string; /** * Optional, free-text description supplied at registration time. Display-only — not part of any uniqueness check. */ description: string; entityMetadata: EntityMetadata; /** * When the mapping was registered. */ createdAt: Date; /** * When the mapping was last modified via `PATCH`. Null until the first update. */ updatedAt: Date; private get _proxy(); /** * Fetch a CustomFieldMappingInstance * * @param callback - Callback to handle processed record * * @returns Resolves to processed CustomFieldMappingInstance */ fetch(callback?: (error: Error | null, item?: CustomFieldMappingInstance) => any): Promise; /** * Fetch a CustomFieldMappingInstance and return HTTP info * * @param callback - Callback to handle processed record * * @returns Resolves to processed CustomFieldMappingInstance with HTTP metadata */ fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse) => any): Promise>; /** * Patch a CustomFieldMappingInstance * * @param params - Body for request * @param headers - header params for request * @param callback - Callback to handle processed record * * @returns Resolves to processed CustomFieldMappingInstance */ patch(params: CustomFieldMappingUpdateRequest, headers?: any, callback?: (error: Error | null, item?: CustomFieldMappingInstance) => any): Promise; /** * Patch a CustomFieldMappingInstance and return HTTP info * * @param params - Body for request * @param headers - header params for request * @param callback - Callback to handle processed record * * @returns Resolves to processed CustomFieldMappingInstance with HTTP metadata */ patchWithHttpInfo(params: CustomFieldMappingUpdateRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse) => any): Promise>; /** * Provide a user-friendly representation * * @returns Object */ toJSON(): { id: string; category: "MEASURE"; name: string; description: string; entityMetadata: EntityMetadata; createdAt: Date; updatedAt: Date; }; [inspect.custom](_depth: any, options: InspectOptions): string; } export interface CustomFieldMappingSolution { } export interface CustomFieldMappingListInstance { _version: V3; _solution: CustomFieldMappingSolution; _uri: string; (mappingId: string): CustomFieldMappingContext; get(mappingId: string): CustomFieldMappingContext; /** * Create a CustomFieldMappingInstance * * @param params - Body for request * @param headers - header params for request * @param callback - Callback to handle processed record * * @returns Resolves to processed CustomFieldMappingInstance */ create(params: CustomFieldMappingRequest, headers?: any, callback?: (error: Error | null, item?: CustomFieldMappingInstance) => any): Promise; /** * Create a CustomFieldMappingInstance and return HTTP info * * @param params - Body for request * @param headers - header params for request * @param callback - Callback to handle processed record * * @returns Resolves to processed CustomFieldMappingInstance with HTTP metadata */ createWithHttpInfo(params: CustomFieldMappingRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse) => any): Promise>; /** * Streams CustomFieldMappingInstance records from the API. * * This operation lazily loads records as efficiently as possible until the limit * is reached. * * The results are passed into the callback function, so this operation is memory * efficient. * * If a function is passed as the first argument, it will be used as the callback * function. * * @param { CustomFieldMappingListInstanceEachOptions } [params] - Options for request * @param { function } [callback] - Function to process each record */ each(callback?: (item: CustomFieldMappingInstance, done: (err?: Error) => void) => void): void; each(params: CustomFieldMappingListInstanceEachOptions, callback?: (item: CustomFieldMappingInstance, done: (err?: Error) => void) => void): void; /** * Streams CustomFieldMappingInstance records from the API with HTTP metadata captured per page. * * This operation lazily loads records as efficiently as possible until the limit * is reached. HTTP metadata (status code, headers) is captured for each page request. * * The results are passed into the callback function, so this operation is memory * efficient. * * If a function is passed as the first argument, it will be used as the callback * function. * * @param { CustomFieldMappingListInstanceEachOptions } [params] - Options for request * @param { function } [callback] - Function to process each record */ eachWithHttpInfo(callback?: (item: CustomFieldMappingInstance, done: (err?: Error) => void) => void): void; eachWithHttpInfo(params: CustomFieldMappingListInstanceEachOptions, callback?: (item: CustomFieldMappingInstance, done: (err?: Error) => void) => void): void; /** * Retrieve a single target page of CustomFieldMappingInstance records from the API. * * The request is executed immediately. * * @param { string } [targetUrl] - API-generated URL for the requested results page * @param { function } [callback] - Callback to handle list of records */ getPage(targetUrl: string, callback?: (error: Error | null, items: CustomFieldMappingPage) => any): Promise; /** * Retrieve a single target page of CustomFieldMappingInstance records from the API with HTTP metadata. * * The request is executed immediately. * * @param { string } [targetUrl] - API-generated URL for the requested results page * @param { function } [callback] - Callback to handle list of records with metadata */ getPageWithHttpInfo(targetUrl: string, callback?: (error: Error | null, items: ApiResponse) => any): Promise>; /** * Lists CustomFieldMappingInstance records from the API as a list. * * If a function is passed as the first argument, it will be used as the callback * function. * * @param { CustomFieldMappingListInstanceOptions } [params] - Options for request * @param { function } [callback] - Callback to handle list of records */ list(callback?: (error: Error | null, items: CustomFieldMappingInstance[]) => any): Promise; list(params: CustomFieldMappingListInstanceOptions, callback?: (error: Error | null, items: CustomFieldMappingInstance[]) => any): Promise; /** * Lists CustomFieldMappingInstance records from the API as a list with HTTP metadata. * * Returns all records along with HTTP metadata from the first page fetched. * * If a function is passed as the first argument, it will be used as the callback * function. * * @param { CustomFieldMappingListInstanceOptions } [params] - Options for request * @param { function } [callback] - Callback to handle list of records with metadata */ listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse) => any): Promise>; listWithHttpInfo(params: CustomFieldMappingListInstanceOptions, callback?: (error: Error | null, items: ApiResponse) => any): Promise>; /** * Retrieve a single page of CustomFieldMappingInstance records from the API. * * The request is executed immediately. * * If a function is passed as the first argument, it will be used as the callback * function. * * @param { CustomFieldMappingListInstancePageOptions } [params] - Options for request * @param { function } [callback] - Callback to handle list of records */ page(callback?: (error: Error | null, items: CustomFieldMappingPage) => any): Promise; page(params: CustomFieldMappingListInstancePageOptions, callback?: (error: Error | null, items: CustomFieldMappingPage) => any): Promise; /** * Retrieve a single page of CustomFieldMappingInstance records from the API with HTTP metadata. * * The request is executed immediately. * * If a function is passed as the first argument, it will be used as the callback * function. * * @param { CustomFieldMappingListInstancePageOptions } [params] - Options for request * @param { function } [callback] - Callback to handle list of records with metadata */ pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse) => any): Promise>; pageWithHttpInfo(params: CustomFieldMappingListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse) => any): Promise>; /** * Provide a user-friendly representation */ toJSON(): any; [inspect.custom](_depth: any, options: InspectOptions): any; } export declare function CustomFieldMappingListInstance(version: V3): CustomFieldMappingListInstance; export declare class CustomFieldMappingPage extends TokenPage { /** * Initialize the CustomFieldMappingPage * * @param version - Version of the resource * @param response - Response from the API * @param uri - URI of the resource * @param params - Query parameters * @param solution - Path solution */ constructor(version: V3, response: Response, uri: string, params: any, solution: CustomFieldMappingSolution); /** * Build an instance of CustomFieldMappingInstance * * @param payload - Payload response from the API */ getInstance(payload: CustomFieldMappingResource): CustomFieldMappingInstance; [inspect.custom](depth: any, options: InspectOptions): string; } export {};