Google Cloud Contact Center Insights V1 Client - Class ContactCenterInsightsClient (1.4.1)

Reference documentation and code samples for the Google Cloud Contact Center Insights V1 Client class ContactCenterInsightsClient.

Service Description: An API that lets users analyze and explore their business conversation data.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:

$contactCenterInsightsClient = new ContactCenterInsightsClient();
try {
    $formattedParent = $contactCenterInsightsClient->locationName('[PROJECT]', '[LOCATION]');
    $filter = 'filter';
    $analysisPercentage = 0.0;
    $operationResponse = $contactCenterInsightsClient->bulkAnalyzeConversations($formattedParent, $filter, $analysisPercentage);
    $operationResponse->pollUntilComplete();
    if ($operationResponse->operationSucceeded()) {
        $result = $operationResponse->getResult();
        // doSomethingWith($result)
    } else {
        $error = $operationResponse->getError();
        // handleError($error)
    }
    // Alternatively:
    // start the operation, keep the operation name, and resume later
    $operationResponse = $contactCenterInsightsClient->bulkAnalyzeConversations($formattedParent, $filter, $analysisPercentage);
    $operationName = $operationResponse->getName();
    // ... do other work
    $newOperationResponse = $contactCenterInsightsClient->resumeOperation($operationName, 'bulkAnalyzeConversations');
    while (!$newOperationResponse->isDone()) {
        // ... do other work
        $newOperationResponse->reload();
    }
    if ($newOperationResponse->operationSucceeded()) {
        $result = $newOperationResponse->getResult();
        // doSomethingWith($result)
    } else {
        $error = $newOperationResponse->getError();
        // handleError($error)
    }
} finally {
    $contactCenterInsightsClient->close();
}

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.

This service has a new (beta) implementation. See Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient to use the new surface.

Namespace

Google \ Cloud \ ContactCenterInsights \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
options array

Optional. Options for configuring the service API wrapper.

↳ apiEndpoint string

The address of the API remote host. May optionally include the port, formatted as "

↳ credentials string|array|FetchAuthTokenInterface|CredentialsWrapper

The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored.

↳ credentialsConfig array

Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() .

↳ disableRetries bool

Determines whether or not retries defined by the client configuration should be disabled. Defaults to false.

↳ clientConfig string|array

Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder.

↳ transport string|TransportInterface

The transport used for executing network requests. May be either the string rest or grpc. Defaults to grpc if gRPC support is detected on the system. Advanced usage: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.

↳ transportConfig array

Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options.

↳ clientCertSource callable

A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS.

bulkAnalyzeConversations

Analyzes multiple conversations in a single request.

Parameters
NameDescription
parent string

Required. The parent resource to create analyses in.

filter string

Required. Filter used to select the subset of conversations to analyze.

analysisPercentage float

Required. Percentage of selected conversation to analyze, between [0, 100].

optionalArgs array

Optional.

↳ annotatorSelector AnnotatorSelector

To select the annotators to run and the phrase matchers to use (if any). If not specified, all annotators will be run.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\BulkAnalyzeConversationsResponse;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Rpc\Status;

/**
 * @param string $formattedParent    The parent resource to create analyses in. Please see
 *                                   {@see ContactCenterInsightsClient::locationName()} for help formatting this field.
 * @param string $filter             Filter used to select the subset of conversations to analyze.
 * @param float  $analysisPercentage Percentage of selected conversation to analyze, between
 *                                   [0, 100].
 */
function bulk_analyze_conversations_sample(
    string $formattedParent,
    string $filter,
    float $analysisPercentage
): void {
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $contactCenterInsightsClient->bulkAnalyzeConversations(
            $formattedParent,
            $filter,
            $analysisPercentage
        );
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var BulkAnalyzeConversationsResponse $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = ContactCenterInsightsClient::locationName('[PROJECT]', '[LOCATION]');
    $filter = '[FILTER]';
    $analysisPercentage = 0.0;

    bulk_analyze_conversations_sample($formattedParent, $filter, $analysisPercentage);
}

calculateIssueModelStats

Gets an issue model's statistics.

Parameters
NameDescription
issueModel string

Required. The resource name of the issue model to query against.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\CalculateIssueModelStatsResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\CalculateIssueModelStatsResponse;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;

/**
 * @param string $formattedIssueModel The resource name of the issue model to query against. Please see
 *                                    {@see ContactCenterInsightsClient::issueModelName()} for help formatting this field.
 */
function calculate_issue_model_stats_sample(string $formattedIssueModel): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var CalculateIssueModelStatsResponse $response */
        $response = $contactCenterInsightsClient->calculateIssueModelStats($formattedIssueModel);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedIssueModel = ContactCenterInsightsClient::issueModelName(
        '[PROJECT]',
        '[LOCATION]',
        '[ISSUE_MODEL]'
    );

    calculate_issue_model_stats_sample($formattedIssueModel);
}

calculateStats

Gets conversation statistics.

Parameters
NameDescription
location string

Required. The location of the conversations.

optionalArgs array

Optional.

↳ filter string

A filter to reduce results to a specific subset. This field is useful for getting statistics about conversations with specific properties.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\CalculateStatsResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\CalculateStatsResponse;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;

/**
 * @param string $formattedLocation The location of the conversations. Please see
 *                                  {@see ContactCenterInsightsClient::locationName()} for help formatting this field.
 */
function calculate_stats_sample(string $formattedLocation): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var CalculateStatsResponse $response */
        $response = $contactCenterInsightsClient->calculateStats($formattedLocation);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedLocation = ContactCenterInsightsClient::locationName('[PROJECT]', '[LOCATION]');

    calculate_stats_sample($formattedLocation);
}

createAnalysis

Creates an analysis. The long running operation is done when the analysis has completed.

Parameters
NameDescription
parent string

Required. The parent resource of the analysis.

analysis Google\Cloud\ContactCenterInsights\V1\Analysis

Required. The analysis to create.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\Analysis;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The parent resource of the analysis. Please see
 *                                {@see ContactCenterInsightsClient::conversationName()} for help formatting this field.
 */
function create_analysis_sample(string $formattedParent): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $analysis = new Analysis();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $contactCenterInsightsClient->createAnalysis($formattedParent, $analysis);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Analysis $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = ContactCenterInsightsClient::conversationName(
        '[PROJECT]',
        '[LOCATION]',
        '[CONVERSATION]'
    );

    create_analysis_sample($formattedParent);
}

createConversation

Creates a conversation.

Parameters
NameDescription
parent string

Required. The parent resource of the conversation.

conversation Google\Cloud\ContactCenterInsights\V1\Conversation

Required. The conversation resource to create.

optionalArgs array

Optional.

↳ conversationId string

A unique ID for the new conversation. This ID will become the final component of the conversation's resource name. If no ID is specified, a server-generated ID will be used. This value should be 4-64 characters and must match the regular expression ^[a-z0-9-]{4,64}$. Valid characters are [a-z][0-9]-

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\Conversation
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\Conversation;

/**
 * @param string $formattedParent The parent resource of the conversation. Please see
 *                                {@see ContactCenterInsightsClient::locationName()} for help formatting this field.
 */
function create_conversation_sample(string $formattedParent): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $conversation = new Conversation();

    // Call the API and handle any network failures.
    try {
        /** @var Conversation $response */
        $response = $contactCenterInsightsClient->createConversation($formattedParent, $conversation);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = ContactCenterInsightsClient::locationName('[PROJECT]', '[LOCATION]');

    create_conversation_sample($formattedParent);
}

createIssueModel

Creates an issue model.

Parameters
NameDescription
parent string

Required. The parent resource of the issue model.

issueModel Google\Cloud\ContactCenterInsights\V1\IssueModel

Required. The issue model to create.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\IssueModel;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The parent resource of the issue model. Please see
 *                                {@see ContactCenterInsightsClient::locationName()} for help formatting this field.
 */
function create_issue_model_sample(string $formattedParent): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $issueModel = new IssueModel();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $contactCenterInsightsClient->createIssueModel($formattedParent, $issueModel);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var IssueModel $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = ContactCenterInsightsClient::locationName('[PROJECT]', '[LOCATION]');

    create_issue_model_sample($formattedParent);
}

createPhraseMatcher

Creates a phrase matcher.

Parameters
NameDescription
parent string

Required. The parent resource of the phrase matcher. Required. The location to create a phrase matcher for. Format: projects/<Project ID>/locations/<Location ID> or projects/<Project Number>/locations/<Location ID>

phraseMatcher Google\Cloud\ContactCenterInsights\V1\PhraseMatcher

Required. The phrase matcher resource to create.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\PhraseMatcher
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\PhraseMatcher;
use Google\Cloud\ContactCenterInsights\V1\PhraseMatcher\PhraseMatcherType;

/**
 * @param string $formattedParent   The parent resource of the phrase matcher. Required. The location
 *                                  to create a phrase matcher for. Format: `projects/<Project
 *                                  ID>/locations/<Location ID>` or `projects/<Project
 *                                  Number>/locations/<Location ID>`
 *                                  Please see {@see ContactCenterInsightsClient::locationName()} for help formatting this field.
 * @param int    $phraseMatcherType The type of this phrase matcher.
 */
function create_phrase_matcher_sample(string $formattedParent, int $phraseMatcherType): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $phraseMatcher = (new PhraseMatcher())
        ->setType($phraseMatcherType);

    // Call the API and handle any network failures.
    try {
        /** @var PhraseMatcher $response */
        $response = $contactCenterInsightsClient->createPhraseMatcher($formattedParent, $phraseMatcher);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = ContactCenterInsightsClient::locationName('[PROJECT]', '[LOCATION]');
    $phraseMatcherType = PhraseMatcherType::PHRASE_MATCHER_TYPE_UNSPECIFIED;

    create_phrase_matcher_sample($formattedParent, $phraseMatcherType);
}

createView

Creates a view.

Parameters
NameDescription
parent string

Required. The parent resource of the view. Required. The location to create a view for. Format: projects/<Project ID>/locations/<Location ID> or projects/<Project Number>/locations/<Location ID>

view Google\Cloud\ContactCenterInsights\V1\View

Required. The view resource to create.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\View
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\View;

/**
 * @param string $formattedParent The parent resource of the view. Required. The location to create
 *                                a view for.
 *                                Format: `projects/<Project ID>/locations/<Location ID>` or
 *                                `projects/<Project Number>/locations/<Location ID>`
 *                                Please see {@see ContactCenterInsightsClient::locationName()} for help formatting this field.
 */
function create_view_sample(string $formattedParent): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $view = new View();

    // Call the API and handle any network failures.
    try {
        /** @var View $response */
        $response = $contactCenterInsightsClient->createView($formattedParent, $view);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = ContactCenterInsightsClient::locationName('[PROJECT]', '[LOCATION]');

    create_view_sample($formattedParent);
}

deleteAnalysis

Deletes an analysis.

Parameters
NameDescription
name string

Required. The name of the analysis to delete.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;

/**
 * @param string $formattedName The name of the analysis to delete. Please see
 *                              {@see ContactCenterInsightsClient::analysisName()} for help formatting this field.
 */
function delete_analysis_sample(string $formattedName): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        $contactCenterInsightsClient->deleteAnalysis($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = ContactCenterInsightsClient::analysisName(
        '[PROJECT]',
        '[LOCATION]',
        '[CONVERSATION]',
        '[ANALYSIS]'
    );

    delete_analysis_sample($formattedName);
}

deleteConversation

Deletes a conversation.

Parameters
NameDescription
name string

Required. The name of the conversation to delete.

optionalArgs array

Optional.

↳ force bool

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.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;

/**
 * @param string $formattedName The name of the conversation to delete. Please see
 *                              {@see ContactCenterInsightsClient::conversationName()} for help formatting this field.
 */
function delete_conversation_sample(string $formattedName): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        $contactCenterInsightsClient->deleteConversation($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = ContactCenterInsightsClient::conversationName(
        '[PROJECT]',
        '[LOCATION]',
        '[CONVERSATION]'
    );

    delete_conversation_sample($formattedName);
}

deleteIssue

Deletes an issue.

Parameters
NameDescription
name string

Required. The name of the issue to delete.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;

/**
 * @param string $formattedName The name of the issue to delete. Please see
 *                              {@see ContactCenterInsightsClient::issueName()} for help formatting this field.
 */
function delete_issue_sample(string $formattedName): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        $contactCenterInsightsClient->deleteIssue($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = ContactCenterInsightsClient::issueName(
        '[PROJECT]',
        '[LOCATION]',
        '[ISSUE_MODEL]',
        '[ISSUE]'
    );

    delete_issue_sample($formattedName);
}

deleteIssueModel

Deletes an issue model.

Parameters
NameDescription
name string

Required. The name of the issue model to delete.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the issue model to delete. Please see
 *                              {@see ContactCenterInsightsClient::issueModelName()} for help formatting this field.
 */
function delete_issue_model_sample(string $formattedName): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $contactCenterInsightsClient->deleteIssueModel($formattedName);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            printf('Operation completed successfully.' . PHP_EOL);
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = ContactCenterInsightsClient::issueModelName(
        '[PROJECT]',
        '[LOCATION]',
        '[ISSUE_MODEL]'
    );

    delete_issue_model_sample($formattedName);
}

deletePhraseMatcher

Deletes a phrase matcher.

Parameters
NameDescription
name string

Required. The name of the phrase matcher to delete.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;

/**
 * @param string $formattedName The name of the phrase matcher to delete. Please see
 *                              {@see ContactCenterInsightsClient::phraseMatcherName()} for help formatting this field.
 */
function delete_phrase_matcher_sample(string $formattedName): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        $contactCenterInsightsClient->deletePhraseMatcher($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = ContactCenterInsightsClient::phraseMatcherName(
        '[PROJECT]',
        '[LOCATION]',
        '[PHRASE_MATCHER]'
    );

    delete_phrase_matcher_sample($formattedName);
}

deleteView

Deletes a view.

Parameters
NameDescription
name string

Required. The name of the view to delete.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;

/**
 * @param string $formattedName The name of the view to delete. Please see
 *                              {@see ContactCenterInsightsClient::viewName()} for help formatting this field.
 */
function delete_view_sample(string $formattedName): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        $contactCenterInsightsClient->deleteView($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = ContactCenterInsightsClient::viewName('[PROJECT]', '[LOCATION]', '[VIEW]');

    delete_view_sample($formattedName);
}

deployIssueModel

Deploys an issue model. Returns an error if a model is already deployed.

An issue model can only be used in analysis after it has been deployed.

Parameters
NameDescription
name string

Required. The issue model to deploy.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\DeployIssueModelResponse;
use Google\Rpc\Status;

/**
 * @param string $formattedName The issue model to deploy. Please see
 *                              {@see ContactCenterInsightsClient::issueModelName()} for help formatting this field.
 */
function deploy_issue_model_sample(string $formattedName): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $contactCenterInsightsClient->deployIssueModel($formattedName);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var DeployIssueModelResponse $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = ContactCenterInsightsClient::issueModelName(
        '[PROJECT]',
        '[LOCATION]',
        '[ISSUE_MODEL]'
    );

    deploy_issue_model_sample($formattedName);
}

exportInsightsData

Export insights data to a destination defined in the request body.

Parameters
NameDescription
parent string

Required. The parent resource to export data from.

optionalArgs array

Optional.

↳ bigQueryDestination BigQueryDestination

Specified if sink is a BigQuery table.

↳ filter string

A filter to reduce results to a specific subset. Useful for exporting conversations with specific properties.

↳ kmsKey string

A fully qualified KMS key name for BigQuery tables protected by CMEK. Format: projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}/cryptoKeyVersions/{version}

↳ writeDisposition int

Options for what to do if the destination table already exists. For allowed values, use constants defined on Google\Cloud\ContactCenterInsights\V1\ExportInsightsDataRequest\WriteDisposition

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\ExportInsightsDataResponse;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The parent resource to export data from. Please see
 *                                {@see ContactCenterInsightsClient::locationName()} for help formatting this field.
 */
function export_insights_data_sample(string $formattedParent): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $contactCenterInsightsClient->exportInsightsData($formattedParent);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var ExportInsightsDataResponse $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = ContactCenterInsightsClient::locationName('[PROJECT]', '[LOCATION]');

    export_insights_data_sample($formattedParent);
}

getAnalysis

Gets an analysis.

Parameters
NameDescription
name string

Required. The name of the analysis to get.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\Analysis
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Analysis;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;

/**
 * @param string $formattedName The name of the analysis to get. Please see
 *                              {@see ContactCenterInsightsClient::analysisName()} for help formatting this field.
 */
function get_analysis_sample(string $formattedName): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var Analysis $response */
        $response = $contactCenterInsightsClient->getAnalysis($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = ContactCenterInsightsClient::analysisName(
        '[PROJECT]',
        '[LOCATION]',
        '[CONVERSATION]',
        '[ANALYSIS]'
    );

    get_analysis_sample($formattedName);
}

getConversation

Gets a conversation.

Parameters
NameDescription
name string

Required. The name of the conversation to get.

optionalArgs array

Optional.

↳ view int

The level of details of the conversation. Default is FULL. For allowed values, use constants defined on Google\Cloud\ContactCenterInsights\V1\ConversationView

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\Conversation
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\Conversation;

/**
 * @param string $formattedName The name of the conversation to get. Please see
 *                              {@see ContactCenterInsightsClient::conversationName()} for help formatting this field.
 */
function get_conversation_sample(string $formattedName): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var Conversation $response */
        $response = $contactCenterInsightsClient->getConversation($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = ContactCenterInsightsClient::conversationName(
        '[PROJECT]',
        '[LOCATION]',
        '[CONVERSATION]'
    );

    get_conversation_sample($formattedName);
}

getIssue

Gets an issue.

Parameters
NameDescription
name string

Required. The name of the issue to get.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\Issue
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\Issue;

/**
 * @param string $formattedName The name of the issue to get. Please see
 *                              {@see ContactCenterInsightsClient::issueName()} for help formatting this field.
 */
function get_issue_sample(string $formattedName): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var Issue $response */
        $response = $contactCenterInsightsClient->getIssue($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = ContactCenterInsightsClient::issueName(
        '[PROJECT]',
        '[LOCATION]',
        '[ISSUE_MODEL]',
        '[ISSUE]'
    );

    get_issue_sample($formattedName);
}

getIssueModel

Gets an issue model.

Parameters
NameDescription
name string

Required. The name of the issue model to get.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\IssueModel
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\IssueModel;

/**
 * @param string $formattedName The name of the issue model to get. Please see
 *                              {@see ContactCenterInsightsClient::issueModelName()} for help formatting this field.
 */
function get_issue_model_sample(string $formattedName): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var IssueModel $response */
        $response = $contactCenterInsightsClient->getIssueModel($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = ContactCenterInsightsClient::issueModelName(
        '[PROJECT]',
        '[LOCATION]',
        '[ISSUE_MODEL]'
    );

    get_issue_model_sample($formattedName);
}

getPhraseMatcher

Gets a phrase matcher.

Parameters
NameDescription
name string

Required. The name of the phrase matcher to get.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\PhraseMatcher
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\PhraseMatcher;

/**
 * @param string $formattedName The name of the phrase matcher to get. Please see
 *                              {@see ContactCenterInsightsClient::phraseMatcherName()} for help formatting this field.
 */
function get_phrase_matcher_sample(string $formattedName): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var PhraseMatcher $response */
        $response = $contactCenterInsightsClient->getPhraseMatcher($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = ContactCenterInsightsClient::phraseMatcherName(
        '[PROJECT]',
        '[LOCATION]',
        '[PHRASE_MATCHER]'
    );

    get_phrase_matcher_sample($formattedName);
}

getSettings

Gets project-level settings.

Parameters
NameDescription
name string

Required. The name of the settings resource to get.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\Settings
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\Settings;

/**
 * @param string $formattedName The name of the settings resource to get. Please see
 *                              {@see ContactCenterInsightsClient::settingsName()} for help formatting this field.
 */
function get_settings_sample(string $formattedName): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var Settings $response */
        $response = $contactCenterInsightsClient->getSettings($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = ContactCenterInsightsClient::settingsName('[PROJECT]', '[LOCATION]');

    get_settings_sample($formattedName);
}

getView

Gets a view.

Parameters
NameDescription
name string

Required. The name of the view to get.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\View
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\View;

/**
 * @param string $formattedName The name of the view to get. Please see
 *                              {@see ContactCenterInsightsClient::viewName()} for help formatting this field.
 */
function get_view_sample(string $formattedName): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var View $response */
        $response = $contactCenterInsightsClient->getView($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = ContactCenterInsightsClient::viewName('[PROJECT]', '[LOCATION]', '[VIEW]');

    get_view_sample($formattedName);
}

ingestConversations

Imports conversations and processes them according to the user's configuration.

Parameters
NameDescription
parent string

Required. The parent resource for new conversations.

optionalArgs array

Optional.

↳ gcsSource GcsSource

A cloud storage bucket source.

↳ transcriptObjectConfig TranscriptObjectConfig

Configuration for when source contains conversation transcripts.

↳ conversationConfig ConversationConfig

Configuration that applies to all conversations.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\IngestConversationsResponse;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The parent resource for new conversations. Please see
 *                                {@see ContactCenterInsightsClient::locationName()} for help formatting this field.
 */
function ingest_conversations_sample(string $formattedParent): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $contactCenterInsightsClient->ingestConversations($formattedParent);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var IngestConversationsResponse $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = ContactCenterInsightsClient::locationName('[PROJECT]', '[LOCATION]');

    ingest_conversations_sample($formattedParent);
}

listAnalyses

Lists analyses.

Parameters
NameDescription
parent string

Required. The parent resource of the analyses.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

A filter to reduce results to a specific subset. Useful for querying conversations with specific properties.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ContactCenterInsights\V1\Analysis;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;

/**
 * @param string $formattedParent The parent resource of the analyses. Please see
 *                                {@see ContactCenterInsightsClient::conversationName()} for help formatting this field.
 */
function list_analyses_sample(string $formattedParent): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $contactCenterInsightsClient->listAnalyses($formattedParent);

        /** @var Analysis $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = ContactCenterInsightsClient::conversationName(
        '[PROJECT]',
        '[LOCATION]',
        '[CONVERSATION]'
    );

    list_analyses_sample($formattedParent);
}

listConversations

Lists conversations.

Parameters
NameDescription
parent string

Required. The parent resource of the conversation.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

A filter to reduce results to a specific subset. Useful for querying conversations with specific properties.

↳ view int

The level of details of the conversation. Default is BASIC. For allowed values, use constants defined on Google\Cloud\ContactCenterInsights\V1\ConversationView

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\Conversation;

/**
 * @param string $formattedParent The parent resource of the conversation. Please see
 *                                {@see ContactCenterInsightsClient::locationName()} for help formatting this field.
 */
function list_conversations_sample(string $formattedParent): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $contactCenterInsightsClient->listConversations($formattedParent);

        /** @var Conversation $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = ContactCenterInsightsClient::locationName('[PROJECT]', '[LOCATION]');

    list_conversations_sample($formattedParent);
}

listIssueModels

Lists issue models.

Parameters
NameDescription
parent string

Required. The parent resource of the issue model.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\ListIssueModelsResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\ListIssueModelsResponse;

/**
 * @param string $formattedParent The parent resource of the issue model. Please see
 *                                {@see ContactCenterInsightsClient::locationName()} for help formatting this field.
 */
function list_issue_models_sample(string $formattedParent): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var ListIssueModelsResponse $response */
        $response = $contactCenterInsightsClient->listIssueModels($formattedParent);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = ContactCenterInsightsClient::locationName('[PROJECT]', '[LOCATION]');

    list_issue_models_sample($formattedParent);
}

listIssues

Lists issues.

Parameters
NameDescription
parent string

Required. The parent resource of the issue.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\ListIssuesResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\ListIssuesResponse;

/**
 * @param string $formattedParent The parent resource of the issue. Please see
 *                                {@see ContactCenterInsightsClient::issueModelName()} for help formatting this field.
 */
function list_issues_sample(string $formattedParent): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var ListIssuesResponse $response */
        $response = $contactCenterInsightsClient->listIssues($formattedParent);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = ContactCenterInsightsClient::issueModelName(
        '[PROJECT]',
        '[LOCATION]',
        '[ISSUE_MODEL]'
    );

    list_issues_sample($formattedParent);
}

listPhraseMatchers

Lists phrase matchers.

Parameters
NameDescription
parent string

Required. The parent resource of the phrase matcher.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

A filter to reduce results to a specific subset. Useful for querying phrase matchers with specific properties.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\PhraseMatcher;

/**
 * @param string $formattedParent The parent resource of the phrase matcher. Please see
 *                                {@see ContactCenterInsightsClient::locationName()} for help formatting this field.
 */
function list_phrase_matchers_sample(string $formattedParent): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $contactCenterInsightsClient->listPhraseMatchers($formattedParent);

        /** @var PhraseMatcher $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = ContactCenterInsightsClient::locationName('[PROJECT]', '[LOCATION]');

    list_phrase_matchers_sample($formattedParent);
}

listViews

Lists views.

Parameters
NameDescription
parent string

Required. The parent resource of the views.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\View;

/**
 * @param string $formattedParent The parent resource of the views. Please see
 *                                {@see ContactCenterInsightsClient::locationName()} for help formatting this field.
 */
function list_views_sample(string $formattedParent): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $contactCenterInsightsClient->listViews($formattedParent);

        /** @var View $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = ContactCenterInsightsClient::locationName('[PROJECT]', '[LOCATION]');

    list_views_sample($formattedParent);
}

undeployIssueModel

Undeploys an issue model.

An issue model can not be used in analysis after it has been undeployed.

Parameters
NameDescription
name string

Required. The issue model to undeploy.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\UndeployIssueModelResponse;
use Google\Rpc\Status;

/**
 * @param string $formattedName The issue model to undeploy. Please see
 *                              {@see ContactCenterInsightsClient::issueModelName()} for help formatting this field.
 */
function undeploy_issue_model_sample(string $formattedName): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $contactCenterInsightsClient->undeployIssueModel($formattedName);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var UndeployIssueModelResponse $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = ContactCenterInsightsClient::issueModelName(
        '[PROJECT]',
        '[LOCATION]',
        '[ISSUE_MODEL]'
    );

    undeploy_issue_model_sample($formattedName);
}

updateConversation

Updates a conversation.

Parameters
NameDescription
conversation Google\Cloud\ContactCenterInsights\V1\Conversation

Required. The new values for the conversation.

optionalArgs array

Optional.

↳ updateMask FieldMask

The list of fields to be updated.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\Conversation
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\Conversation;

/**
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_conversation_sample(): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $conversation = new Conversation();

    // Call the API and handle any network failures.
    try {
        /** @var Conversation $response */
        $response = $contactCenterInsightsClient->updateConversation($conversation);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

updateIssue

Updates an issue.

Parameters
NameDescription
issue Google\Cloud\ContactCenterInsights\V1\Issue

Required. The new values for the issue.

optionalArgs array

Optional.

↳ updateMask FieldMask

The list of fields to be updated.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\Issue
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\Issue;

/**
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_issue_sample(): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $issue = new Issue();

    // Call the API and handle any network failures.
    try {
        /** @var Issue $response */
        $response = $contactCenterInsightsClient->updateIssue($issue);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

updateIssueModel

Updates an issue model.

Parameters
NameDescription
issueModel Google\Cloud\ContactCenterInsights\V1\IssueModel

Required. The new values for the issue model.

optionalArgs array

Optional.

↳ updateMask FieldMask

The list of fields to be updated.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\IssueModel
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\IssueModel;

/**
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_issue_model_sample(): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $issueModel = new IssueModel();

    // Call the API and handle any network failures.
    try {
        /** @var IssueModel $response */
        $response = $contactCenterInsightsClient->updateIssueModel($issueModel);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

updatePhraseMatcher

Updates a phrase matcher.

Parameters
NameDescription
phraseMatcher Google\Cloud\ContactCenterInsights\V1\PhraseMatcher

Required. The new values for the phrase matcher.

optionalArgs array

Optional.

↳ updateMask FieldMask

The list of fields to be updated.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\PhraseMatcher
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\PhraseMatcher;
use Google\Cloud\ContactCenterInsights\V1\PhraseMatcher\PhraseMatcherType;

/**
 * @param int $phraseMatcherType The type of this phrase matcher.
 */
function update_phrase_matcher_sample(int $phraseMatcherType): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $phraseMatcher = (new PhraseMatcher())
        ->setType($phraseMatcherType);

    // Call the API and handle any network failures.
    try {
        /** @var PhraseMatcher $response */
        $response = $contactCenterInsightsClient->updatePhraseMatcher($phraseMatcher);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $phraseMatcherType = PhraseMatcherType::PHRASE_MATCHER_TYPE_UNSPECIFIED;

    update_phrase_matcher_sample($phraseMatcherType);
}

updateSettings

Updates project-level settings.

Parameters
NameDescription
settings Google\Cloud\ContactCenterInsights\V1\Settings

Required. The new settings values.

updateMask Google\Protobuf\FieldMask

Required. The list of fields to be updated.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\Settings
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\Settings;
use Google\Protobuf\FieldMask;

/**
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_settings_sample(): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $settings = new Settings();
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var Settings $response */
        $response = $contactCenterInsightsClient->updateSettings($settings, $updateMask);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

updateView

Updates a view.

Parameters
NameDescription
view Google\Cloud\ContactCenterInsights\V1\View

Required. The new view.

optionalArgs array

Optional.

↳ updateMask FieldMask

The list of fields to be updated.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\ContactCenterInsights\V1\View
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\View;

/**
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_view_sample(): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $view = new View();

    // Call the API and handle any network failures.
    try {
        /** @var View $response */
        $response = $contactCenterInsightsClient->updateView($view);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

uploadConversation

Create a longrunning conversation upload operation. This method differs from CreateConversation by allowing audio transcription and optional DLP redaction.

Parameters
NameDescription
parent string

Required. The parent resource of the conversation.

conversation Google\Cloud\ContactCenterInsights\V1\Conversation

Required. The conversation resource to create.

optionalArgs array

Optional.

↳ conversationId string

Optional. A unique ID for the new conversation. This ID will become the final component of the conversation's resource name. If no ID is specified, a server-generated ID will be used. This value should be 4-64 characters and must match the regular expression ^[a-z0-9-]{4,64}$. Valid characters are [a-z][0-9]-

↳ redactionConfig RedactionConfig

Optional. DLP settings for transcript redaction. Optional, will default to the config specified in Settings.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\Conversation;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The parent resource of the conversation. Please see
 *                                {@see ContactCenterInsightsClient::locationName()} for help formatting this field.
 */
function upload_conversation_sample(string $formattedParent): void
{
    // Create a client.
    $contactCenterInsightsClient = new ContactCenterInsightsClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $conversation = new Conversation();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $contactCenterInsightsClient->uploadConversation($formattedParent, $conversation);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Conversation $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample 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.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = ContactCenterInsightsClient::locationName('[PROJECT]', '[LOCATION]');

    upload_conversation_sample($formattedParent);
}

getOperationsClient

Return an OperationsClient object with the same endpoint as $this.

Returns
TypeDescription
Google\ApiCore\LongRunning\OperationsClient

resumeOperation

Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.

Parameters
NameDescription
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
TypeDescription
Google\ApiCore\OperationResponse

static::analysisName

Formats a string containing the fully-qualified path to represent a analysis resource.

Parameters
NameDescription
project string
location string
conversation string
analysis string
Returns
TypeDescription
stringThe formatted analysis resource.

static::conversationName

Formats a string containing the fully-qualified path to represent a conversation resource.

Parameters
NameDescription
project string
location string
conversation string
Returns
TypeDescription
stringThe formatted conversation resource.

static::conversationProfileName

Formats a string containing the fully-qualified path to represent a conversation_profile resource.

Parameters
NameDescription
project string
location string
conversationProfile string
Returns
TypeDescription
stringThe formatted conversation_profile resource.

static::issueName

Formats a string containing the fully-qualified path to represent a issue resource.

Parameters
NameDescription
project string
location string
issueModel string
issue string
Returns
TypeDescription
stringThe formatted issue resource.

static::issueModelName

Formats a string containing the fully-qualified path to represent a issue_model resource.

Parameters
NameDescription
project string
location string
issueModel string
Returns
TypeDescription
stringThe formatted issue_model resource.

static::locationName

Formats a string containing the fully-qualified path to represent a location resource.

Parameters
NameDescription
project string
location string
Returns
TypeDescription
stringThe formatted location resource.

static::participantName

Formats a string containing the fully-qualified path to represent a participant resource.

Parameters
NameDescription
project string
conversation string
participant string
Returns
TypeDescription
stringThe formatted participant resource.

static::phraseMatcherName

Formats a string containing the fully-qualified path to represent a phrase_matcher resource.

Parameters
NameDescription
project string
location string
phraseMatcher string
Returns
TypeDescription
stringThe formatted phrase_matcher resource.

static::projectConversationParticipantName

Formats a string containing the fully-qualified path to represent a project_conversation_participant resource.

Parameters
NameDescription
project string
conversation string
participant string
Returns
TypeDescription
stringThe formatted project_conversation_participant resource.

static::projectLocationConversationParticipantName

Formats a string containing the fully-qualified path to represent a project_location_conversation_participant resource.

Parameters
NameDescription
project string
location string
conversation string
participant string
Returns
TypeDescription
stringThe formatted project_location_conversation_participant resource.

static::settingsName

Formats a string containing the fully-qualified path to represent a settings resource.

Parameters
NameDescription
project string
location string
Returns
TypeDescription
stringThe formatted settings resource.

static::viewName

Formats a string containing the fully-qualified path to represent a view resource.

Parameters
NameDescription
project string
location string
view string
Returns
TypeDescription
stringThe formatted view resource.

static::parseName

Parses a formatted name string and returns an associative array of the components in the name.

The following name formats are supported: Template: Pattern

  • analysis: projects/{project}/locations/{location}/conversations/{conversation}/analyses/{analysis}
  • conversation: projects/{project}/locations/{location}/conversations/{conversation}
  • conversationProfile: projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}
  • issue: projects/{project}/locations/{location}/issueModels/{issue_model}/issues/{issue}
  • issueModel: projects/{project}/locations/{location}/issueModels/{issue_model}
  • location: projects/{project}/locations/{location}
  • participant: projects/{project}/conversations/{conversation}/participants/{participant}
  • phraseMatcher: projects/{project}/locations/{location}/phraseMatchers/{phrase_matcher}
  • projectConversationParticipant: projects/{project}/conversations/{conversation}/participants/{participant}
  • projectLocationConversationParticipant: projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}
  • settings: projects/{project}/locations/{location}/settings
  • view: projects/{project}/locations/{location}/views/{view}

The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.

Parameters
NameDescription
formattedName string

The formatted name string

template string

Optional name of template to match

Returns
TypeDescription
arrayAn associative array from name component IDs to component values.

Constants

SERVICE_NAME

Value: 'google.cloud.contactcenterinsights.v1.ContactCenterInsights'

The name of the service.

SERVICE_ADDRESS

Value: 'contactcenterinsights.googleapis.com'

The default address of the service.

DEFAULT_SERVICE_PORT

Value: 443

The default port of the service.

CODEGEN_NAME

Value: 'gapic'

The name of the code generator, to be included in the agent header.