Class v1.ContactCenterInsightsClient (3.8.0)

An API that lets users analyze and explore their business conversation data. v1

Package

@google-cloud/contact-center-insights

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of ContactCenterInsightsClient.

Parameters
Name Description
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new ContactCenterInsightsClient({fallback: true}, gax); ```

Properties

apiEndpoint

get apiEndpoint(): string;

The DNS address for this API service.

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath.

auth

auth: gax.GoogleAuth;

contactCenterInsightsStub

contactCenterInsightsStub?: Promise<{
        [name: string]: Function;
    }>;

descriptors

descriptors: Descriptors;

iamClient

iamClient: IamClient;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

operationsClient

operationsClient: gax.OperationsClient;

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

static get servicePath(): string;

The DNS address for this API service.

universeDomain

get universeDomain(): string;

warn

warn: (code: string, message: string, warnType?: string) => void;

Methods

analysisRulePath(project, location, analysisRule)

analysisRulePath(project: string, location: string, analysisRule: string): string;

Return a fully-qualified analysisRule resource name string.

Parameters
Name Description
project string
location string
analysisRule string
Returns
Type Description
string

{string} Resource name string.

bulkAnalyzeConversations(request, options)

bulkAnalyzeConversations(request?: protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Analyzes multiple conversations in a single request.

Parameters
Name Description
request IBulkAnalyzeConversationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The parent resource to create analyses in.
   */
  // const parent = 'abc123'
  /**
   *  Required. Filter used to select the subset of conversations to analyze.
   */
  // const filter = 'abc123'
  /**
   *  Required. Percentage of selected conversation to analyze, between
   *  0, 100.
   */
  // const analysisPercentage = 1234
  /**
   *  To select the annotators to run and the phrase matchers to use
   *  (if any). If not specified, all annotators will be run.
   */
  // const annotatorSelector = {}

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callBulkAnalyzeConversations() {
    // Construct request
    const request = {
      parent,
      filter,
      analysisPercentage,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.bulkAnalyzeConversations(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callBulkAnalyzeConversations();

bulkAnalyzeConversations(request, options, callback)

bulkAnalyzeConversations(request: protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IBulkAnalyzeConversationsRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

bulkAnalyzeConversations(request, callback)

bulkAnalyzeConversations(request: protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest, callback: Callback<LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IBulkAnalyzeConversationsRequest
callback Callback<LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

bulkDeleteConversations(request, options)

bulkDeleteConversations(request?: protos.google.cloud.contactcenterinsights.v1.IBulkDeleteConversationsRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkDeleteConversationsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkDeleteConversationsMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes multiple conversations in a single request.

Parameters
Name Description
request IBulkDeleteConversationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkDeleteConversationsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkDeleteConversationsMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The parent resource to delete conversations from.
   *  Format:
   *  projects/{project}/locations/{location}
   */
  // const parent = 'abc123'
  /**
   *  Filter used to select the subset of conversations to delete.
   */
  // const filter = 'abc123'
  /**
   *  Maximum number of conversations to delete.
   */
  // const maxDeleteCount = 1234
  /**
   *  If set to true, all of this conversation's analyses will also be deleted.
   *  Otherwise, the request will only succeed if the conversation has no
   *  analyses.
   */
  // const force = true

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callBulkDeleteConversations() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.bulkDeleteConversations(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callBulkDeleteConversations();

bulkDeleteConversations(request, options, callback)

bulkDeleteConversations(request: protos.google.cloud.contactcenterinsights.v1.IBulkDeleteConversationsRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkDeleteConversationsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkDeleteConversationsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IBulkDeleteConversationsRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkDeleteConversationsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkDeleteConversationsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

bulkDeleteConversations(request, callback)

bulkDeleteConversations(request: protos.google.cloud.contactcenterinsights.v1.IBulkDeleteConversationsRequest, callback: Callback<LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkDeleteConversationsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkDeleteConversationsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IBulkDeleteConversationsRequest
callback Callback<LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkDeleteConversationsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkDeleteConversationsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

bulkDownloadFeedbackLabels(request, options)

bulkDownloadFeedbackLabels(request?: protos.google.cloud.contactcenterinsights.v1.IBulkDownloadFeedbackLabelsRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkDownloadFeedbackLabelsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkDownloadFeedbackLabelsMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Download feedback labels in bulk.

Parameters
Name Description
request IBulkDownloadFeedbackLabelsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkDownloadFeedbackLabelsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkDownloadFeedbackLabelsMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  A cloud storage bucket destination.
   */
  // const gcsDestination = {}
  /**
   *  Required. The parent resource for new feedback labels.
   */
  // const parent = 'abc123'
  /**
   *  Optional. A filter to reduce results to a specific subset. Supports
   *  disjunctions (OR) and conjunctions (AND).
   *  Supported fields:
   *  * `issue_model_id`
   *  * `qa_question_id`
   *  * `qa_scorecard_id`
   *  * `min_create_time`
   *  * `max_create_time`
   *  * `min_update_time`
   *  * `max_update_time`
   *  * `feedback_label_type`: QUALITY_AI, TOPIC_MODELING
   */
  // const filter = 'abc123'
  /**
   *  Optional. Limits the maximum number of feedback labels that will be
   *  downloaded. The first `N` feedback labels will be downloaded.
   */
  // const maxDownloadCount = 1234
  /**
   *  Optional. The type of feedback labels that will be downloaded.
   */
  // const feedbackLabelType = {}
  /**
   *  Optional. Filter parent conversations to download feedback labels for.
   *  When specified, the feedback labels will be downloaded for the
   *  conversations that match the filter.
   *  If `template_qa_scorecard_id` is set, all the conversations that match the
   *  filter will be paired with the questions under the scorecard for labeling.
   */
  // const conversationFilter = 'abc123'
  /**
   *  Optional. If set, a template for labeling conversations and scorecard
   *  questions will be created from the conversation_filter and the questions
   *  under the scorecard(s). The feedback label `filter` will be ignored.
   */
  // const templateQaScorecardId = ['abc','def']

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callBulkDownloadFeedbackLabels() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.bulkDownloadFeedbackLabels(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callBulkDownloadFeedbackLabels();

bulkDownloadFeedbackLabels(request, options, callback)

bulkDownloadFeedbackLabels(request: protos.google.cloud.contactcenterinsights.v1.IBulkDownloadFeedbackLabelsRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkDownloadFeedbackLabelsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkDownloadFeedbackLabelsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IBulkDownloadFeedbackLabelsRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkDownloadFeedbackLabelsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkDownloadFeedbackLabelsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

bulkDownloadFeedbackLabels(request, callback)

bulkDownloadFeedbackLabels(request: protos.google.cloud.contactcenterinsights.v1.IBulkDownloadFeedbackLabelsRequest, callback: Callback<LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkDownloadFeedbackLabelsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkDownloadFeedbackLabelsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IBulkDownloadFeedbackLabelsRequest
callback Callback<LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkDownloadFeedbackLabelsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkDownloadFeedbackLabelsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

bulkUploadFeedbackLabels(request, options)

bulkUploadFeedbackLabels(request?: protos.google.cloud.contactcenterinsights.v1.IBulkUploadFeedbackLabelsRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkUploadFeedbackLabelsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkUploadFeedbackLabelsMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Upload feedback labels in bulk.

Parameters
Name Description
request IBulkUploadFeedbackLabelsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkUploadFeedbackLabelsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkUploadFeedbackLabelsMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  A cloud storage bucket source.
   */
  // const gcsSource = {}
  /**
   *  Required. The parent resource for new feedback labels.
   */
  // const parent = 'abc123'
  /**
   *  Optional. If set, upload will not happen and the labels will be validated.
   *  If not set, then default behavior will be to upload the labels after
   *  validation is complete.
   */
  // const validateOnly = true

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callBulkUploadFeedbackLabels() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.bulkUploadFeedbackLabels(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callBulkUploadFeedbackLabels();

bulkUploadFeedbackLabels(request, options, callback)

bulkUploadFeedbackLabels(request: protos.google.cloud.contactcenterinsights.v1.IBulkUploadFeedbackLabelsRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkUploadFeedbackLabelsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkUploadFeedbackLabelsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IBulkUploadFeedbackLabelsRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkUploadFeedbackLabelsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkUploadFeedbackLabelsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

bulkUploadFeedbackLabels(request, callback)

bulkUploadFeedbackLabels(request: protos.google.cloud.contactcenterinsights.v1.IBulkUploadFeedbackLabelsRequest, callback: Callback<LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkUploadFeedbackLabelsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkUploadFeedbackLabelsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IBulkUploadFeedbackLabelsRequest
callback Callback<LROperation<protos.google.cloud.contactcenterinsights.v1.IBulkUploadFeedbackLabelsResponse, protos.google.cloud.contactcenterinsights.v1.IBulkUploadFeedbackLabelsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

calculateIssueModelStats(request, options)

calculateIssueModelStats(request?: protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse,
        (protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest | undefined),
        {} | undefined
    ]>;

Gets an issue model's statistics.

Parameters
Name Description
request ICalculateIssueModelStatsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse, (protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing CalculateIssueModelStatsResponse. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the issue model to query against.
   */
  // const issueModel = 'abc123'

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callCalculateIssueModelStats() {
    // Construct request
    const request = {
      issueModel,
    };

    // Run request
    const response = await contactcenterinsightsClient.calculateIssueModelStats(request);
    console.log(response);
  }

  callCalculateIssueModelStats();

calculateIssueModelStats(request, options, callback)

calculateIssueModelStats(request: protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest, options: CallOptions, callback: Callback<protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse, protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICalculateIssueModelStatsRequest
options CallOptions
callback Callback<protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse, protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

calculateIssueModelStats(request, callback)

calculateIssueModelStats(request: protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest, callback: Callback<protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse, protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICalculateIssueModelStatsRequest
callback Callback<protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse, protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

calculateStats(request, options)

calculateStats(request?: protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse,
        (protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest | undefined),
        {} | undefined
    ]>;

Gets conversation statistics.

Parameters
Name Description
request ICalculateStatsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse, (protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The location of the conversations.
   */
  // const location = 'abc123'
  /**
   *  A filter to reduce results to a specific subset. This field is useful for
   *  getting statistics about conversations with specific properties.
   */
  // const filter = 'abc123'

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callCalculateStats() {
    // Construct request
    const request = {
      location,
    };

    // Run request
    const response = await contactcenterinsightsClient.calculateStats(request);
    console.log(response);
  }

  callCalculateStats();

calculateStats(request, options, callback)

calculateStats(request: protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest, options: CallOptions, callback: Callback<protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse, protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICalculateStatsRequest
options CallOptions
callback Callback<protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse, protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

calculateStats(request, callback)

calculateStats(request: protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest, callback: Callback<protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse, protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICalculateStatsRequest
callback Callback<protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse, protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

cancelOperation(request, options, callback)

cancelOperation(request: protos.google.longrunning.CancelOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;

Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to Code.CANCELLED.

Parameters
Name Description
request CancelOperationRequest

The request object that will be sent.

options CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>

The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

Returns
Type Description
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});

checkBulkAnalyzeConversationsProgress(name)

checkBulkAnalyzeConversationsProgress(name: string): Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse, protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata>>;

Check the status of the long running operation returned by bulkAnalyzeConversations().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse, protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The parent resource to create analyses in.
   */
  // const parent = 'abc123'
  /**
   *  Required. Filter used to select the subset of conversations to analyze.
   */
  // const filter = 'abc123'
  /**
   *  Required. Percentage of selected conversation to analyze, between
   *  0, 100.
   */
  // const analysisPercentage = 1234
  /**
   *  To select the annotators to run and the phrase matchers to use
   *  (if any). If not specified, all annotators will be run.
   */
  // const annotatorSelector = {}

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callBulkAnalyzeConversations() {
    // Construct request
    const request = {
      parent,
      filter,
      analysisPercentage,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.bulkAnalyzeConversations(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callBulkAnalyzeConversations();

checkBulkDeleteConversationsProgress(name)

checkBulkDeleteConversationsProgress(name: string): Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.BulkDeleteConversationsResponse, protos.google.cloud.contactcenterinsights.v1.BulkDeleteConversationsMetadata>>;

Check the status of the long running operation returned by bulkDeleteConversations().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.BulkDeleteConversationsResponse, protos.google.cloud.contactcenterinsights.v1.BulkDeleteConversationsMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The parent resource to delete conversations from.
   *  Format:
   *  projects/{project}/locations/{location}
   */
  // const parent = 'abc123'
  /**
   *  Filter used to select the subset of conversations to delete.
   */
  // const filter = 'abc123'
  /**
   *  Maximum number of conversations to delete.
   */
  // const maxDeleteCount = 1234
  /**
   *  If set to true, all of this conversation's analyses will also be deleted.
   *  Otherwise, the request will only succeed if the conversation has no
   *  analyses.
   */
  // const force = true

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callBulkDeleteConversations() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.bulkDeleteConversations(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callBulkDeleteConversations();

checkBulkDownloadFeedbackLabelsProgress(name)

checkBulkDownloadFeedbackLabelsProgress(name: string): Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsResponse, protos.google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsMetadata>>;

Check the status of the long running operation returned by bulkDownloadFeedbackLabels().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsResponse, protos.google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  A cloud storage bucket destination.
   */
  // const gcsDestination = {}
  /**
   *  Required. The parent resource for new feedback labels.
   */
  // const parent = 'abc123'
  /**
   *  Optional. A filter to reduce results to a specific subset. Supports
   *  disjunctions (OR) and conjunctions (AND).
   *  Supported fields:
   *  * `issue_model_id`
   *  * `qa_question_id`
   *  * `qa_scorecard_id`
   *  * `min_create_time`
   *  * `max_create_time`
   *  * `min_update_time`
   *  * `max_update_time`
   *  * `feedback_label_type`: QUALITY_AI, TOPIC_MODELING
   */
  // const filter = 'abc123'
  /**
   *  Optional. Limits the maximum number of feedback labels that will be
   *  downloaded. The first `N` feedback labels will be downloaded.
   */
  // const maxDownloadCount = 1234
  /**
   *  Optional. The type of feedback labels that will be downloaded.
   */
  // const feedbackLabelType = {}
  /**
   *  Optional. Filter parent conversations to download feedback labels for.
   *  When specified, the feedback labels will be downloaded for the
   *  conversations that match the filter.
   *  If `template_qa_scorecard_id` is set, all the conversations that match the
   *  filter will be paired with the questions under the scorecard for labeling.
   */
  // const conversationFilter = 'abc123'
  /**
   *  Optional. If set, a template for labeling conversations and scorecard
   *  questions will be created from the conversation_filter and the questions
   *  under the scorecard(s). The feedback label `filter` will be ignored.
   */
  // const templateQaScorecardId = ['abc','def']

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callBulkDownloadFeedbackLabels() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.bulkDownloadFeedbackLabels(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callBulkDownloadFeedbackLabels();

checkBulkUploadFeedbackLabelsProgress(name)

checkBulkUploadFeedbackLabelsProgress(name: string): Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsResponse, protos.google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsMetadata>>;

Check the status of the long running operation returned by bulkUploadFeedbackLabels().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsResponse, protos.google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  A cloud storage bucket source.
   */
  // const gcsSource = {}
  /**
   *  Required. The parent resource for new feedback labels.
   */
  // const parent = 'abc123'
  /**
   *  Optional. If set, upload will not happen and the labels will be validated.
   *  If not set, then default behavior will be to upload the labels after
   *  validation is complete.
   */
  // const validateOnly = true

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callBulkUploadFeedbackLabels() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.bulkUploadFeedbackLabels(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callBulkUploadFeedbackLabels();

checkCreateAnalysisProgress(name)

checkCreateAnalysisProgress(name: string): Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.Analysis, protos.google.cloud.contactcenterinsights.v1.CreateAnalysisOperationMetadata>>;

Check the status of the long running operation returned by createAnalysis().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.Analysis, protos.google.cloud.contactcenterinsights.v1.CreateAnalysisOperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The parent resource of the analysis.
   */
  // const parent = 'abc123'
  /**
   *  Required. The analysis to create.
   */
  // const analysis = {}

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callCreateAnalysis() {
    // Construct request
    const request = {
      parent,
      analysis,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.createAnalysis(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateAnalysis();

checkCreateIssueModelProgress(name)

checkCreateIssueModelProgress(name: string): Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.IssueModel, protos.google.cloud.contactcenterinsights.v1.CreateIssueModelMetadata>>;

Check the status of the long running operation returned by createIssueModel().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.IssueModel, protos.google.cloud.contactcenterinsights.v1.CreateIssueModelMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The parent resource of the issue model.
   */
  // const parent = 'abc123'
  /**
   *  Required. The issue model to create.
   */
  // const issueModel = {}

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callCreateIssueModel() {
    // Construct request
    const request = {
      parent,
      issueModel,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.createIssueModel(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateIssueModel();

checkDeleteIssueModelProgress(name)

checkDeleteIssueModelProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.contactcenterinsights.v1.DeleteIssueModelMetadata>>;

Check the status of the long running operation returned by deleteIssueModel().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.contactcenterinsights.v1.DeleteIssueModelMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the issue model to delete.
   */
  // const name = 'abc123'

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callDeleteIssueModel() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.deleteIssueModel(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteIssueModel();

checkDeployIssueModelProgress(name)

checkDeployIssueModelProgress(name: string): Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.DeployIssueModelResponse, protos.google.cloud.contactcenterinsights.v1.DeployIssueModelMetadata>>;

Check the status of the long running operation returned by deployIssueModel().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.DeployIssueModelResponse, protos.google.cloud.contactcenterinsights.v1.DeployIssueModelMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The issue model to deploy.
   */
  // const name = 'abc123'

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callDeployIssueModel() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.deployIssueModel(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeployIssueModel();

checkExportInsightsDataProgress(name)

checkExportInsightsDataProgress(name: string): Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.ExportInsightsDataResponse, protos.google.cloud.contactcenterinsights.v1.ExportInsightsDataMetadata>>;

Check the status of the long running operation returned by exportInsightsData().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.ExportInsightsDataResponse, protos.google.cloud.contactcenterinsights.v1.ExportInsightsDataMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Specified if sink is a BigQuery table.
   */
  // const bigQueryDestination = {}
  /**
   *  Required. The parent resource to export data from.
   */
  // const parent = 'abc123'
  /**
   *  A filter to reduce results to a specific subset. Useful for exporting
   *  conversations with specific properties.
   */
  // const filter = 'abc123'
  /**
   *  A fully qualified KMS key name for BigQuery tables protected by CMEK.
   *  Format:
   *  projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}/cryptoKeyVersions/{version}
   */
  // const kmsKey = 'abc123'
  /**
   *  Options for what to do if the destination table already exists.
   */
  // const writeDisposition = {}

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callExportInsightsData() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.exportInsightsData(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callExportInsightsData();

checkExportIssueModelProgress(name)

checkExportIssueModelProgress(name: string): Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.ExportIssueModelResponse, protos.google.cloud.contactcenterinsights.v1.ExportIssueModelMetadata>>;

Check the status of the long running operation returned by exportIssueModel().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.ExportIssueModelResponse, protos.google.cloud.contactcenterinsights.v1.ExportIssueModelMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Google Cloud Storage URI to export the issue model to.
   */
  // const gcsDestination = {}
  /**
   *  Required. The issue model to export.
   */
  // const name = 'abc123'

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callExportIssueModel() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.exportIssueModel(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callExportIssueModel();

checkImportIssueModelProgress(name)

checkImportIssueModelProgress(name: string): Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.ImportIssueModelResponse, protos.google.cloud.contactcenterinsights.v1.ImportIssueModelMetadata>>;

Check the status of the long running operation returned by importIssueModel().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.ImportIssueModelResponse, protos.google.cloud.contactcenterinsights.v1.ImportIssueModelMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Google Cloud Storage source message.
   */
  // const gcsSource = {}
  /**
   *  Required. The parent resource of the issue model.
   */
  // const parent = 'abc123'
  /**
   *  Optional. If set to true, will create an issue model from the imported file
   *  with randomly generated IDs for the issue model and corresponding issues.
   *  Otherwise, replaces an existing model with the same ID as the file.
   */
  // const createNewModel = true

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callImportIssueModel() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.importIssueModel(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callImportIssueModel();

checkIngestConversationsProgress(name)

checkIngestConversationsProgress(name: string): Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.IngestConversationsResponse, protos.google.cloud.contactcenterinsights.v1.IngestConversationsMetadata>>;

Check the status of the long running operation returned by ingestConversations().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.IngestConversationsResponse, protos.google.cloud.contactcenterinsights.v1.IngestConversationsMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  A cloud storage bucket source. Note that any previously ingested objects
   *  from the source will be skipped to avoid duplication.
   */
  // const gcsSource = {}
  /**
   *  Configuration for when `source` contains conversation transcripts.
   */
  // const transcriptObjectConfig = {}
  /**
   *  Required. The parent resource for new conversations.
   */
  // const parent = 'abc123'
  /**
   *  Configuration that applies to all conversations.
   */
  // const conversationConfig = {}
  /**
   *  Optional. DLP settings for transcript redaction. Optional, will default to
   *  the config specified in Settings.
   */
  // const redactionConfig = {}
  /**
   *  Optional. Default Speech-to-Text configuration. Optional, will default to
   *  the config specified in Settings.
   */
  // const speechConfig = {}
  /**
   *  Optional. If set, this fields indicates the number of objects to ingest
   *  from the Cloud Storage bucket. If empty, the entire bucket will be
   *  ingested. Unless they are first deleted, conversations produced through
   *  sampling won't be ingested by subsequent ingest requests.
   */
  // const sampleSize = 1234

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callIngestConversations() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.ingestConversations(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callIngestConversations();

checkInitializeEncryptionSpecProgress(name)

checkInitializeEncryptionSpecProgress(name: string): Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.InitializeEncryptionSpecResponse, protos.google.cloud.contactcenterinsights.v1.InitializeEncryptionSpecMetadata>>;

Check the status of the long running operation returned by initializeEncryptionSpec().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.InitializeEncryptionSpecResponse, protos.google.cloud.contactcenterinsights.v1.InitializeEncryptionSpecMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The encryption spec used for CMEK encryption. It is required that
   *  the kms key is in the same region as the endpoint. The same key will be
   *  used for all provisioned resources, if encryption is available. If the
   *  `kms_key_name` field is left empty, no encryption will be enforced.
   */
  // const encryptionSpec = {}

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callInitializeEncryptionSpec() {
    // Construct request
    const request = {
      encryptionSpec,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.initializeEncryptionSpec(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callInitializeEncryptionSpec();

checkQueryMetricsProgress(name)

checkQueryMetricsProgress(name: string): Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.QueryMetricsResponse, protos.google.cloud.contactcenterinsights.v1.QueryMetricsMetadata>>;

Check the status of the long running operation returned by queryMetrics().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.QueryMetricsResponse, protos.google.cloud.contactcenterinsights.v1.QueryMetricsMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The location of the data.
   *  "projects/{project}/locations/{location}"
   */
  // const location = 'abc123'
  /**
   *  Required. Filter to select a subset of conversations to compute the
   *  metrics. Must specify a window of the conversation create time to compute
   *  the metrics. The returned metrics will be from the range DATE(starting
   *  create time), DATE(ending create time)).
   */
  // const filter = 'abc123'
  /**
   *  The time granularity of each data point in the time series.
   *  Defaults to NONE if this field is unspecified.
   */
  // const timeGranularity = {}
  /**
   *  The dimensions that determine the grouping key for the query. Defaults to
   *  no dimension if this field is unspecified. If a dimension is specified,
   *  its key must also be specified. Each dimension's key must be unique.
   *  If a time granularity is also specified, metric values in the dimension
   *  will be bucketed by this granularity.
   *  Up to one dimension is supported for now.
   */
  // const dimensions = [1,2,3,4]
  /**
   *  Measures to return. Defaults to all measures if this field is unspecified.
   *  A valid mask should traverse from the `measure` field from the response.
   *  For example, a path from a measure mask to get the conversation count is
   *  "conversation_measure.count".
   */
  // const measureMask = {}

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callQueryMetrics() {
    // Construct request
    const request = {
      location,
      filter,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.queryMetrics(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callQueryMetrics();

checkTuneQaScorecardRevisionProgress(name)

checkTuneQaScorecardRevisionProgress(name: string): Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionResponse, protos.google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionMetadata>>;

Check the status of the long running operation returned by tuneQaScorecardRevision().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionResponse, protos.google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The parent resource for new fine tuning job instance.
   */
  // const parent = 'abc123'
  /**
   *  Required. Filter for selecting the feedback labels that needs to be
   *  used for training.
   *  This filter can be used to limit the feedback labels used for tuning to a
   *  feedback labels created or updated for a specific time-window etc.
   */
  // const filter = 'abc123'
  /**
   *  Optional. Run in validate only mode, no fine tuning will actually run.
   *  Data quality validations like training data distributions will run.
   *  Even when set to false, the data quality validations will still run but
   *  once the validations complete we will proceed with the fine tune, if
   *  applicable.
   */
  // const validateOnly = true

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callTuneQaScorecardRevision() {
    // Construct request
    const request = {
      parent,
      filter,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.tuneQaScorecardRevision(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callTuneQaScorecardRevision();

checkUndeployIssueModelProgress(name)

checkUndeployIssueModelProgress(name: string): Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.UndeployIssueModelResponse, protos.google.cloud.contactcenterinsights.v1.UndeployIssueModelMetadata>>;

Check the status of the long running operation returned by undeployIssueModel().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.UndeployIssueModelResponse, protos.google.cloud.contactcenterinsights.v1.UndeployIssueModelMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The issue model to undeploy.
   */
  // const name = 'abc123'

  // Imports the Contactcenterinsights library
  const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1;

  // Instantiates a client
  const contactcenterinsightsClient = new ContactCenterInsightsClient();

  async function callUndeployIssueModel() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await contactcenterinsightsClient.undeployIssueModel(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUndeployIssueModel();

checkUploadConversationProgress(name)

checkUploadConversationProgress(name: string): Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.Conversation, protos.google.cloud.contactcenterinsights.v1.UploadConversationMetadata>>;

Check the status of the long running operation returned by uploadConversation().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.contactcenterinsights.v1.Conversation, protos.google.cloud.contactcenterinsights.v1.UploadConversationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example