-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add import / export IssueModel (#7731)
feat: Add CMEK InitializeLroSpec feat: Add metadata import to IngestConversations feat: Add sampling to IngestConversations docs: Add a comment for valid `order_by` values in ListConversations docs: Add a comment for valid `update_mask` values in UpdateConversation PiperOrigin-RevId: 683188578 Source-Link: googleapis/googleapis@d0eeab3 Source-Link: googleapis/googleapis-gen@4d5b300 Copy-Tag: eyJwIjoiQ29udGFjdENlbnRlckluc2lnaHRzLy5Pd2xCb3QueWFtbCIsImgiOiI0ZDViMzAwYTcyNDljZTI0Mjc4ZmJlNzdjMTY5ODNhMDZkNmU0YTVkIn0=
- Loading branch information
1 parent
4021aec
commit 534f367
Showing
44 changed files
with
3,370 additions
and
38 deletions.
There are no files selected for viewing
Binary file modified
BIN
+2.65 KB
(110%)
ContactCenterInsights/metadata/V1/ContactCenterInsights.php
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
ContactCenterInsights/samples/V1/ContactCenterInsightsClient/export_issue_model.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<?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_ExportIssueModel_sync] | ||
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; | ||
|
||
/** | ||
* Exports an issue model to the provided destination. | ||
* | ||
* @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); | ||
} | ||
// [END contactcenterinsights_v1_generated_ContactCenterInsights_ExportIssueModel_sync] |
71 changes: 71 additions & 0 deletions
71
ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_encryption_spec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?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_GetEncryptionSpec_sync] | ||
use Google\ApiCore\ApiException; | ||
use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient; | ||
use Google\Cloud\ContactCenterInsights\V1\EncryptionSpec; | ||
use Google\Cloud\ContactCenterInsights\V1\GetEncryptionSpecRequest; | ||
|
||
/** | ||
* Gets location-level encryption key specification. | ||
* | ||
* @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); | ||
} | ||
// [END contactcenterinsights_v1_generated_ContactCenterInsights_GetEncryptionSpec_sync] |
83 changes: 83 additions & 0 deletions
83
ContactCenterInsights/samples/V1/ContactCenterInsightsClient/import_issue_model.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_ImportIssueModel_sync] | ||
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; | ||
|
||
/** | ||
* Imports an issue model from a Cloud Storage bucket. | ||
* | ||
* @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); | ||
} | ||
// [END contactcenterinsights_v1_generated_ContactCenterInsights_ImportIssueModel_sync] |
93 changes: 93 additions & 0 deletions
93
ContactCenterInsights/samples/V1/ContactCenterInsightsClient/initialize_encryption_spec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?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_InitializeEncryptionSpec_sync] | ||
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; | ||
|
||
/** | ||
* 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. | ||
* | ||
* @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); | ||
} | ||
// [END contactcenterinsights_v1_generated_ContactCenterInsights_InitializeEncryptionSpec_sync] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.