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.
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.
Namespace
Google \ Cloud \ ContactCenterInsights \ V1 \ ClientMethods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
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 |
↳ 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 |
↳ 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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::bulkAnalyzeConversationsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\BulkAnalyzeConversationsRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\BulkAnalyzeConversationsRequest;
use Google\Cloud\ContactCenterInsights\V1\BulkAnalyzeConversationsResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\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();
// Prepare the request message.
$request = (new BulkAnalyzeConversationsRequest())
->setParent($formattedParent)
->setFilter($filter)
->setAnalysisPercentage($analysisPercentage);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $contactCenterInsightsClient->bulkAnalyzeConversations($request);
$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);
}
bulkDeleteConversations
Deletes multiple conversations in a single request.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::bulkDeleteConversationsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\BulkDeleteConversationsRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\BulkDeleteConversationsRequest;
use Google\Cloud\ContactCenterInsights\V1\BulkDeleteConversationsResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Rpc\Status;
/**
* @param string $formattedParent The parent resource to delete conversations from.
* Format:
* projects/{project}/locations/{location}
* Please see {@see ContactCenterInsightsClient::locationName()} for help formatting this field.
*/
function bulk_delete_conversations_sample(string $formattedParent): void
{
// Create a client.
$contactCenterInsightsClient = new ContactCenterInsightsClient();
// Prepare the request message.
$request = (new BulkDeleteConversationsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $contactCenterInsightsClient->bulkDeleteConversations($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var BulkDeleteConversationsResponse $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]');
bulk_delete_conversations_sample($formattedParent);
}
calculateIssueModelStats
Gets an issue model's statistics.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::calculateIssueModelStatsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\CalculateIssueModelStatsRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\CalculateIssueModelStatsResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\CalculateIssueModelStatsRequest;
use Google\Cloud\ContactCenterInsights\V1\CalculateIssueModelStatsResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\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();
// Prepare the request message.
$request = (new CalculateIssueModelStatsRequest())
->setIssueModel($formattedIssueModel);
// Call the API and handle any network failures.
try {
/** @var CalculateIssueModelStatsResponse $response */
$response = $contactCenterInsightsClient->calculateIssueModelStats($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::calculateStatsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\CalculateStatsRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\CalculateStatsResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\CalculateStatsRequest;
use Google\Cloud\ContactCenterInsights\V1\CalculateStatsResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\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();
// Prepare the request message.
$request = (new CalculateStatsRequest())
->setLocation($formattedLocation);
// Call the API and handle any network failures.
try {
/** @var CalculateStatsResponse $response */
$response = $contactCenterInsightsClient->calculateStats($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::createAnalysisAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\CreateAnalysisRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\Analysis;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\CreateAnalysisRequest;
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 the request message.
$analysis = new Analysis();
$request = (new CreateAnalysisRequest())
->setParent($formattedParent)
->setAnalysis($analysis);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $contactCenterInsightsClient->createAnalysis($request);
$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.
Note that this method does not support audio transcription or redaction.
Use conversations.upload
instead.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::createConversationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\CreateConversationRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\Conversation |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\Conversation;
use Google\Cloud\ContactCenterInsights\V1\CreateConversationRequest;
/**
* @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 the request message.
$conversation = new Conversation();
$request = (new CreateConversationRequest())
->setParent($formattedParent)
->setConversation($conversation);
// Call the API and handle any network failures.
try {
/** @var Conversation $response */
$response = $contactCenterInsightsClient->createConversation($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::createIssueModelAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\CreateIssueModelRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\CreateIssueModelRequest;
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 the request message.
$issueModel = new IssueModel();
$request = (new CreateIssueModelRequest())
->setParent($formattedParent)
->setIssueModel($issueModel);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $contactCenterInsightsClient->createIssueModel($request);
$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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::createPhraseMatcherAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\CreatePhraseMatcherRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\PhraseMatcher |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\CreatePhraseMatcherRequest;
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 the request message.
$phraseMatcher = (new PhraseMatcher())
->setType($phraseMatcherType);
$request = (new CreatePhraseMatcherRequest())
->setParent($formattedParent)
->setPhraseMatcher($phraseMatcher);
// Call the API and handle any network failures.
try {
/** @var PhraseMatcher $response */
$response = $contactCenterInsightsClient->createPhraseMatcher($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::createViewAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\CreateViewRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\View |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\CreateViewRequest;
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 the request message.
$view = new View();
$request = (new CreateViewRequest())
->setParent($formattedParent)
->setView($view);
// Call the API and handle any network failures.
try {
/** @var View $response */
$response = $contactCenterInsightsClient->createView($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::deleteAnalysisAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\DeleteAnalysisRequest
A request to house fields associated with the call. |
callOptions |
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. |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\DeleteAnalysisRequest;
/**
* @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();
// Prepare the request message.
$request = (new DeleteAnalysisRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$contactCenterInsightsClient->deleteAnalysis($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::deleteConversationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\DeleteConversationRequest
A request to house fields associated with the call. |
callOptions |
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. |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\DeleteConversationRequest;
/**
* @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();
// Prepare the request message.
$request = (new DeleteConversationRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$contactCenterInsightsClient->deleteConversation($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::deleteIssueAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\DeleteIssueRequest
A request to house fields associated with the call. |
callOptions |
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. |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\DeleteIssueRequest;
/**
* @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();
// Prepare the request message.
$request = (new DeleteIssueRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$contactCenterInsightsClient->deleteIssue($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::deleteIssueModelAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\DeleteIssueModelRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\DeleteIssueModelRequest;
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();
// Prepare the request message.
$request = (new DeleteIssueModelRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $contactCenterInsightsClient->deleteIssueModel($request);
$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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::deletePhraseMatcherAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\DeletePhraseMatcherRequest
A request to house fields associated with the call. |
callOptions |
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. |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\DeletePhraseMatcherRequest;
/**
* @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();
// Prepare the request message.
$request = (new DeletePhraseMatcherRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$contactCenterInsightsClient->deletePhraseMatcher($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::deleteViewAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\DeleteViewRequest
A request to house fields associated with the call. |
callOptions |
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. |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\DeleteViewRequest;
/**
* @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();
// Prepare the request message.
$request = (new DeleteViewRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$contactCenterInsightsClient->deleteView($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::deployIssueModelAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\DeployIssueModelRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\DeployIssueModelRequest;
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();
// Prepare the request message.
$request = (new DeployIssueModelRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $contactCenterInsightsClient->deployIssueModel($request);
$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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::exportInsightsDataAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\ExportInsightsDataRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\ExportInsightsDataRequest;
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();
// Prepare the request message.
$request = (new ExportInsightsDataRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $contactCenterInsightsClient->exportInsightsData($request);
$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);
}
exportIssueModel
Exports an issue model to the provided destination.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::exportIssueModelAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\ExportIssueModelRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\ExportIssueModelRequest;
use Google\Cloud\ContactCenterInsights\V1\ExportIssueModelResponse;
use Google\Rpc\Status;
/**
* @param string $formattedName The issue model to export. Please see
* {@see ContactCenterInsightsClient::issueModelName()} for help formatting this field.
*/
function export_issue_model_sample(string $formattedName): void
{
// Create a client.
$contactCenterInsightsClient = new ContactCenterInsightsClient();
// Prepare the request message.
$request = (new ExportIssueModelRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $contactCenterInsightsClient->exportIssueModel($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var ExportIssueModelResponse $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]'
);
export_issue_model_sample($formattedName);
}
getAnalysis
Gets an analysis.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::getAnalysisAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\GetAnalysisRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\Analysis |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Analysis;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\GetAnalysisRequest;
/**
* @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();
// Prepare the request message.
$request = (new GetAnalysisRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Analysis $response */
$response = $contactCenterInsightsClient->getAnalysis($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::getConversationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\GetConversationRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\Conversation |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\Conversation;
use Google\Cloud\ContactCenterInsights\V1\GetConversationRequest;
/**
* @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();
// Prepare the request message.
$request = (new GetConversationRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Conversation $response */
$response = $contactCenterInsightsClient->getConversation($request);
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);
}
getEncryptionSpec
Gets location-level encryption key specification.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::getEncryptionSpecAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\GetEncryptionSpecRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\EncryptionSpec |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\EncryptionSpec;
use Google\Cloud\ContactCenterInsights\V1\GetEncryptionSpecRequest;
/**
* @param string $formattedName The name of the encryption spec resource to get. Please see
* {@see ContactCenterInsightsClient::encryptionSpecName()} for help formatting this field.
*/
function get_encryption_spec_sample(string $formattedName): void
{
// Create a client.
$contactCenterInsightsClient = new ContactCenterInsightsClient();
// Prepare the request message.
$request = (new GetEncryptionSpecRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var EncryptionSpec $response */
$response = $contactCenterInsightsClient->getEncryptionSpec($request);
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::encryptionSpecName('[PROJECT]', '[LOCATION]');
get_encryption_spec_sample($formattedName);
}
getIssue
Gets an issue.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::getIssueAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\GetIssueRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\Issue |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\GetIssueRequest;
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();
// Prepare the request message.
$request = (new GetIssueRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Issue $response */
$response = $contactCenterInsightsClient->getIssue($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::getIssueModelAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\GetIssueModelRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\IssueModel |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\GetIssueModelRequest;
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();
// Prepare the request message.
$request = (new GetIssueModelRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var IssueModel $response */
$response = $contactCenterInsightsClient->getIssueModel($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::getPhraseMatcherAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\GetPhraseMatcherRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\PhraseMatcher |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\GetPhraseMatcherRequest;
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();
// Prepare the request message.
$request = (new GetPhraseMatcherRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var PhraseMatcher $response */
$response = $contactCenterInsightsClient->getPhraseMatcher($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::getSettingsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\GetSettingsRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\Settings |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\GetSettingsRequest;
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();
// Prepare the request message.
$request = (new GetSettingsRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Settings $response */
$response = $contactCenterInsightsClient->getSettings($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::getViewAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\GetViewRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\View |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\GetViewRequest;
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();
// Prepare the request message.
$request = (new GetViewRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var View $response */
$response = $contactCenterInsightsClient->getView($request);
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);
}
importIssueModel
Imports an issue model from a Cloud Storage bucket.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::importIssueModelAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\ImportIssueModelRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\ImportIssueModelRequest;
use Google\Cloud\ContactCenterInsights\V1\ImportIssueModelResponse;
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 import_issue_model_sample(string $formattedParent): void
{
// Create a client.
$contactCenterInsightsClient = new ContactCenterInsightsClient();
// Prepare the request message.
$request = (new ImportIssueModelRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $contactCenterInsightsClient->importIssueModel($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var ImportIssueModelResponse $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]');
import_issue_model_sample($formattedParent);
}
ingestConversations
Imports conversations and processes them according to the user's configuration.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::ingestConversationsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\IngestConversationsRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\IngestConversationsRequest;
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();
// Prepare the request message.
$request = (new IngestConversationsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $contactCenterInsightsClient->ingestConversations($request);
$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);
}
initializeEncryptionSpec
Initializes a location-level encryption key specification. An error will be thrown if the location has resources already created before the initialization. Once the encryption specification is initialized at a location, it is immutable and all newly created resources under the location will be encrypted with the existing specification.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::initializeEncryptionSpecAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\InitializeEncryptionSpecRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\EncryptionSpec;
use Google\Cloud\ContactCenterInsights\V1\InitializeEncryptionSpecRequest;
use Google\Cloud\ContactCenterInsights\V1\InitializeEncryptionSpecResponse;
use Google\Rpc\Status;
/**
* @param string $encryptionSpecKmsKey The name of customer-managed encryption key that is used to
* secure a resource and its sub-resources. If empty, the resource is secured
* by the default Google encryption key. Only the key in the same location as
* this resource is allowed to be used for encryption. Format:
* `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}`
*/
function initialize_encryption_spec_sample(string $encryptionSpecKmsKey): void
{
// Create a client.
$contactCenterInsightsClient = new ContactCenterInsightsClient();
// Prepare the request message.
$encryptionSpec = (new EncryptionSpec())
->setKmsKey($encryptionSpecKmsKey);
$request = (new InitializeEncryptionSpecRequest())
->setEncryptionSpec($encryptionSpec);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $contactCenterInsightsClient->initializeEncryptionSpec($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var InitializeEncryptionSpecResponse $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
{
$encryptionSpecKmsKey = '[KMS_KEY]';
initialize_encryption_spec_sample($encryptionSpecKmsKey);
}
listAnalyses
Lists analyses.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::listAnalysesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\ListAnalysesRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ContactCenterInsights\V1\Analysis;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\ListAnalysesRequest;
/**
* @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();
// Prepare the request message.
$request = (new ListAnalysesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $contactCenterInsightsClient->listAnalyses($request);
/** @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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::listConversationsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\ListConversationsRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\Conversation;
use Google\Cloud\ContactCenterInsights\V1\ListConversationsRequest;
/**
* @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();
// Prepare the request message.
$request = (new ListConversationsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $contactCenterInsightsClient->listConversations($request);
/** @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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::listIssueModelsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\ListIssueModelsRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\ListIssueModelsResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\ListIssueModelsRequest;
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();
// Prepare the request message.
$request = (new ListIssueModelsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var ListIssueModelsResponse $response */
$response = $contactCenterInsightsClient->listIssueModels($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::listIssuesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\ListIssuesRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\ListIssuesResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\ListIssuesRequest;
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();
// Prepare the request message.
$request = (new ListIssuesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var ListIssuesResponse $response */
$response = $contactCenterInsightsClient->listIssues($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::listPhraseMatchersAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\ListPhraseMatchersRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\ListPhraseMatchersRequest;
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();
// Prepare the request message.
$request = (new ListPhraseMatchersRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $contactCenterInsightsClient->listPhraseMatchers($request);
/** @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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::listViewsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\ListViewsRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\ListViewsRequest;
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();
// Prepare the request message.
$request = (new ListViewsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $contactCenterInsightsClient->listViews($request);
/** @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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::undeployIssueModelAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\UndeployIssueModelRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\UndeployIssueModelRequest;
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();
// Prepare the request message.
$request = (new UndeployIssueModelRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $contactCenterInsightsClient->undeployIssueModel($request);
$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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::updateConversationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\UpdateConversationRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\Conversation |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\Conversation;
use Google\Cloud\ContactCenterInsights\V1\UpdateConversationRequest;
/**
* 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 the request message.
$conversation = new Conversation();
$request = (new UpdateConversationRequest())
->setConversation($conversation);
// Call the API and handle any network failures.
try {
/** @var Conversation $response */
$response = $contactCenterInsightsClient->updateConversation($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::updateIssueAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\UpdateIssueRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\Issue |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\Issue;
use Google\Cloud\ContactCenterInsights\V1\UpdateIssueRequest;
/**
* 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 the request message.
$issue = new Issue();
$request = (new UpdateIssueRequest())
->setIssue($issue);
// Call the API and handle any network failures.
try {
/** @var Issue $response */
$response = $contactCenterInsightsClient->updateIssue($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::updateIssueModelAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\UpdateIssueModelRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\IssueModel |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\IssueModel;
use Google\Cloud\ContactCenterInsights\V1\UpdateIssueModelRequest;
/**
* 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 the request message.
$issueModel = new IssueModel();
$request = (new UpdateIssueModelRequest())
->setIssueModel($issueModel);
// Call the API and handle any network failures.
try {
/** @var IssueModel $response */
$response = $contactCenterInsightsClient->updateIssueModel($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::updatePhraseMatcherAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\UpdatePhraseMatcherRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\PhraseMatcher |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\PhraseMatcher;
use Google\Cloud\ContactCenterInsights\V1\PhraseMatcher\PhraseMatcherType;
use Google\Cloud\ContactCenterInsights\V1\UpdatePhraseMatcherRequest;
/**
* @param int $phraseMatcherType The type of this phrase matcher.
*/
function update_phrase_matcher_sample(int $phraseMatcherType): void
{
// Create a client.
$contactCenterInsightsClient = new ContactCenterInsightsClient();
// Prepare the request message.
$phraseMatcher = (new PhraseMatcher())
->setType($phraseMatcherType);
$request = (new UpdatePhraseMatcherRequest())
->setPhraseMatcher($phraseMatcher);
// Call the API and handle any network failures.
try {
/** @var PhraseMatcher $response */
$response = $contactCenterInsightsClient->updatePhraseMatcher($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::updateSettingsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\UpdateSettingsRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\Settings |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\Settings;
use Google\Cloud\ContactCenterInsights\V1\UpdateSettingsRequest;
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 the request message.
$settings = new Settings();
$updateMask = new FieldMask();
$request = (new UpdateSettingsRequest())
->setSettings($settings)
->setUpdateMask($updateMask);
// Call the API and handle any network failures.
try {
/** @var Settings $response */
$response = $contactCenterInsightsClient->updateSettings($request);
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.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::updateViewAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\UpdateViewRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\Cloud\ContactCenterInsights\V1\View |
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\UpdateViewRequest;
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 the request message.
$view = new View();
$request = (new UpdateViewRequest())
->setView($view);
// Call the API and handle any network failures.
try {
/** @var View $response */
$response = $contactCenterInsightsClient->updateView($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
uploadConversation
Create a long-running conversation upload operation. This method differs
from CreateConversation
by allowing audio transcription and optional DLP
redaction.
The async variant is Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient::uploadConversationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\UploadConversationRequest
A request to house fields associated with the call. |
callOptions |
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 | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\Conversation;
use Google\Cloud\ContactCenterInsights\V1\UploadConversationRequest;
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 the request message.
$conversation = new Conversation();
$request = (new UploadConversationRequest())
->setParent($formattedParent)
->setConversation($conversation);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $contactCenterInsightsClient->uploadConversation($request);
$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);
}
bulkAnalyzeConversationsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\BulkAnalyzeConversationsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
bulkDeleteConversationsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\BulkDeleteConversationsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
calculateIssueModelStatsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\CalculateIssueModelStatsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\CalculateIssueModelStatsResponse> |
calculateStatsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\CalculateStatsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\CalculateStatsResponse> |
createAnalysisAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\CreateAnalysisRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createConversationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\CreateConversationRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\Conversation> |
createIssueModelAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\CreateIssueModelRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createPhraseMatcherAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\CreatePhraseMatcherRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\PhraseMatcher> |
createViewAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\CreateViewRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\View> |
deleteAnalysisAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\DeleteAnalysisRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<void> |
deleteConversationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\DeleteConversationRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<void> |
deleteIssueAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\DeleteIssueRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<void> |
deleteIssueModelAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\DeleteIssueModelRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deletePhraseMatcherAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\DeletePhraseMatcherRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<void> |
deleteViewAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\DeleteViewRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<void> |
deployIssueModelAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\DeployIssueModelRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
exportInsightsDataAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\ExportInsightsDataRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
exportIssueModelAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\ExportIssueModelRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
getAnalysisAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\GetAnalysisRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\Analysis> |
getConversationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\GetConversationRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\Conversation> |
getEncryptionSpecAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\GetEncryptionSpecRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\EncryptionSpec> |
getIssueAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\GetIssueRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\Issue> |
getIssueModelAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\GetIssueModelRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\IssueModel> |
getPhraseMatcherAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\GetPhraseMatcherRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\PhraseMatcher> |
getSettingsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\GetSettingsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\Settings> |
getViewAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\GetViewRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\View> |
importIssueModelAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\ImportIssueModelRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
ingestConversationsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\IngestConversationsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
initializeEncryptionSpecAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\InitializeEncryptionSpecRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
listAnalysesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\ListAnalysesRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listConversationsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\ListConversationsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listIssueModelsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\ListIssueModelsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\ListIssueModelsResponse> |
listIssuesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\ListIssuesRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\ListIssuesResponse> |
listPhraseMatchersAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\ListPhraseMatchersRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listViewsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\ListViewsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
undeployIssueModelAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\UndeployIssueModelRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateConversationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\UpdateConversationRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\Conversation> |
updateIssueAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\UpdateIssueRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\Issue> |
updateIssueModelAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\UpdateIssueModelRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\IssueModel> |
updatePhraseMatcherAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\UpdatePhraseMatcherRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\PhraseMatcher> |
updateSettingsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\UpdateSettingsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\Settings> |
updateViewAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\UpdateViewRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ContactCenterInsights\V1\View> |
uploadConversationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\ContactCenterInsights\V1\UploadConversationRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
getOperationsClient
Return an OperationsClient object with the same endpoint as $this.
Returns | |
---|---|
Type | Description |
Google\LongRunning\Client\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 | |
---|---|
Name | Description |
operationName |
string
The name of the long running operation |
methodName |
string
The name of the method used to start the operation |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
static::analysisName
Formats a string containing the fully-qualified path to represent a analysis resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
conversation |
string
|
analysis |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted analysis resource. |
static::conversationName
Formats a string containing the fully-qualified path to represent a conversation resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
conversation |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted conversation resource. |
static::conversationProfileName
Formats a string containing the fully-qualified path to represent a conversation_profile resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
conversationProfile |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted conversation_profile resource. |
static::encryptionSpecName
Formats a string containing the fully-qualified path to represent a encryption_spec resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted encryption_spec resource. |
static::issueName
Formats a string containing the fully-qualified path to represent a issue resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
issueModel |
string
|
issue |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted issue resource. |
static::issueModelName
Formats a string containing the fully-qualified path to represent a issue_model resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
issueModel |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted issue_model resource. |
static::locationName
Formats a string containing the fully-qualified path to represent a location resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted location resource. |
static::participantName
Formats a string containing the fully-qualified path to represent a participant resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
conversation |
string
|
participant |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted participant resource. |
static::phraseMatcherName
Formats a string containing the fully-qualified path to represent a phrase_matcher resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
phraseMatcher |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted phrase_matcher resource. |
static::projectConversationParticipantName
Formats a string containing the fully-qualified path to represent a project_conversation_participant resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
conversation |
string
|
participant |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted project_conversation_participant resource. |
static::projectLocationConversationParticipantName
Formats a string containing the fully-qualified path to represent a project_location_conversation_participant resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
conversation |
string
|
participant |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted project_location_conversation_participant resource. |
static::recognizerName
Formats a string containing the fully-qualified path to represent a recognizer resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
recognizer |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted recognizer resource. |
static::settingsName
Formats a string containing the fully-qualified path to represent a settings resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted settings resource. |
static::viewName
Formats a string containing the fully-qualified path to represent a view resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
view |
string
|
Returns | |
---|---|
Type | Description |
string |
The 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}
- encryptionSpec: projects/{project}/locations/{location}/encryptionSpec
- 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}
- recognizer: projects/{project}/locations/{location}/recognizers/{recognizer}
- 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 | |
---|---|
Name | Description |
formattedName |
string
The formatted name string |
template |
string
Optional name of template to match |
Returns | |
---|---|
Type | Description |
array |
An associative array from name component IDs to component values. |