Skip to content

Commit

Permalink
feat: Add FeedbackLabel resource and APIs (#7838)
Browse files Browse the repository at this point in the history
feat: Add QueryMetrics API
feat: Add Quality AI resources and APIs
feat: Add AnalysisRules resource and APIs
docs: A comment for method `InitializeEncryptionSpec` in service `ContactCenterInsights` is changed
docs: A comment for field `custom_metadata_keys` in message `.google.cloud.contactcenterinsights.v1.IngestConversationsRequest` is changed
docs: A comment for field `encryption_spec` in message `.google.cloud.contactcenterinsights.v1.InitializeEncryptionSpecRequest` is changed
docs: A comment for field `partial_errors` in message `.google.cloud.contactcenterinsights.v1.InitializeEncryptionSpecMetadata` is changed
docs: A comment for field `labels` in message `.google.cloud.contactcenterinsights.v1.Conversation` is changed
docs: A comment for field `metadata_json` in message `.google.cloud.contactcenterinsights.v1.Conversation` is changed
docs: A comment for message `EncryptionSpec` is changed
docs: A comment for field `kms_key` in message `.google.cloud.contactcenterinsights.v1.EncryptionSpec` is changed
PiperOrigin-RevId: 696581715
Source-Link: googleapis/googleapis@242a5f1
Source-Link: googleapis/googleapis-gen@1a51252
Copy-Tag: eyJwIjoiQ29udGFjdENlbnRlckluc2lnaHRzLy5Pd2xCb3QueWFtbCIsImgiOiIxYTUxMjUyNTNjM2RiZGQ5MTIyNzhkNDU5MDlhZDZjZmIwMDMxMDg1In0=
  • Loading branch information
gcf-owl-bot[bot] authored Nov 15, 2024
1 parent 5e8cbaf commit 8a5ff92
Show file tree
Hide file tree
Showing 134 changed files with 22,209 additions and 1,190 deletions.
Binary file modified ContactCenterInsights/metadata/V1/ContactCenterInsights.php
Binary file not shown.
Binary file modified ContactCenterInsights/metadata/V1/Resources.php
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?php
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START contactcenterinsights_v1_generated_ContactCenterInsights_BulkDownloadFeedbackLabels_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsRequest;
use Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Rpc\Status;

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

// Prepare the request message.
$request = (new BulkDownloadFeedbackLabelsRequest())
->setParent($formattedParent);

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

if ($response->operationSucceeded()) {
/** @var BulkDownloadFeedbackLabelsResponse $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_download_feedback_labels_sample($formattedParent);
}
// [END contactcenterinsights_v1_generated_ContactCenterInsights_BulkDownloadFeedbackLabels_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?php
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START contactcenterinsights_v1_generated_ContactCenterInsights_BulkUploadFeedbackLabels_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsRequest;
use Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsResponse;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Rpc\Status;

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

// Prepare the request message.
$request = (new BulkUploadFeedbackLabelsRequest())
->setParent($formattedParent);

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

if ($response->operationSucceeded()) {
/** @var BulkUploadFeedbackLabelsResponse $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_upload_feedback_labels_sample($formattedParent);
}
// [END contactcenterinsights_v1_generated_ContactCenterInsights_BulkUploadFeedbackLabels_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?php
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START contactcenterinsights_v1_generated_ContactCenterInsights_CreateAnalysisRule_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\AnalysisRule;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\CreateAnalysisRuleRequest;

/**
* Creates a analysis rule.
*
* @param string $formattedParent The parent resource of the analysis rule. Required. The location
* to create a analysis rule 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_analysis_rule_sample(string $formattedParent): void
{
// Create a client.
$contactCenterInsightsClient = new ContactCenterInsightsClient();

// Prepare the request message.
$analysisRule = new AnalysisRule();
$request = (new CreateAnalysisRuleRequest())
->setParent($formattedParent)
->setAnalysisRule($analysisRule);

// Call the API and handle any network failures.
try {
/** @var AnalysisRule $response */
$response = $contactCenterInsightsClient->createAnalysisRule($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_analysis_rule_sample($formattedParent);
}
// [END contactcenterinsights_v1_generated_ContactCenterInsights_CreateAnalysisRule_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START contactcenterinsights_v1_generated_ContactCenterInsights_CreateFeedbackLabel_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient;
use Google\Cloud\ContactCenterInsights\V1\CreateFeedbackLabelRequest;
use Google\Cloud\ContactCenterInsights\V1\FeedbackLabel;

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

// Prepare the request message.
$feedbackLabel = new FeedbackLabel();
$request = (new CreateFeedbackLabelRequest())
->setParent($formattedParent)
->setFeedbackLabel($feedbackLabel);

// Call the API and handle any network failures.
try {
/** @var FeedbackLabel $response */
$response = $contactCenterInsightsClient->createFeedbackLabel($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::conversationName(
'[PROJECT]',
'[LOCATION]',
'[CONVERSATION]'
);

create_feedback_label_sample($formattedParent);
}
// [END contactcenterinsights_v1_generated_ContactCenterInsights_CreateFeedbackLabel_sync]
Loading

0 comments on commit 8a5ff92

Please sign in to comment.