diff --git a/ContactCenterInsights/metadata/V1/ContactCenterInsights.php b/ContactCenterInsights/metadata/V1/ContactCenterInsights.php index 2e0d9949d501..f59ebb18cacd 100644 Binary files a/ContactCenterInsights/metadata/V1/ContactCenterInsights.php and b/ContactCenterInsights/metadata/V1/ContactCenterInsights.php differ diff --git a/ContactCenterInsights/metadata/V1/Resources.php b/ContactCenterInsights/metadata/V1/Resources.php index d4eaa98b8c3a..4b054a75e4b5 100644 Binary files a/ContactCenterInsights/metadata/V1/Resources.php and b/ContactCenterInsights/metadata/V1/Resources.php differ diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/bulk_download_feedback_labels.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/bulk_download_feedback_labels.php new file mode 100644 index 000000000000..ed6b4850d8b9 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/bulk_download_feedback_labels.php @@ -0,0 +1,83 @@ +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] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/bulk_upload_feedback_labels.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/bulk_upload_feedback_labels.php new file mode 100644 index 000000000000..128d736d8d33 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/bulk_upload_feedback_labels.php @@ -0,0 +1,83 @@ +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] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_analysis_rule.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_analysis_rule.php new file mode 100644 index 000000000000..3bd21367a20e --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_analysis_rule.php @@ -0,0 +1,76 @@ +/locations/` or `projects//locations/` + * 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] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_feedback_label.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_feedback_label.php new file mode 100644 index 000000000000..0a48ac814a39 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_feedback_label.php @@ -0,0 +1,77 @@ +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] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_qa_question.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_qa_question.php new file mode 100644 index 000000000000..515471c6fbc5 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_qa_question.php @@ -0,0 +1,78 @@ +setParent($formattedParent) + ->setQaQuestion($qaQuestion); + + // Call the API and handle any network failures. + try { + /** @var QaQuestion $response */ + $response = $contactCenterInsightsClient->createQaQuestion($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::qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + + create_qa_question_sample($formattedParent); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_CreateQaQuestion_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_qa_scorecard.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_qa_scorecard.php new file mode 100644 index 000000000000..83b0eddf7890 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_qa_scorecard.php @@ -0,0 +1,73 @@ +setParent($formattedParent) + ->setQaScorecard($qaScorecard); + + // Call the API and handle any network failures. + try { + /** @var QaScorecard $response */ + $response = $contactCenterInsightsClient->createQaScorecard($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_qa_scorecard_sample($formattedParent); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_CreateQaScorecard_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_qa_scorecard_revision.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_qa_scorecard_revision.php new file mode 100644 index 000000000000..b1af6e8162be --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_qa_scorecard_revision.php @@ -0,0 +1,77 @@ +setParent($formattedParent) + ->setQaScorecardRevision($qaScorecardRevision); + + // Call the API and handle any network failures. + try { + /** @var QaScorecardRevision $response */ + $response = $contactCenterInsightsClient->createQaScorecardRevision($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::qaScorecardName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]' + ); + + create_qa_scorecard_revision_sample($formattedParent); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_CreateQaScorecardRevision_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/delete_analysis_rule.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/delete_analysis_rule.php new file mode 100644 index 000000000000..6f24f81c3daf --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/delete_analysis_rule.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $contactCenterInsightsClient->deleteAnalysisRule($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::analysisRuleName( + '[PROJECT]', + '[LOCATION]', + '[ANALYSIS_RULE]' + ); + + delete_analysis_rule_sample($formattedName); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_DeleteAnalysisRule_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/delete_feedback_label.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/delete_feedback_label.php new file mode 100644 index 000000000000..82729dd9a9ba --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/delete_feedback_label.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $contactCenterInsightsClient->deleteFeedbackLabel($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::feedbackLabelName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION]', + '[FEEDBACK_LABEL]' + ); + + delete_feedback_label_sample($formattedName); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_DeleteFeedbackLabel_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/delete_qa_question.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/delete_qa_question.php new file mode 100644 index 000000000000..fe00f4fed740 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/delete_qa_question.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $contactCenterInsightsClient->deleteQaQuestion($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::qaQuestionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]', + '[QA_QUESTION]' + ); + + delete_qa_question_sample($formattedName); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_DeleteQaQuestion_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/delete_qa_scorecard.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/delete_qa_scorecard.php new file mode 100644 index 000000000000..ad78e0f38bd4 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/delete_qa_scorecard.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $contactCenterInsightsClient->deleteQaScorecard($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::qaScorecardName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]' + ); + + delete_qa_scorecard_sample($formattedName); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_DeleteQaScorecard_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/delete_qa_scorecard_revision.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/delete_qa_scorecard_revision.php new file mode 100644 index 000000000000..b28417648db2 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/delete_qa_scorecard_revision.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $contactCenterInsightsClient->deleteQaScorecardRevision($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::qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + + delete_qa_scorecard_revision_sample($formattedName); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_DeleteQaScorecardRevision_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/deploy_qa_scorecard_revision.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/deploy_qa_scorecard_revision.php new file mode 100644 index 000000000000..017429700113 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/deploy_qa_scorecard_revision.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var QaScorecardRevision $response */ + $response = $contactCenterInsightsClient->deployQaScorecardRevision($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::qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + + deploy_qa_scorecard_revision_sample($formattedName); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_DeployQaScorecardRevision_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_analysis_rule.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_analysis_rule.php new file mode 100644 index 000000000000..0ae43bbdb365 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_analysis_rule.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var AnalysisRule $response */ + $response = $contactCenterInsightsClient->getAnalysisRule($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::analysisRuleName( + '[PROJECT]', + '[LOCATION]', + '[ANALYSIS_RULE]' + ); + + get_analysis_rule_sample($formattedName); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_GetAnalysisRule_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_feedback_label.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_feedback_label.php new file mode 100644 index 000000000000..07f363f0683a --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_feedback_label.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var FeedbackLabel $response */ + $response = $contactCenterInsightsClient->getFeedbackLabel($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::feedbackLabelName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION]', + '[FEEDBACK_LABEL]' + ); + + get_feedback_label_sample($formattedName); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_GetFeedbackLabel_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_qa_question.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_qa_question.php new file mode 100644 index 000000000000..d9a701498adc --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_qa_question.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var QaQuestion $response */ + $response = $contactCenterInsightsClient->getQaQuestion($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::qaQuestionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]', + '[QA_QUESTION]' + ); + + get_qa_question_sample($formattedName); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_GetQaQuestion_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_qa_scorecard.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_qa_scorecard.php new file mode 100644 index 000000000000..3f0d920a3eb5 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_qa_scorecard.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var QaScorecard $response */ + $response = $contactCenterInsightsClient->getQaScorecard($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::qaScorecardName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]' + ); + + get_qa_scorecard_sample($formattedName); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_GetQaScorecard_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_qa_scorecard_revision.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_qa_scorecard_revision.php new file mode 100644 index 000000000000..82a68781e1f9 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_qa_scorecard_revision.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var QaScorecardRevision $response */ + $response = $contactCenterInsightsClient->getQaScorecardRevision($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::qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + + get_qa_scorecard_revision_sample($formattedName); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_GetQaScorecardRevision_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/initialize_encryption_spec.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/initialize_encryption_spec.php index 044a638387ec..5bccce604c16 100644 --- a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/initialize_encryption_spec.php +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/initialize_encryption_spec.php @@ -32,16 +32,16 @@ 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 + * Initializes a location-level encryption key specification. An error will + * result if the location has resources already created before the + * initialization. After 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: + * by our default 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 diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/list_all_feedback_labels.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/list_all_feedback_labels.php new file mode 100644 index 000000000000..1ae9232d42f8 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/list_all_feedback_labels.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $contactCenterInsightsClient->listAllFeedbackLabels($request); + + /** @var FeedbackLabel $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_all_feedback_labels_sample($formattedParent); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_ListAllFeedbackLabels_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/list_analysis_rules.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/list_analysis_rules.php new file mode 100644 index 000000000000..3e93de4dd18b --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/list_analysis_rules.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $contactCenterInsightsClient->listAnalysisRules($request); + + /** @var AnalysisRule $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_analysis_rules_sample($formattedParent); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_ListAnalysisRules_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/list_feedback_labels.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/list_feedback_labels.php new file mode 100644 index 000000000000..c807dd55c3fe --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/list_feedback_labels.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $contactCenterInsightsClient->listFeedbackLabels($request); + + /** @var FeedbackLabel $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_feedback_labels_sample($formattedParent); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_ListFeedbackLabels_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/list_qa_questions.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/list_qa_questions.php new file mode 100644 index 000000000000..db599ecab5a4 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/list_qa_questions.php @@ -0,0 +1,81 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $contactCenterInsightsClient->listQaQuestions($request); + + /** @var QaQuestion $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::qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + + list_qa_questions_sample($formattedParent); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_ListQaQuestions_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/list_qa_scorecard_revisions.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/list_qa_scorecard_revisions.php new file mode 100644 index 000000000000..834aa6bb97eb --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/list_qa_scorecard_revisions.php @@ -0,0 +1,82 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $contactCenterInsightsClient->listQaScorecardRevisions($request); + + /** @var QaScorecardRevision $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::qaScorecardName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]' + ); + + list_qa_scorecard_revisions_sample($formattedParent); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_ListQaScorecardRevisions_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/list_qa_scorecards.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/list_qa_scorecards.php new file mode 100644 index 000000000000..53b8f075a97d --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/list_qa_scorecards.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $contactCenterInsightsClient->listQaScorecards($request); + + /** @var QaScorecard $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_qa_scorecards_sample($formattedParent); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_ListQaScorecards_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/query_metrics.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/query_metrics.php new file mode 100644 index 000000000000..02a51a83b1d1 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/query_metrics.php @@ -0,0 +1,91 @@ +setLocation($formattedLocation) + ->setFilter($filter); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $contactCenterInsightsClient->queryMetrics($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var QueryMetricsResponse $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 +{ + $formattedLocation = ContactCenterInsightsClient::locationName('[PROJECT]', '[LOCATION]'); + $filter = '[FILTER]'; + + query_metrics_sample($formattedLocation, $filter); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_QueryMetrics_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/tune_qa_scorecard_revision.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/tune_qa_scorecard_revision.php new file mode 100644 index 000000000000..02e1397c8ad0 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/tune_qa_scorecard_revision.php @@ -0,0 +1,94 @@ +setParent($formattedParent) + ->setFilter($filter); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $contactCenterInsightsClient->tuneQaScorecardRevision($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TuneQaScorecardRevisionResponse $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::qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + $filter = '[FILTER]'; + + tune_qa_scorecard_revision_sample($formattedParent, $filter); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_TuneQaScorecardRevision_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/undeploy_qa_scorecard_revision.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/undeploy_qa_scorecard_revision.php new file mode 100644 index 000000000000..1d40c6f82782 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/undeploy_qa_scorecard_revision.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var QaScorecardRevision $response */ + $response = $contactCenterInsightsClient->undeployQaScorecardRevision($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::qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + + undeploy_qa_scorecard_revision_sample($formattedName); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_UndeployQaScorecardRevision_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/update_analysis_rule.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/update_analysis_rule.php new file mode 100644 index 000000000000..fac6fc081c08 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/update_analysis_rule.php @@ -0,0 +1,59 @@ +setAnalysisRule($analysisRule); + + // Call the API and handle any network failures. + try { + /** @var AnalysisRule $response */ + $response = $contactCenterInsightsClient->updateAnalysisRule($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateAnalysisRule_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/update_feedback_label.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/update_feedback_label.php new file mode 100644 index 000000000000..8b4dbca240ed --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/update_feedback_label.php @@ -0,0 +1,62 @@ +setFeedbackLabel($feedbackLabel) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var FeedbackLabel $response */ + $response = $contactCenterInsightsClient->updateFeedbackLabel($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateFeedbackLabel_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/update_qa_question.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/update_qa_question.php new file mode 100644 index 000000000000..c750da1bbef9 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/update_qa_question.php @@ -0,0 +1,62 @@ +setQaQuestion($qaQuestion) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var QaQuestion $response */ + $response = $contactCenterInsightsClient->updateQaQuestion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateQaQuestion_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/update_qa_scorecard.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/update_qa_scorecard.php new file mode 100644 index 000000000000..6846c3910bce --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/update_qa_scorecard.php @@ -0,0 +1,62 @@ +setQaScorecard($qaScorecard) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var QaScorecard $response */ + $response = $contactCenterInsightsClient->updateQaScorecard($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateQaScorecard_sync] diff --git a/ContactCenterInsights/src/V1/AnalysisResult/CallAnalysisMetadata.php b/ContactCenterInsights/src/V1/AnalysisResult/CallAnalysisMetadata.php index e3e9ab449b5f..1f6831be6f6c 100644 --- a/ContactCenterInsights/src/V1/AnalysisResult/CallAnalysisMetadata.php +++ b/ContactCenterInsights/src/V1/AnalysisResult/CallAnalysisMetadata.php @@ -57,6 +57,12 @@ class CallAnalysisMetadata extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.contactcenterinsights.v1.IssueModelResult issue_model_result = 8; */ protected $issue_model_result = null; + /** + * Results of scoring QaScorecards. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaScorecardResult qa_scorecard_results = 10; + */ + private $qa_scorecard_results; /** * Constructor. @@ -78,6 +84,8 @@ class CallAnalysisMetadata extends \Google\Protobuf\Internal\Message * All the matched phrase matchers in the call. * @type \Google\Cloud\ContactCenterInsights\V1\IssueModelResult $issue_model_result * Overall conversation-level issue modeling result. + * @type array<\Google\Cloud\ContactCenterInsights\V1\QaScorecardResult>|\Google\Protobuf\Internal\RepeatedField $qa_scorecard_results + * Results of scoring QaScorecards. * } */ public function __construct($data = NULL) { @@ -287,6 +295,32 @@ public function setIssueModelResult($var) return $this; } + /** + * Results of scoring QaScorecards. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaScorecardResult qa_scorecard_results = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQaScorecardResults() + { + return $this->qa_scorecard_results; + } + + /** + * Results of scoring QaScorecards. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaScorecardResult qa_scorecard_results = 10; + * @param array<\Google\Cloud\ContactCenterInsights\V1\QaScorecardResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQaScorecardResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\QaScorecardResult::class); + $this->qa_scorecard_results = $arr; + + return $this; + } + } diff --git a/ContactCenterInsights/src/V1/AnalysisRule.php b/ContactCenterInsights/src/V1/AnalysisRule.php new file mode 100644 index 000000000000..fa22d6f8b1e1 --- /dev/null +++ b/ContactCenterInsights/src/V1/AnalysisRule.php @@ -0,0 +1,389 @@ +google.cloud.contactcenterinsights.v1.AnalysisRule + */ +class AnalysisRule extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the analysis rule. + * Format: + * projects/{project}/locations/{location}/analysisRules/{analysis_rule} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The time at which this analysis rule was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The most recent time at which this analysis rule was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Display Name of the analysis rule. + * + * Generated from protobuf field optional string display_name = 4; + */ + protected $display_name = null; + /** + * Filter for the conversations that should apply this analysis + * rule. An empty filter means this analysis rule applies to all + * conversations. + * + * Generated from protobuf field string conversation_filter = 5; + */ + protected $conversation_filter = ''; + /** + * Selector of annotators to run and the phrase matchers to use for + * conversations that matches the conversation_filter. If not specified, NO + * annotators will be run. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.AnnotatorSelector annotator_selector = 6; + */ + protected $annotator_selector = null; + /** + * Percentage of conversations that we should apply this analysis setting + * automatically, between [0, 1]. For example, 0.1 means 10%. Conversations + * are sampled in a determenestic way. The original runtime_percentage & + * upload percentage will be replaced by defining filters on the conversation. + * + * Generated from protobuf field double analysis_percentage = 7; + */ + protected $analysis_percentage = 0.0; + /** + * If true, apply this rule to conversations. Otherwise, this rule is + * inactive and saved as a draft. + * + * Generated from protobuf field bool active = 8; + */ + protected $active = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the analysis rule. + * Format: + * projects/{project}/locations/{location}/analysisRules/{analysis_rule} + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time at which this analysis rule was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The most recent time at which this analysis rule was updated. + * @type string $display_name + * Display Name of the analysis rule. + * @type string $conversation_filter + * Filter for the conversations that should apply this analysis + * rule. An empty filter means this analysis rule applies to all + * conversations. + * @type \Google\Cloud\ContactCenterInsights\V1\AnnotatorSelector $annotator_selector + * Selector of annotators to run and the phrase matchers to use for + * conversations that matches the conversation_filter. If not specified, NO + * annotators will be run. + * @type float $analysis_percentage + * Percentage of conversations that we should apply this analysis setting + * automatically, between [0, 1]. For example, 0.1 means 10%. Conversations + * are sampled in a determenestic way. The original runtime_percentage & + * upload percentage will be replaced by defining filters on the conversation. + * @type bool $active + * If true, apply this rule to conversations. Otherwise, this rule is + * inactive and saved as a draft. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the analysis rule. + * Format: + * projects/{project}/locations/{location}/analysisRules/{analysis_rule} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the analysis rule. + * Format: + * projects/{project}/locations/{location}/analysisRules/{analysis_rule} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The time at which this analysis rule was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time at which this analysis rule was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The most recent time at which this analysis rule was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The most recent time at which this analysis rule was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Display Name of the analysis rule. + * + * Generated from protobuf field optional string display_name = 4; + * @return string + */ + public function getDisplayName() + { + return isset($this->display_name) ? $this->display_name : ''; + } + + public function hasDisplayName() + { + return isset($this->display_name); + } + + public function clearDisplayName() + { + unset($this->display_name); + } + + /** + * Display Name of the analysis rule. + * + * Generated from protobuf field optional string display_name = 4; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Filter for the conversations that should apply this analysis + * rule. An empty filter means this analysis rule applies to all + * conversations. + * + * Generated from protobuf field string conversation_filter = 5; + * @return string + */ + public function getConversationFilter() + { + return $this->conversation_filter; + } + + /** + * Filter for the conversations that should apply this analysis + * rule. An empty filter means this analysis rule applies to all + * conversations. + * + * Generated from protobuf field string conversation_filter = 5; + * @param string $var + * @return $this + */ + public function setConversationFilter($var) + { + GPBUtil::checkString($var, True); + $this->conversation_filter = $var; + + return $this; + } + + /** + * Selector of annotators to run and the phrase matchers to use for + * conversations that matches the conversation_filter. If not specified, NO + * annotators will be run. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.AnnotatorSelector annotator_selector = 6; + * @return \Google\Cloud\ContactCenterInsights\V1\AnnotatorSelector|null + */ + public function getAnnotatorSelector() + { + return $this->annotator_selector; + } + + public function hasAnnotatorSelector() + { + return isset($this->annotator_selector); + } + + public function clearAnnotatorSelector() + { + unset($this->annotator_selector); + } + + /** + * Selector of annotators to run and the phrase matchers to use for + * conversations that matches the conversation_filter. If not specified, NO + * annotators will be run. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.AnnotatorSelector annotator_selector = 6; + * @param \Google\Cloud\ContactCenterInsights\V1\AnnotatorSelector $var + * @return $this + */ + public function setAnnotatorSelector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\AnnotatorSelector::class); + $this->annotator_selector = $var; + + return $this; + } + + /** + * Percentage of conversations that we should apply this analysis setting + * automatically, between [0, 1]. For example, 0.1 means 10%. Conversations + * are sampled in a determenestic way. The original runtime_percentage & + * upload percentage will be replaced by defining filters on the conversation. + * + * Generated from protobuf field double analysis_percentage = 7; + * @return float + */ + public function getAnalysisPercentage() + { + return $this->analysis_percentage; + } + + /** + * Percentage of conversations that we should apply this analysis setting + * automatically, between [0, 1]. For example, 0.1 means 10%. Conversations + * are sampled in a determenestic way. The original runtime_percentage & + * upload percentage will be replaced by defining filters on the conversation. + * + * Generated from protobuf field double analysis_percentage = 7; + * @param float $var + * @return $this + */ + public function setAnalysisPercentage($var) + { + GPBUtil::checkDouble($var); + $this->analysis_percentage = $var; + + return $this; + } + + /** + * If true, apply this rule to conversations. Otherwise, this rule is + * inactive and saved as a draft. + * + * Generated from protobuf field bool active = 8; + * @return bool + */ + public function getActive() + { + return $this->active; + } + + /** + * If true, apply this rule to conversations. Otherwise, this rule is + * inactive and saved as a draft. + * + * Generated from protobuf field bool active = 8; + * @param bool $var + * @return $this + */ + public function setActive($var) + { + GPBUtil::checkBool($var); + $this->active = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/AnnotatorSelector.php b/ContactCenterInsights/src/V1/AnnotatorSelector.php index d2548d2c4a3f..3aad7aa50ad1 100644 --- a/ContactCenterInsights/src/V1/AnnotatorSelector.php +++ b/ContactCenterInsights/src/V1/AnnotatorSelector.php @@ -90,6 +90,18 @@ class AnnotatorSelector extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.contactcenterinsights.v1.AnnotatorSelector.SummarizationConfig summarization_config = 11; */ protected $summarization_config = null; + /** + * Whether to run the QA annotator. + * + * Generated from protobuf field bool run_qa_annotator = 12; + */ + protected $run_qa_annotator = false; + /** + * Configuration for the QA annotator. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.AnnotatorSelector.QaConfig qa_config = 13; + */ + protected $qa_config = null; /** * Constructor. @@ -128,6 +140,10 @@ class AnnotatorSelector extends \Google\Protobuf\Internal\Message * Whether to run the summarization annotator. * @type \Google\Cloud\ContactCenterInsights\V1\AnnotatorSelector\SummarizationConfig $summarization_config * Configuration for the summarization annotator. + * @type bool $run_qa_annotator + * Whether to run the QA annotator. + * @type \Google\Cloud\ContactCenterInsights\V1\AnnotatorSelector\QaConfig $qa_config + * Configuration for the QA annotator. * } */ public function __construct($data = NULL) { @@ -449,5 +465,67 @@ public function setSummarizationConfig($var) return $this; } + /** + * Whether to run the QA annotator. + * + * Generated from protobuf field bool run_qa_annotator = 12; + * @return bool + */ + public function getRunQaAnnotator() + { + return $this->run_qa_annotator; + } + + /** + * Whether to run the QA annotator. + * + * Generated from protobuf field bool run_qa_annotator = 12; + * @param bool $var + * @return $this + */ + public function setRunQaAnnotator($var) + { + GPBUtil::checkBool($var); + $this->run_qa_annotator = $var; + + return $this; + } + + /** + * Configuration for the QA annotator. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.AnnotatorSelector.QaConfig qa_config = 13; + * @return \Google\Cloud\ContactCenterInsights\V1\AnnotatorSelector\QaConfig|null + */ + public function getQaConfig() + { + return $this->qa_config; + } + + public function hasQaConfig() + { + return isset($this->qa_config); + } + + public function clearQaConfig() + { + unset($this->qa_config); + } + + /** + * Configuration for the QA annotator. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.AnnotatorSelector.QaConfig qa_config = 13; + * @param \Google\Cloud\ContactCenterInsights\V1\AnnotatorSelector\QaConfig $var + * @return $this + */ + public function setQaConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\AnnotatorSelector\QaConfig::class); + $this->qa_config = $var; + + return $this; + } + } diff --git a/ContactCenterInsights/src/V1/AnnotatorSelector/QaConfig.php b/ContactCenterInsights/src/V1/AnnotatorSelector/QaConfig.php new file mode 100644 index 000000000000..089b76cc1ade --- /dev/null +++ b/ContactCenterInsights/src/V1/AnnotatorSelector/QaConfig.php @@ -0,0 +1,76 @@ +google.cloud.contactcenterinsights.v1.AnnotatorSelector.QaConfig + */ +class QaConfig extends \Google\Protobuf\Internal\Message +{ + protected $scorecard_source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ContactCenterInsights\V1\AnnotatorSelector\QaConfig\ScorecardList $scorecard_list + * A manual list of scorecards to score. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * A manual list of scorecards to score. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.AnnotatorSelector.QaConfig.ScorecardList scorecard_list = 1; + * @return \Google\Cloud\ContactCenterInsights\V1\AnnotatorSelector\QaConfig\ScorecardList|null + */ + public function getScorecardList() + { + return $this->readOneof(1); + } + + public function hasScorecardList() + { + return $this->hasOneof(1); + } + + /** + * A manual list of scorecards to score. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.AnnotatorSelector.QaConfig.ScorecardList scorecard_list = 1; + * @param \Google\Cloud\ContactCenterInsights\V1\AnnotatorSelector\QaConfig\ScorecardList $var + * @return $this + */ + public function setScorecardList($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\AnnotatorSelector\QaConfig\ScorecardList::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getScorecardSource() + { + return $this->whichOneof("scorecard_source"); + } + +} + + diff --git a/ContactCenterInsights/src/V1/AnnotatorSelector/QaConfig/ScorecardList.php b/ContactCenterInsights/src/V1/AnnotatorSelector/QaConfig/ScorecardList.php new file mode 100644 index 000000000000..e39f8bef4e8e --- /dev/null +++ b/ContactCenterInsights/src/V1/AnnotatorSelector/QaConfig/ScorecardList.php @@ -0,0 +1,68 @@ +google.cloud.contactcenterinsights.v1.AnnotatorSelector.QaConfig.ScorecardList + */ +class ScorecardList extends \Google\Protobuf\Internal\Message +{ + /** + * List of QaScorecardRevisions. + * + * Generated from protobuf field repeated string qa_scorecard_revisions = 1 [(.google.api.resource_reference) = { + */ + private $qa_scorecard_revisions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $qa_scorecard_revisions + * List of QaScorecardRevisions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * List of QaScorecardRevisions. + * + * Generated from protobuf field repeated string qa_scorecard_revisions = 1 [(.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQaScorecardRevisions() + { + return $this->qa_scorecard_revisions; + } + + /** + * List of QaScorecardRevisions. + * + * Generated from protobuf field repeated string qa_scorecard_revisions = 1 [(.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQaScorecardRevisions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->qa_scorecard_revisions = $arr; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsMetadata.php b/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsMetadata.php new file mode 100644 index 000000000000..e38087567c5f --- /dev/null +++ b/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsMetadata.php @@ -0,0 +1,247 @@ +google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsMetadata + */ +class BulkDownloadFeedbackLabelsMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. The original request for download. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsRequest request = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $request = null; + /** + * Partial errors during ingest operation that might cause the operation + * output to be incomplete. + * + * Generated from protobuf field repeated .google.rpc.Status partial_errors = 4; + */ + private $partial_errors; + /** + * Output only. Statistics for BulkDownloadFeedbackLabels operation. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsMetadata.DownloadStats download_stats = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $download_stats = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type \Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsRequest $request + * Output only. The original request for download. + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $partial_errors + * Partial errors during ingest operation that might cause the operation + * output to be incomplete. + * @type \Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsMetadata\DownloadStats $download_stats + * Output only. Statistics for BulkDownloadFeedbackLabels operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. The original request for download. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsRequest request = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsRequest|null + */ + public function getRequest() + { + return $this->request; + } + + public function hasRequest() + { + return isset($this->request); + } + + public function clearRequest() + { + unset($this->request); + } + + /** + * Output only. The original request for download. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsRequest request = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsRequest $var + * @return $this + */ + public function setRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsRequest::class); + $this->request = $var; + + return $this; + } + + /** + * Partial errors during ingest operation that might cause the operation + * output to be incomplete. + * + * Generated from protobuf field repeated .google.rpc.Status partial_errors = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPartialErrors() + { + return $this->partial_errors; + } + + /** + * Partial errors during ingest operation that might cause the operation + * output to be incomplete. + * + * Generated from protobuf field repeated .google.rpc.Status partial_errors = 4; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPartialErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->partial_errors = $arr; + + return $this; + } + + /** + * Output only. Statistics for BulkDownloadFeedbackLabels operation. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsMetadata.DownloadStats download_stats = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsMetadata\DownloadStats|null + */ + public function getDownloadStats() + { + return $this->download_stats; + } + + public function hasDownloadStats() + { + return isset($this->download_stats); + } + + public function clearDownloadStats() + { + unset($this->download_stats); + } + + /** + * Output only. Statistics for BulkDownloadFeedbackLabels operation. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsMetadata.DownloadStats download_stats = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsMetadata\DownloadStats $var + * @return $this + */ + public function setDownloadStats($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsMetadata\DownloadStats::class); + $this->download_stats = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsMetadata/DownloadStats.php b/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsMetadata/DownloadStats.php new file mode 100644 index 000000000000..168bc10a0acd --- /dev/null +++ b/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsMetadata/DownloadStats.php @@ -0,0 +1,178 @@ +google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsMetadata.DownloadStats + */ +class DownloadStats extends \Google\Protobuf\Internal\Message +{ + /** + * The number of objects processed during the download operation. + * + * Generated from protobuf field int32 processed_object_count = 1; + */ + protected $processed_object_count = 0; + /** + * The number of new feedback labels downloaded during this operation. + * Different from "processed" because some labels might not be downloaded + * because an error. + * + * Generated from protobuf field int32 successful_download_count = 2; + */ + protected $successful_download_count = 0; + /** + * Total number of files written to the provided Cloud Storage bucket. + * + * Generated from protobuf field int32 total_files_written = 3; + */ + protected $total_files_written = 0; + /** + * Output only. Full name of the files written to Cloud storage. + * + * Generated from protobuf field repeated string file_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $file_names; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $processed_object_count + * The number of objects processed during the download operation. + * @type int $successful_download_count + * The number of new feedback labels downloaded during this operation. + * Different from "processed" because some labels might not be downloaded + * because an error. + * @type int $total_files_written + * Total number of files written to the provided Cloud Storage bucket. + * @type array|\Google\Protobuf\Internal\RepeatedField $file_names + * Output only. Full name of the files written to Cloud storage. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * The number of objects processed during the download operation. + * + * Generated from protobuf field int32 processed_object_count = 1; + * @return int + */ + public function getProcessedObjectCount() + { + return $this->processed_object_count; + } + + /** + * The number of objects processed during the download operation. + * + * Generated from protobuf field int32 processed_object_count = 1; + * @param int $var + * @return $this + */ + public function setProcessedObjectCount($var) + { + GPBUtil::checkInt32($var); + $this->processed_object_count = $var; + + return $this; + } + + /** + * The number of new feedback labels downloaded during this operation. + * Different from "processed" because some labels might not be downloaded + * because an error. + * + * Generated from protobuf field int32 successful_download_count = 2; + * @return int + */ + public function getSuccessfulDownloadCount() + { + return $this->successful_download_count; + } + + /** + * The number of new feedback labels downloaded during this operation. + * Different from "processed" because some labels might not be downloaded + * because an error. + * + * Generated from protobuf field int32 successful_download_count = 2; + * @param int $var + * @return $this + */ + public function setSuccessfulDownloadCount($var) + { + GPBUtil::checkInt32($var); + $this->successful_download_count = $var; + + return $this; + } + + /** + * Total number of files written to the provided Cloud Storage bucket. + * + * Generated from protobuf field int32 total_files_written = 3; + * @return int + */ + public function getTotalFilesWritten() + { + return $this->total_files_written; + } + + /** + * Total number of files written to the provided Cloud Storage bucket. + * + * Generated from protobuf field int32 total_files_written = 3; + * @param int $var + * @return $this + */ + public function setTotalFilesWritten($var) + { + GPBUtil::checkInt32($var); + $this->total_files_written = $var; + + return $this; + } + + /** + * Output only. Full name of the files written to Cloud storage. + * + * Generated from protobuf field repeated string file_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFileNames() + { + return $this->file_names; + } + + /** + * Output only. Full name of the files written to Cloud storage. + * + * Generated from protobuf field repeated string file_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFileNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->file_names = $arr; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsRequest.php b/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsRequest.php new file mode 100644 index 000000000000..1381b1aa78df --- /dev/null +++ b/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsRequest.php @@ -0,0 +1,361 @@ +google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsRequest + */ +class BulkDownloadFeedbackLabelsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource for new feedback labels. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. A filter to reduce results to a specific subset. Supports + * disjunctions (OR) and conjunctions (AND). + * Supported fields: + * * `issue_model_id` + * * `qa_question_id` + * * `qa_scorecard_id` + * * `min_create_time` + * * `max_create_time` + * * `min_update_time` + * * `max_update_time` + * * `feedback_label_type`: QUALITY_AI, TOPIC_MODELING + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Limits the maximum number of feedback labels that will be + * downloaded. The first `N` feedback labels will be downloaded. + * + * Generated from protobuf field int32 max_download_count = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_download_count = 0; + /** + * Optional. The type of feedback labels that will be downloaded. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsRequest.FeedbackLabelType feedback_label_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $feedback_label_type = 0; + /** + * Optional. Filter parent conversations to download feedback labels for. + * When specified, the feedback labels will be downloaded for the + * conversations that match the filter. + * If `template_qa_scorecard_id` is set, all the conversations that match the + * filter will be paired with the questions under the scorecard for labeling. + * + * Generated from protobuf field string conversation_filter = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $conversation_filter = ''; + /** + * Optional. If set, a template for labeling conversations and scorecard + * questions will be created from the conversation_filter and the questions + * under the scorecard(s). The feedback label `filter` will be ignored. + * + * Generated from protobuf field repeated string template_qa_scorecard_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $template_qa_scorecard_id; + protected $destination; + + /** + * @param string $parent Required. The parent resource for new feedback labels. Please see + * {@see ContactCenterInsightsClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsRequest\GcsDestination $gcs_destination + * A cloud storage bucket destination. + * @type string $parent + * Required. The parent resource for new feedback labels. + * @type string $filter + * Optional. A filter to reduce results to a specific subset. Supports + * disjunctions (OR) and conjunctions (AND). + * Supported fields: + * * `issue_model_id` + * * `qa_question_id` + * * `qa_scorecard_id` + * * `min_create_time` + * * `max_create_time` + * * `min_update_time` + * * `max_update_time` + * * `feedback_label_type`: QUALITY_AI, TOPIC_MODELING + * @type int $max_download_count + * Optional. Limits the maximum number of feedback labels that will be + * downloaded. The first `N` feedback labels will be downloaded. + * @type int $feedback_label_type + * Optional. The type of feedback labels that will be downloaded. + * @type string $conversation_filter + * Optional. Filter parent conversations to download feedback labels for. + * When specified, the feedback labels will be downloaded for the + * conversations that match the filter. + * If `template_qa_scorecard_id` is set, all the conversations that match the + * filter will be paired with the questions under the scorecard for labeling. + * @type array|\Google\Protobuf\Internal\RepeatedField $template_qa_scorecard_id + * Optional. If set, a template for labeling conversations and scorecard + * questions will be created from the conversation_filter and the questions + * under the scorecard(s). The feedback label `filter` will be ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * A cloud storage bucket destination. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsRequest.GcsDestination gcs_destination = 3; + * @return \Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsRequest\GcsDestination|null + */ + public function getGcsDestination() + { + return $this->readOneof(3); + } + + public function hasGcsDestination() + { + return $this->hasOneof(3); + } + + /** + * A cloud storage bucket destination. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsRequest.GcsDestination gcs_destination = 3; + * @param \Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsRequest\GcsDestination $var + * @return $this + */ + public function setGcsDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsRequest\GcsDestination::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Required. The parent resource for new feedback labels. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource for new feedback labels. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. A filter to reduce results to a specific subset. Supports + * disjunctions (OR) and conjunctions (AND). + * Supported fields: + * * `issue_model_id` + * * `qa_question_id` + * * `qa_scorecard_id` + * * `min_create_time` + * * `max_create_time` + * * `min_update_time` + * * `max_update_time` + * * `feedback_label_type`: QUALITY_AI, TOPIC_MODELING + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A filter to reduce results to a specific subset. Supports + * disjunctions (OR) and conjunctions (AND). + * Supported fields: + * * `issue_model_id` + * * `qa_question_id` + * * `qa_scorecard_id` + * * `min_create_time` + * * `max_create_time` + * * `min_update_time` + * * `max_update_time` + * * `feedback_label_type`: QUALITY_AI, TOPIC_MODELING + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Limits the maximum number of feedback labels that will be + * downloaded. The first `N` feedback labels will be downloaded. + * + * Generated from protobuf field int32 max_download_count = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMaxDownloadCount() + { + return $this->max_download_count; + } + + /** + * Optional. Limits the maximum number of feedback labels that will be + * downloaded. The first `N` feedback labels will be downloaded. + * + * Generated from protobuf field int32 max_download_count = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMaxDownloadCount($var) + { + GPBUtil::checkInt32($var); + $this->max_download_count = $var; + + return $this; + } + + /** + * Optional. The type of feedback labels that will be downloaded. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsRequest.FeedbackLabelType feedback_label_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getFeedbackLabelType() + { + return $this->feedback_label_type; + } + + /** + * Optional. The type of feedback labels that will be downloaded. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsRequest.FeedbackLabelType feedback_label_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setFeedbackLabelType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsRequest\FeedbackLabelType::class); + $this->feedback_label_type = $var; + + return $this; + } + + /** + * Optional. Filter parent conversations to download feedback labels for. + * When specified, the feedback labels will be downloaded for the + * conversations that match the filter. + * If `template_qa_scorecard_id` is set, all the conversations that match the + * filter will be paired with the questions under the scorecard for labeling. + * + * Generated from protobuf field string conversation_filter = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getConversationFilter() + { + return $this->conversation_filter; + } + + /** + * Optional. Filter parent conversations to download feedback labels for. + * When specified, the feedback labels will be downloaded for the + * conversations that match the filter. + * If `template_qa_scorecard_id` is set, all the conversations that match the + * filter will be paired with the questions under the scorecard for labeling. + * + * Generated from protobuf field string conversation_filter = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setConversationFilter($var) + { + GPBUtil::checkString($var, True); + $this->conversation_filter = $var; + + return $this; + } + + /** + * Optional. If set, a template for labeling conversations and scorecard + * questions will be created from the conversation_filter and the questions + * under the scorecard(s). The feedback label `filter` will be ignored. + * + * Generated from protobuf field repeated string template_qa_scorecard_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTemplateQaScorecardId() + { + return $this->template_qa_scorecard_id; + } + + /** + * Optional. If set, a template for labeling conversations and scorecard + * questions will be created from the conversation_filter and the questions + * under the scorecard(s). The feedback label `filter` will be ignored. + * + * Generated from protobuf field repeated string template_qa_scorecard_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTemplateQaScorecardId($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->template_qa_scorecard_id = $arr; + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsRequest/FeedbackLabelType.php b/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsRequest/FeedbackLabelType.php new file mode 100644 index 000000000000..c61ed5f1fd72 --- /dev/null +++ b/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsRequest/FeedbackLabelType.php @@ -0,0 +1,63 @@ +google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsRequest.FeedbackLabelType + */ +class FeedbackLabelType +{ + /** + * Unspecified format + * + * Generated from protobuf enum FEEDBACK_LABEL_TYPE_UNSPECIFIED = 0; + */ + const FEEDBACK_LABEL_TYPE_UNSPECIFIED = 0; + /** + * Downloaded file will contain all Quality AI labels from the latest + * scorecard revision. + * + * Generated from protobuf enum QUALITY_AI = 1; + */ + const QUALITY_AI = 1; + /** + * Downloaded file will contain only Topic Modeling labels. + * + * Generated from protobuf enum TOPIC_MODELING = 2; + */ + const TOPIC_MODELING = 2; + + private static $valueToName = [ + self::FEEDBACK_LABEL_TYPE_UNSPECIFIED => 'FEEDBACK_LABEL_TYPE_UNSPECIFIED', + self::QUALITY_AI => 'QUALITY_AI', + self::TOPIC_MODELING => 'TOPIC_MODELING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsRequest/GcsDestination.php b/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsRequest/GcsDestination.php new file mode 100644 index 000000000000..1f31b29fc055 --- /dev/null +++ b/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsRequest/GcsDestination.php @@ -0,0 +1,236 @@ +google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsRequest.GcsDestination + */ +class GcsDestination extends \Google\Protobuf\Internal\Message +{ + /** + * Required. File format in which the labels will be exported. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsRequest.GcsDestination.Format format = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $format = 0; + /** + * Required. The Google Cloud Storage URI to write the feedback labels to. + * The file name will be used as a prefix for the files written to the + * bucket if the output needs to be split across multiple files, otherwise + * it will be used as is. The file extension will be appended to the file + * name based on the format selected. + * E.g. `gs://bucket_name/object_uri_prefix` + * + * Generated from protobuf field string object_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $object_uri = ''; + /** + * Optional. Add whitespace to the JSON file. Makes easier to read, but + * increases file size. Only applicable for JSON format. + * + * Generated from protobuf field bool add_whitespace = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $add_whitespace = false; + /** + * Optional. Always print fields with no presence. + * This is useful for printing fields that are not set, like implicit 0 + * value or empty lists/maps. Only applicable for JSON format. + * + * Generated from protobuf field bool always_print_empty_fields = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $always_print_empty_fields = false; + /** + * Optional. The number of records per file. Applicable for either format. + * + * Generated from protobuf field int64 records_per_file_count = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $records_per_file_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $format + * Required. File format in which the labels will be exported. + * @type string $object_uri + * Required. The Google Cloud Storage URI to write the feedback labels to. + * The file name will be used as a prefix for the files written to the + * bucket if the output needs to be split across multiple files, otherwise + * it will be used as is. The file extension will be appended to the file + * name based on the format selected. + * E.g. `gs://bucket_name/object_uri_prefix` + * @type bool $add_whitespace + * Optional. Add whitespace to the JSON file. Makes easier to read, but + * increases file size. Only applicable for JSON format. + * @type bool $always_print_empty_fields + * Optional. Always print fields with no presence. + * This is useful for printing fields that are not set, like implicit 0 + * value or empty lists/maps. Only applicable for JSON format. + * @type int|string $records_per_file_count + * Optional. The number of records per file. Applicable for either format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. File format in which the labels will be exported. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsRequest.GcsDestination.Format format = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getFormat() + { + return $this->format; + } + + /** + * Required. File format in which the labels will be exported. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsRequest.GcsDestination.Format format = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setFormat($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsRequest\GcsDestination\Format::class); + $this->format = $var; + + return $this; + } + + /** + * Required. The Google Cloud Storage URI to write the feedback labels to. + * The file name will be used as a prefix for the files written to the + * bucket if the output needs to be split across multiple files, otherwise + * it will be used as is. The file extension will be appended to the file + * name based on the format selected. + * E.g. `gs://bucket_name/object_uri_prefix` + * + * Generated from protobuf field string object_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getObjectUri() + { + return $this->object_uri; + } + + /** + * Required. The Google Cloud Storage URI to write the feedback labels to. + * The file name will be used as a prefix for the files written to the + * bucket if the output needs to be split across multiple files, otherwise + * it will be used as is. The file extension will be appended to the file + * name based on the format selected. + * E.g. `gs://bucket_name/object_uri_prefix` + * + * Generated from protobuf field string object_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setObjectUri($var) + { + GPBUtil::checkString($var, True); + $this->object_uri = $var; + + return $this; + } + + /** + * Optional. Add whitespace to the JSON file. Makes easier to read, but + * increases file size. Only applicable for JSON format. + * + * Generated from protobuf field bool add_whitespace = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAddWhitespace() + { + return $this->add_whitespace; + } + + /** + * Optional. Add whitespace to the JSON file. Makes easier to read, but + * increases file size. Only applicable for JSON format. + * + * Generated from protobuf field bool add_whitespace = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAddWhitespace($var) + { + GPBUtil::checkBool($var); + $this->add_whitespace = $var; + + return $this; + } + + /** + * Optional. Always print fields with no presence. + * This is useful for printing fields that are not set, like implicit 0 + * value or empty lists/maps. Only applicable for JSON format. + * + * Generated from protobuf field bool always_print_empty_fields = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAlwaysPrintEmptyFields() + { + return $this->always_print_empty_fields; + } + + /** + * Optional. Always print fields with no presence. + * This is useful for printing fields that are not set, like implicit 0 + * value or empty lists/maps. Only applicable for JSON format. + * + * Generated from protobuf field bool always_print_empty_fields = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAlwaysPrintEmptyFields($var) + { + GPBUtil::checkBool($var); + $this->always_print_empty_fields = $var; + + return $this; + } + + /** + * Optional. The number of records per file. Applicable for either format. + * + * Generated from protobuf field int64 records_per_file_count = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getRecordsPerFileCount() + { + return $this->records_per_file_count; + } + + /** + * Optional. The number of records per file. Applicable for either format. + * + * Generated from protobuf field int64 records_per_file_count = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setRecordsPerFileCount($var) + { + GPBUtil::checkInt64($var); + $this->records_per_file_count = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsRequest/GcsDestination/Format.php b/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsRequest/GcsDestination/Format.php new file mode 100644 index 000000000000..18d453abd897 --- /dev/null +++ b/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsRequest/GcsDestination/Format.php @@ -0,0 +1,66 @@ +google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsRequest.GcsDestination.Format + */ +class Format +{ + /** + * Unspecified format. + * + * Generated from protobuf enum FORMAT_UNSPECIFIED = 0; + */ + const FORMAT_UNSPECIFIED = 0; + /** + * CSV format. + * 1,000 labels are stored per CSV file by default. + * + * Generated from protobuf enum CSV = 1; + */ + const CSV = 1; + /** + * JSON format. + * 1 label stored per JSON file by default. + * + * Generated from protobuf enum JSON = 2; + */ + const JSON = 2; + + private static $valueToName = [ + self::FORMAT_UNSPECIFIED => 'FORMAT_UNSPECIFIED', + self::CSV => 'CSV', + self::JSON => 'JSON', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsResponse.php b/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsResponse.php new file mode 100644 index 000000000000..8c490ff1c3df --- /dev/null +++ b/ContactCenterInsights/src/V1/BulkDownloadFeedbackLabelsResponse.php @@ -0,0 +1,33 @@ +google.cloud.contactcenterinsights.v1.BulkDownloadFeedbackLabelsResponse + */ +class BulkDownloadFeedbackLabelsResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + +} + diff --git a/ContactCenterInsights/src/V1/BulkUploadFeedbackLabelsMetadata.php b/ContactCenterInsights/src/V1/BulkUploadFeedbackLabelsMetadata.php new file mode 100644 index 000000000000..25939a72557a --- /dev/null +++ b/ContactCenterInsights/src/V1/BulkUploadFeedbackLabelsMetadata.php @@ -0,0 +1,247 @@ +google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsMetadata + */ +class BulkUploadFeedbackLabelsMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. The original request for ingest. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsRequest request = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $request = null; + /** + * Partial errors during ingest operation that might cause the operation + * output to be incomplete. + * + * Generated from protobuf field repeated .google.rpc.Status partial_errors = 4; + */ + private $partial_errors; + /** + * Output only. Statistics for BulkUploadFeedbackLabels operation. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsMetadata.UploadStats upload_stats = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $upload_stats = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type \Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsRequest $request + * Output only. The original request for ingest. + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $partial_errors + * Partial errors during ingest operation that might cause the operation + * output to be incomplete. + * @type \Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsMetadata\UploadStats $upload_stats + * Output only. Statistics for BulkUploadFeedbackLabels operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. The original request for ingest. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsRequest request = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsRequest|null + */ + public function getRequest() + { + return $this->request; + } + + public function hasRequest() + { + return isset($this->request); + } + + public function clearRequest() + { + unset($this->request); + } + + /** + * Output only. The original request for ingest. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsRequest request = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsRequest $var + * @return $this + */ + public function setRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsRequest::class); + $this->request = $var; + + return $this; + } + + /** + * Partial errors during ingest operation that might cause the operation + * output to be incomplete. + * + * Generated from protobuf field repeated .google.rpc.Status partial_errors = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPartialErrors() + { + return $this->partial_errors; + } + + /** + * Partial errors during ingest operation that might cause the operation + * output to be incomplete. + * + * Generated from protobuf field repeated .google.rpc.Status partial_errors = 4; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPartialErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->partial_errors = $arr; + + return $this; + } + + /** + * Output only. Statistics for BulkUploadFeedbackLabels operation. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsMetadata.UploadStats upload_stats = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsMetadata\UploadStats|null + */ + public function getUploadStats() + { + return $this->upload_stats; + } + + public function hasUploadStats() + { + return isset($this->upload_stats); + } + + public function clearUploadStats() + { + unset($this->upload_stats); + } + + /** + * Output only. Statistics for BulkUploadFeedbackLabels operation. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsMetadata.UploadStats upload_stats = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsMetadata\UploadStats $var + * @return $this + */ + public function setUploadStats($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsMetadata\UploadStats::class); + $this->upload_stats = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/BulkUploadFeedbackLabelsMetadata/UploadStats.php b/ContactCenterInsights/src/V1/BulkUploadFeedbackLabelsMetadata/UploadStats.php new file mode 100644 index 000000000000..609437df4f25 --- /dev/null +++ b/ContactCenterInsights/src/V1/BulkUploadFeedbackLabelsMetadata/UploadStats.php @@ -0,0 +1,136 @@ +google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsMetadata.UploadStats + */ +class UploadStats extends \Google\Protobuf\Internal\Message +{ + /** + * The number of objects processed during the upload operation. + * + * Generated from protobuf field int32 processed_object_count = 1; + */ + protected $processed_object_count = 0; + /** + * The number of objects skipped because of failed validation + * + * Generated from protobuf field int32 failed_validation_count = 2; + */ + protected $failed_validation_count = 0; + /** + * The number of new feedback labels added during this ingest operation. + * + * Generated from protobuf field int32 successful_upload_count = 3; + */ + protected $successful_upload_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $processed_object_count + * The number of objects processed during the upload operation. + * @type int $failed_validation_count + * The number of objects skipped because of failed validation + * @type int $successful_upload_count + * The number of new feedback labels added during this ingest operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * The number of objects processed during the upload operation. + * + * Generated from protobuf field int32 processed_object_count = 1; + * @return int + */ + public function getProcessedObjectCount() + { + return $this->processed_object_count; + } + + /** + * The number of objects processed during the upload operation. + * + * Generated from protobuf field int32 processed_object_count = 1; + * @param int $var + * @return $this + */ + public function setProcessedObjectCount($var) + { + GPBUtil::checkInt32($var); + $this->processed_object_count = $var; + + return $this; + } + + /** + * The number of objects skipped because of failed validation + * + * Generated from protobuf field int32 failed_validation_count = 2; + * @return int + */ + public function getFailedValidationCount() + { + return $this->failed_validation_count; + } + + /** + * The number of objects skipped because of failed validation + * + * Generated from protobuf field int32 failed_validation_count = 2; + * @param int $var + * @return $this + */ + public function setFailedValidationCount($var) + { + GPBUtil::checkInt32($var); + $this->failed_validation_count = $var; + + return $this; + } + + /** + * The number of new feedback labels added during this ingest operation. + * + * Generated from protobuf field int32 successful_upload_count = 3; + * @return int + */ + public function getSuccessfulUploadCount() + { + return $this->successful_upload_count; + } + + /** + * The number of new feedback labels added during this ingest operation. + * + * Generated from protobuf field int32 successful_upload_count = 3; + * @param int $var + * @return $this + */ + public function setSuccessfulUploadCount($var) + { + GPBUtil::checkInt32($var); + $this->successful_upload_count = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/BulkUploadFeedbackLabelsRequest.php b/ContactCenterInsights/src/V1/BulkUploadFeedbackLabelsRequest.php new file mode 100644 index 000000000000..dd4871d7e536 --- /dev/null +++ b/ContactCenterInsights/src/V1/BulkUploadFeedbackLabelsRequest.php @@ -0,0 +1,165 @@ +google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsRequest + */ +class BulkUploadFeedbackLabelsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource for new feedback labels. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. If set, upload will not happen and the labels will be validated. + * If not set, then default behavior will be to upload the labels after + * validation is complete. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + protected $source; + + /** + * @param string $parent Required. The parent resource for new feedback labels. Please see + * {@see ContactCenterInsightsClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsRequest\GcsSource $gcs_source + * A cloud storage bucket source. + * @type string $parent + * Required. The parent resource for new feedback labels. + * @type bool $validate_only + * Optional. If set, upload will not happen and the labels will be validated. + * If not set, then default behavior will be to upload the labels after + * validation is complete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * A cloud storage bucket source. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsRequest.GcsSource gcs_source = 2; + * @return \Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsRequest\GcsSource|null + */ + public function getGcsSource() + { + return $this->readOneof(2); + } + + public function hasGcsSource() + { + return $this->hasOneof(2); + } + + /** + * A cloud storage bucket source. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsRequest.GcsSource gcs_source = 2; + * @param \Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsRequest\GcsSource $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsRequest\GcsSource::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Required. The parent resource for new feedback labels. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource for new feedback labels. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. If set, upload will not happen and the labels will be validated. + * If not set, then default behavior will be to upload the labels after + * validation is complete. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, upload will not happen and the labels will be validated. + * If not set, then default behavior will be to upload the labels after + * validation is complete. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/ContactCenterInsights/src/V1/BulkUploadFeedbackLabelsRequest/GcsSource.php b/ContactCenterInsights/src/V1/BulkUploadFeedbackLabelsRequest/GcsSource.php new file mode 100644 index 000000000000..bbf5e91f1024 --- /dev/null +++ b/ContactCenterInsights/src/V1/BulkUploadFeedbackLabelsRequest/GcsSource.php @@ -0,0 +1,106 @@ +google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsRequest.GcsSource + */ +class GcsSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. File format which will be ingested. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsRequest.GcsSource.Format format = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $format = 0; + /** + * Required. The Google Cloud Storage URI of the file to import. + * Format: `gs://bucket_name/object_name` + * + * Generated from protobuf field string object_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $object_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $format + * Required. File format which will be ingested. + * @type string $object_uri + * Required. The Google Cloud Storage URI of the file to import. + * Format: `gs://bucket_name/object_name` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. File format which will be ingested. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsRequest.GcsSource.Format format = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getFormat() + { + return $this->format; + } + + /** + * Required. File format which will be ingested. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsRequest.GcsSource.Format format = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setFormat($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsRequest\GcsSource\Format::class); + $this->format = $var; + + return $this; + } + + /** + * Required. The Google Cloud Storage URI of the file to import. + * Format: `gs://bucket_name/object_name` + * + * Generated from protobuf field string object_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getObjectUri() + { + return $this->object_uri; + } + + /** + * Required. The Google Cloud Storage URI of the file to import. + * Format: `gs://bucket_name/object_name` + * + * Generated from protobuf field string object_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setObjectUri($var) + { + GPBUtil::checkString($var, True); + $this->object_uri = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/BulkUploadFeedbackLabelsRequest/GcsSource/Format.php b/ContactCenterInsights/src/V1/BulkUploadFeedbackLabelsRequest/GcsSource/Format.php new file mode 100644 index 000000000000..e45b99d5ec02 --- /dev/null +++ b/ContactCenterInsights/src/V1/BulkUploadFeedbackLabelsRequest/GcsSource/Format.php @@ -0,0 +1,62 @@ +google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsRequest.GcsSource.Format + */ +class Format +{ + /** + * Unspecified format. + * + * Generated from protobuf enum FORMAT_UNSPECIFIED = 0; + */ + const FORMAT_UNSPECIFIED = 0; + /** + * CSV format. + * + * Generated from protobuf enum CSV = 1; + */ + const CSV = 1; + /** + * JSON format. + * + * Generated from protobuf enum JSON = 2; + */ + const JSON = 2; + + private static $valueToName = [ + self::FORMAT_UNSPECIFIED => 'FORMAT_UNSPECIFIED', + self::CSV => 'CSV', + self::JSON => 'JSON', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ContactCenterInsights/src/V1/BulkUploadFeedbackLabelsResponse.php b/ContactCenterInsights/src/V1/BulkUploadFeedbackLabelsResponse.php new file mode 100644 index 000000000000..284bebd4c3fa --- /dev/null +++ b/ContactCenterInsights/src/V1/BulkUploadFeedbackLabelsResponse.php @@ -0,0 +1,33 @@ +google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsResponse + */ +class BulkUploadFeedbackLabelsResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + +} + diff --git a/ContactCenterInsights/src/V1/Client/ContactCenterInsightsClient.php b/ContactCenterInsights/src/V1/Client/ContactCenterInsightsClient.php index 7a341cd1e74a..03d6866af713 100644 --- a/ContactCenterInsights/src/V1/Client/ContactCenterInsightsClient.php +++ b/ContactCenterInsights/src/V1/Client/ContactCenterInsightsClient.php @@ -35,34 +35,54 @@ use Google\ApiCore\ValidationException; use Google\Auth\FetchAuthTokenInterface; use Google\Cloud\ContactCenterInsights\V1\Analysis; +use Google\Cloud\ContactCenterInsights\V1\AnalysisRule; use Google\Cloud\ContactCenterInsights\V1\BulkAnalyzeConversationsRequest; use Google\Cloud\ContactCenterInsights\V1\BulkDeleteConversationsRequest; +use Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsRequest; +use Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsRequest; use Google\Cloud\ContactCenterInsights\V1\CalculateIssueModelStatsRequest; use Google\Cloud\ContactCenterInsights\V1\CalculateIssueModelStatsResponse; use Google\Cloud\ContactCenterInsights\V1\CalculateStatsRequest; use Google\Cloud\ContactCenterInsights\V1\CalculateStatsResponse; use Google\Cloud\ContactCenterInsights\V1\Conversation; use Google\Cloud\ContactCenterInsights\V1\CreateAnalysisRequest; +use Google\Cloud\ContactCenterInsights\V1\CreateAnalysisRuleRequest; use Google\Cloud\ContactCenterInsights\V1\CreateConversationRequest; +use Google\Cloud\ContactCenterInsights\V1\CreateFeedbackLabelRequest; use Google\Cloud\ContactCenterInsights\V1\CreateIssueModelRequest; use Google\Cloud\ContactCenterInsights\V1\CreatePhraseMatcherRequest; +use Google\Cloud\ContactCenterInsights\V1\CreateQaQuestionRequest; +use Google\Cloud\ContactCenterInsights\V1\CreateQaScorecardRequest; +use Google\Cloud\ContactCenterInsights\V1\CreateQaScorecardRevisionRequest; use Google\Cloud\ContactCenterInsights\V1\CreateViewRequest; use Google\Cloud\ContactCenterInsights\V1\DeleteAnalysisRequest; +use Google\Cloud\ContactCenterInsights\V1\DeleteAnalysisRuleRequest; use Google\Cloud\ContactCenterInsights\V1\DeleteConversationRequest; +use Google\Cloud\ContactCenterInsights\V1\DeleteFeedbackLabelRequest; use Google\Cloud\ContactCenterInsights\V1\DeleteIssueModelRequest; use Google\Cloud\ContactCenterInsights\V1\DeleteIssueRequest; use Google\Cloud\ContactCenterInsights\V1\DeletePhraseMatcherRequest; +use Google\Cloud\ContactCenterInsights\V1\DeleteQaQuestionRequest; +use Google\Cloud\ContactCenterInsights\V1\DeleteQaScorecardRequest; +use Google\Cloud\ContactCenterInsights\V1\DeleteQaScorecardRevisionRequest; use Google\Cloud\ContactCenterInsights\V1\DeleteViewRequest; use Google\Cloud\ContactCenterInsights\V1\DeployIssueModelRequest; +use Google\Cloud\ContactCenterInsights\V1\DeployQaScorecardRevisionRequest; use Google\Cloud\ContactCenterInsights\V1\EncryptionSpec; use Google\Cloud\ContactCenterInsights\V1\ExportInsightsDataRequest; use Google\Cloud\ContactCenterInsights\V1\ExportIssueModelRequest; +use Google\Cloud\ContactCenterInsights\V1\FeedbackLabel; use Google\Cloud\ContactCenterInsights\V1\GetAnalysisRequest; +use Google\Cloud\ContactCenterInsights\V1\GetAnalysisRuleRequest; use Google\Cloud\ContactCenterInsights\V1\GetConversationRequest; use Google\Cloud\ContactCenterInsights\V1\GetEncryptionSpecRequest; +use Google\Cloud\ContactCenterInsights\V1\GetFeedbackLabelRequest; use Google\Cloud\ContactCenterInsights\V1\GetIssueModelRequest; use Google\Cloud\ContactCenterInsights\V1\GetIssueRequest; use Google\Cloud\ContactCenterInsights\V1\GetPhraseMatcherRequest; +use Google\Cloud\ContactCenterInsights\V1\GetQaQuestionRequest; +use Google\Cloud\ContactCenterInsights\V1\GetQaScorecardRequest; +use Google\Cloud\ContactCenterInsights\V1\GetQaScorecardRevisionRequest; use Google\Cloud\ContactCenterInsights\V1\GetSettingsRequest; use Google\Cloud\ContactCenterInsights\V1\GetViewRequest; use Google\Cloud\ContactCenterInsights\V1\ImportIssueModelRequest; @@ -70,21 +90,37 @@ use Google\Cloud\ContactCenterInsights\V1\InitializeEncryptionSpecRequest; use Google\Cloud\ContactCenterInsights\V1\Issue; use Google\Cloud\ContactCenterInsights\V1\IssueModel; +use Google\Cloud\ContactCenterInsights\V1\ListAllFeedbackLabelsRequest; use Google\Cloud\ContactCenterInsights\V1\ListAnalysesRequest; +use Google\Cloud\ContactCenterInsights\V1\ListAnalysisRulesRequest; use Google\Cloud\ContactCenterInsights\V1\ListConversationsRequest; +use Google\Cloud\ContactCenterInsights\V1\ListFeedbackLabelsRequest; use Google\Cloud\ContactCenterInsights\V1\ListIssueModelsRequest; use Google\Cloud\ContactCenterInsights\V1\ListIssueModelsResponse; use Google\Cloud\ContactCenterInsights\V1\ListIssuesRequest; use Google\Cloud\ContactCenterInsights\V1\ListIssuesResponse; use Google\Cloud\ContactCenterInsights\V1\ListPhraseMatchersRequest; +use Google\Cloud\ContactCenterInsights\V1\ListQaQuestionsRequest; +use Google\Cloud\ContactCenterInsights\V1\ListQaScorecardRevisionsRequest; +use Google\Cloud\ContactCenterInsights\V1\ListQaScorecardsRequest; use Google\Cloud\ContactCenterInsights\V1\ListViewsRequest; use Google\Cloud\ContactCenterInsights\V1\PhraseMatcher; +use Google\Cloud\ContactCenterInsights\V1\QaQuestion; +use Google\Cloud\ContactCenterInsights\V1\QaScorecard; +use Google\Cloud\ContactCenterInsights\V1\QaScorecardRevision; +use Google\Cloud\ContactCenterInsights\V1\QueryMetricsRequest; use Google\Cloud\ContactCenterInsights\V1\Settings; +use Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionRequest; use Google\Cloud\ContactCenterInsights\V1\UndeployIssueModelRequest; +use Google\Cloud\ContactCenterInsights\V1\UndeployQaScorecardRevisionRequest; +use Google\Cloud\ContactCenterInsights\V1\UpdateAnalysisRuleRequest; use Google\Cloud\ContactCenterInsights\V1\UpdateConversationRequest; +use Google\Cloud\ContactCenterInsights\V1\UpdateFeedbackLabelRequest; use Google\Cloud\ContactCenterInsights\V1\UpdateIssueModelRequest; use Google\Cloud\ContactCenterInsights\V1\UpdateIssueRequest; use Google\Cloud\ContactCenterInsights\V1\UpdatePhraseMatcherRequest; +use Google\Cloud\ContactCenterInsights\V1\UpdateQaQuestionRequest; +use Google\Cloud\ContactCenterInsights\V1\UpdateQaScorecardRequest; use Google\Cloud\ContactCenterInsights\V1\UpdateSettingsRequest; use Google\Cloud\ContactCenterInsights\V1\UpdateViewRequest; use Google\Cloud\ContactCenterInsights\V1\UploadConversationRequest; @@ -106,44 +142,75 @@ * * @method PromiseInterface bulkAnalyzeConversationsAsync(BulkAnalyzeConversationsRequest $request, array $optionalArgs = []) * @method PromiseInterface bulkDeleteConversationsAsync(BulkDeleteConversationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface bulkDownloadFeedbackLabelsAsync(BulkDownloadFeedbackLabelsRequest $request, array $optionalArgs = []) + * @method PromiseInterface bulkUploadFeedbackLabelsAsync(BulkUploadFeedbackLabelsRequest $request, array $optionalArgs = []) * @method PromiseInterface calculateIssueModelStatsAsync(CalculateIssueModelStatsRequest $request, array $optionalArgs = []) * @method PromiseInterface calculateStatsAsync(CalculateStatsRequest $request, array $optionalArgs = []) * @method PromiseInterface createAnalysisAsync(CreateAnalysisRequest $request, array $optionalArgs = []) + * @method PromiseInterface createAnalysisRuleAsync(CreateAnalysisRuleRequest $request, array $optionalArgs = []) * @method PromiseInterface createConversationAsync(CreateConversationRequest $request, array $optionalArgs = []) + * @method PromiseInterface createFeedbackLabelAsync(CreateFeedbackLabelRequest $request, array $optionalArgs = []) * @method PromiseInterface createIssueModelAsync(CreateIssueModelRequest $request, array $optionalArgs = []) * @method PromiseInterface createPhraseMatcherAsync(CreatePhraseMatcherRequest $request, array $optionalArgs = []) + * @method PromiseInterface createQaQuestionAsync(CreateQaQuestionRequest $request, array $optionalArgs = []) + * @method PromiseInterface createQaScorecardAsync(CreateQaScorecardRequest $request, array $optionalArgs = []) + * @method PromiseInterface createQaScorecardRevisionAsync(CreateQaScorecardRevisionRequest $request, array $optionalArgs = []) * @method PromiseInterface createViewAsync(CreateViewRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteAnalysisAsync(DeleteAnalysisRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAnalysisRuleAsync(DeleteAnalysisRuleRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteConversationAsync(DeleteConversationRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteFeedbackLabelAsync(DeleteFeedbackLabelRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteIssueAsync(DeleteIssueRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteIssueModelAsync(DeleteIssueModelRequest $request, array $optionalArgs = []) * @method PromiseInterface deletePhraseMatcherAsync(DeletePhraseMatcherRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteQaQuestionAsync(DeleteQaQuestionRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteQaScorecardAsync(DeleteQaScorecardRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteQaScorecardRevisionAsync(DeleteQaScorecardRevisionRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteViewAsync(DeleteViewRequest $request, array $optionalArgs = []) * @method PromiseInterface deployIssueModelAsync(DeployIssueModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface deployQaScorecardRevisionAsync(DeployQaScorecardRevisionRequest $request, array $optionalArgs = []) * @method PromiseInterface exportInsightsDataAsync(ExportInsightsDataRequest $request, array $optionalArgs = []) * @method PromiseInterface exportIssueModelAsync(ExportIssueModelRequest $request, array $optionalArgs = []) * @method PromiseInterface getAnalysisAsync(GetAnalysisRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAnalysisRuleAsync(GetAnalysisRuleRequest $request, array $optionalArgs = []) * @method PromiseInterface getConversationAsync(GetConversationRequest $request, array $optionalArgs = []) * @method PromiseInterface getEncryptionSpecAsync(GetEncryptionSpecRequest $request, array $optionalArgs = []) + * @method PromiseInterface getFeedbackLabelAsync(GetFeedbackLabelRequest $request, array $optionalArgs = []) * @method PromiseInterface getIssueAsync(GetIssueRequest $request, array $optionalArgs = []) * @method PromiseInterface getIssueModelAsync(GetIssueModelRequest $request, array $optionalArgs = []) * @method PromiseInterface getPhraseMatcherAsync(GetPhraseMatcherRequest $request, array $optionalArgs = []) + * @method PromiseInterface getQaQuestionAsync(GetQaQuestionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getQaScorecardAsync(GetQaScorecardRequest $request, array $optionalArgs = []) + * @method PromiseInterface getQaScorecardRevisionAsync(GetQaScorecardRevisionRequest $request, array $optionalArgs = []) * @method PromiseInterface getSettingsAsync(GetSettingsRequest $request, array $optionalArgs = []) * @method PromiseInterface getViewAsync(GetViewRequest $request, array $optionalArgs = []) * @method PromiseInterface importIssueModelAsync(ImportIssueModelRequest $request, array $optionalArgs = []) * @method PromiseInterface ingestConversationsAsync(IngestConversationsRequest $request, array $optionalArgs = []) * @method PromiseInterface initializeEncryptionSpecAsync(InitializeEncryptionSpecRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAllFeedbackLabelsAsync(ListAllFeedbackLabelsRequest $request, array $optionalArgs = []) * @method PromiseInterface listAnalysesAsync(ListAnalysesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAnalysisRulesAsync(ListAnalysisRulesRequest $request, array $optionalArgs = []) * @method PromiseInterface listConversationsAsync(ListConversationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listFeedbackLabelsAsync(ListFeedbackLabelsRequest $request, array $optionalArgs = []) * @method PromiseInterface listIssueModelsAsync(ListIssueModelsRequest $request, array $optionalArgs = []) * @method PromiseInterface listIssuesAsync(ListIssuesRequest $request, array $optionalArgs = []) * @method PromiseInterface listPhraseMatchersAsync(ListPhraseMatchersRequest $request, array $optionalArgs = []) + * @method PromiseInterface listQaQuestionsAsync(ListQaQuestionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listQaScorecardRevisionsAsync(ListQaScorecardRevisionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listQaScorecardsAsync(ListQaScorecardsRequest $request, array $optionalArgs = []) * @method PromiseInterface listViewsAsync(ListViewsRequest $request, array $optionalArgs = []) + * @method PromiseInterface queryMetricsAsync(QueryMetricsRequest $request, array $optionalArgs = []) + * @method PromiseInterface tuneQaScorecardRevisionAsync(TuneQaScorecardRevisionRequest $request, array $optionalArgs = []) * @method PromiseInterface undeployIssueModelAsync(UndeployIssueModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface undeployQaScorecardRevisionAsync(UndeployQaScorecardRevisionRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAnalysisRuleAsync(UpdateAnalysisRuleRequest $request, array $optionalArgs = []) * @method PromiseInterface updateConversationAsync(UpdateConversationRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateFeedbackLabelAsync(UpdateFeedbackLabelRequest $request, array $optionalArgs = []) * @method PromiseInterface updateIssueAsync(UpdateIssueRequest $request, array $optionalArgs = []) * @method PromiseInterface updateIssueModelAsync(UpdateIssueModelRequest $request, array $optionalArgs = []) * @method PromiseInterface updatePhraseMatcherAsync(UpdatePhraseMatcherRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateQaQuestionAsync(UpdateQaQuestionRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateQaScorecardAsync(UpdateQaScorecardRequest $request, array $optionalArgs = []) * @method PromiseInterface updateSettingsAsync(UpdateSettingsRequest $request, array $optionalArgs = []) * @method PromiseInterface updateViewAsync(UpdateViewRequest $request, array $optionalArgs = []) * @method PromiseInterface uploadConversationAsync(UploadConversationRequest $request, array $optionalArgs = []) @@ -271,6 +338,25 @@ public static function analysisName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * analysis_rule resource. + * + * @param string $project + * @param string $location + * @param string $analysisRule + * + * @return string The formatted analysis_rule resource. + */ + public static function analysisRuleName(string $project, string $location, string $analysisRule): string + { + return self::getPathTemplate('analysisRule')->render([ + 'project' => $project, + 'location' => $location, + 'analysis_rule' => $analysisRule, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a conversation * resource. @@ -329,6 +415,31 @@ public static function encryptionSpecName(string $project, string $location): st ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * feedback_label resource. + * + * @param string $project + * @param string $location + * @param string $conversation + * @param string $feedbackLabel + * + * @return string The formatted feedback_label resource. + */ + public static function feedbackLabelName( + string $project, + string $location, + string $conversation, + string $feedbackLabel + ): string { + return self::getPathTemplate('feedbackLabel')->render([ + 'project' => $project, + 'location' => $location, + 'conversation' => $conversation, + 'feedback_label' => $feedbackLabel, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a issue * resource. @@ -471,6 +582,97 @@ public static function projectLocationConversationParticipantName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a qa_question + * resource. + * + * @param string $project + * @param string $location + * @param string $qaScorecard + * @param string $revision + * @param string $qaQuestion + * + * @return string The formatted qa_question resource. + */ + public static function qaQuestionName( + string $project, + string $location, + string $qaScorecard, + string $revision, + string $qaQuestion + ): string { + return self::getPathTemplate('qaQuestion')->render([ + 'project' => $project, + 'location' => $location, + 'qa_scorecard' => $qaScorecard, + 'revision' => $revision, + 'qa_question' => $qaQuestion, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a qa_scorecard + * resource. + * + * @param string $project + * @param string $location + * @param string $qaScorecard + * + * @return string The formatted qa_scorecard resource. + */ + public static function qaScorecardName(string $project, string $location, string $qaScorecard): string + { + return self::getPathTemplate('qaScorecard')->render([ + 'project' => $project, + 'location' => $location, + 'qa_scorecard' => $qaScorecard, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * qa_scorecard_result resource. + * + * @param string $project + * @param string $location + * @param string $qaScorecardResult + * + * @return string The formatted qa_scorecard_result resource. + */ + public static function qaScorecardResultName(string $project, string $location, string $qaScorecardResult): string + { + return self::getPathTemplate('qaScorecardResult')->render([ + 'project' => $project, + 'location' => $location, + 'qa_scorecard_result' => $qaScorecardResult, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * qa_scorecard_revision resource. + * + * @param string $project + * @param string $location + * @param string $qaScorecard + * @param string $revision + * + * @return string The formatted qa_scorecard_revision resource. + */ + public static function qaScorecardRevisionName( + string $project, + string $location, + string $qaScorecard, + string $revision + ): string { + return self::getPathTemplate('qaScorecardRevision')->render([ + 'project' => $project, + 'location' => $location, + 'qa_scorecard' => $qaScorecard, + 'revision' => $revision, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a recognizer * resource. @@ -531,9 +733,11 @@ public static function viewName(string $project, string $location, string $view) * The following name formats are supported: * Template: Pattern * - analysis: projects/{project}/locations/{location}/conversations/{conversation}/analyses/{analysis} + * - analysisRule: projects/{project}/locations/{location}/analysisRules/{analysis_rule} * - conversation: projects/{project}/locations/{location}/conversations/{conversation} * - conversationProfile: projects/{project}/locations/{location}/conversationProfiles/{conversation_profile} * - encryptionSpec: projects/{project}/locations/{location}/encryptionSpec + * - feedbackLabel: projects/{project}/locations/{location}/conversations/{conversation}/feedbackLabels/{feedback_label} * - issue: projects/{project}/locations/{location}/issueModels/{issue_model}/issues/{issue} * - issueModel: projects/{project}/locations/{location}/issueModels/{issue_model} * - location: projects/{project}/locations/{location} @@ -541,6 +745,10 @@ public static function viewName(string $project, string $location, string $view) * - phraseMatcher: projects/{project}/locations/{location}/phraseMatchers/{phrase_matcher} * - projectConversationParticipant: projects/{project}/conversations/{conversation}/participants/{participant} * - projectLocationConversationParticipant: projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant} + * - qaQuestion: projects/{project}/locations/{location}/qaScorecards/{qa_scorecard}/revisions/{revision}/qaQuestions/{qa_question} + * - qaScorecard: projects/{project}/locations/{location}/qaScorecards/{qa_scorecard} + * - qaScorecardResult: projects/{project}/locations/{location}/qaScorecardResults/{qa_scorecard_result} + * - qaScorecardRevision: projects/{project}/locations/{location}/qaScorecards/{qa_scorecard}/revisions/{revision} * - recognizer: projects/{project}/locations/{location}/recognizers/{recognizer} * - settings: projects/{project}/locations/{location}/settings * - view: projects/{project}/locations/{location}/views/{view} @@ -693,6 +901,64 @@ public function bulkDeleteConversations( return $this->startApiCall('BulkDeleteConversations', $request, $callOptions)->wait(); } + /** + * Download feedback labels in bulk. + * + * The async variant is + * {@see ContactCenterInsightsClient::bulkDownloadFeedbackLabelsAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/bulk_download_feedback_labels.php + * + * @param BulkDownloadFeedbackLabelsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function bulkDownloadFeedbackLabels( + BulkDownloadFeedbackLabelsRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('BulkDownloadFeedbackLabels', $request, $callOptions)->wait(); + } + + /** + * Upload feedback labels in bulk. + * + * The async variant is + * {@see ContactCenterInsightsClient::bulkUploadFeedbackLabelsAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/bulk_upload_feedback_labels.php + * + * @param BulkUploadFeedbackLabelsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function bulkUploadFeedbackLabels( + BulkUploadFeedbackLabelsRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('BulkUploadFeedbackLabels', $request, $callOptions)->wait(); + } + /** * Gets an issue model's statistics. * @@ -775,6 +1041,33 @@ public function createAnalysis(CreateAnalysisRequest $request, array $callOption return $this->startApiCall('CreateAnalysis', $request, $callOptions)->wait(); } + /** + * Creates a analysis rule. + * + * The async variant is + * {@see ContactCenterInsightsClient::createAnalysisRuleAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/create_analysis_rule.php + * + * @param CreateAnalysisRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AnalysisRule + * + * @throws ApiException Thrown if the API call fails. + */ + public function createAnalysisRule(CreateAnalysisRuleRequest $request, array $callOptions = []): AnalysisRule + { + return $this->startApiCall('CreateAnalysisRule', $request, $callOptions)->wait(); + } + /** * Creates a conversation. * Note that this method does not support audio transcription or redaction. @@ -804,6 +1097,33 @@ public function createConversation(CreateConversationRequest $request, array $ca return $this->startApiCall('CreateConversation', $request, $callOptions)->wait(); } + /** + * Create feedback label. + * + * The async variant is + * {@see ContactCenterInsightsClient::createFeedbackLabelAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/create_feedback_label.php + * + * @param CreateFeedbackLabelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FeedbackLabel + * + * @throws ApiException Thrown if the API call fails. + */ + public function createFeedbackLabel(CreateFeedbackLabelRequest $request, array $callOptions = []): FeedbackLabel + { + return $this->startApiCall('CreateFeedbackLabel', $request, $callOptions)->wait(); + } + /** * Creates an issue model. * @@ -859,14 +1179,15 @@ public function createPhraseMatcher(CreatePhraseMatcherRequest $request, array $ } /** - * Creates a view. + * Create a QaQuestion. * - * The async variant is {@see ContactCenterInsightsClient::createViewAsync()} . + * The async variant is {@see ContactCenterInsightsClient::createQaQuestionAsync()} + * . * - * @example samples/V1/ContactCenterInsightsClient/create_view.php + * @example samples/V1/ContactCenterInsightsClient/create_qa_question.php * - * @param CreateViewRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param CreateQaQuestionRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -875,24 +1196,25 @@ public function createPhraseMatcher(CreatePhraseMatcherRequest $request, array $ * {@see RetrySettings} for example usage. * } * - * @return View + * @return QaQuestion * * @throws ApiException Thrown if the API call fails. */ - public function createView(CreateViewRequest $request, array $callOptions = []): View + public function createQaQuestion(CreateQaQuestionRequest $request, array $callOptions = []): QaQuestion { - return $this->startApiCall('CreateView', $request, $callOptions)->wait(); + return $this->startApiCall('CreateQaQuestion', $request, $callOptions)->wait(); } /** - * Deletes an analysis. + * Create a QaScorecard. * - * The async variant is {@see ContactCenterInsightsClient::deleteAnalysisAsync()} . + * The async variant is + * {@see ContactCenterInsightsClient::createQaScorecardAsync()} . * - * @example samples/V1/ContactCenterInsightsClient/delete_analysis.php + * @example samples/V1/ContactCenterInsightsClient/create_qa_scorecard.php * - * @param DeleteAnalysisRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param CreateQaScorecardRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -901,23 +1223,25 @@ public function createView(CreateViewRequest $request, array $callOptions = []): * {@see RetrySettings} for example usage. * } * + * @return QaScorecard + * * @throws ApiException Thrown if the API call fails. */ - public function deleteAnalysis(DeleteAnalysisRequest $request, array $callOptions = []): void + public function createQaScorecard(CreateQaScorecardRequest $request, array $callOptions = []): QaScorecard { - $this->startApiCall('DeleteAnalysis', $request, $callOptions)->wait(); + return $this->startApiCall('CreateQaScorecard', $request, $callOptions)->wait(); } /** - * Deletes a conversation. + * Creates a QaScorecardRevision. * * The async variant is - * {@see ContactCenterInsightsClient::deleteConversationAsync()} . + * {@see ContactCenterInsightsClient::createQaScorecardRevisionAsync()} . * - * @example samples/V1/ContactCenterInsightsClient/delete_conversation.php + * @example samples/V1/ContactCenterInsightsClient/create_qa_scorecard_revision.php * - * @param DeleteConversationRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param CreateQaScorecardRevisionRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -926,22 +1250,26 @@ public function deleteAnalysis(DeleteAnalysisRequest $request, array $callOption * {@see RetrySettings} for example usage. * } * + * @return QaScorecardRevision + * * @throws ApiException Thrown if the API call fails. */ - public function deleteConversation(DeleteConversationRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteConversation', $request, $callOptions)->wait(); + public function createQaScorecardRevision( + CreateQaScorecardRevisionRequest $request, + array $callOptions = [] + ): QaScorecardRevision { + return $this->startApiCall('CreateQaScorecardRevision', $request, $callOptions)->wait(); } /** - * Deletes an issue. + * Creates a view. * - * The async variant is {@see ContactCenterInsightsClient::deleteIssueAsync()} . + * The async variant is {@see ContactCenterInsightsClient::createViewAsync()} . * - * @example samples/V1/ContactCenterInsightsClient/delete_issue.php + * @example samples/V1/ContactCenterInsightsClient/create_view.php * - * @param DeleteIssueRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param CreateViewRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -950,23 +1278,24 @@ public function deleteConversation(DeleteConversationRequest $request, array $ca * {@see RetrySettings} for example usage. * } * + * @return View + * * @throws ApiException Thrown if the API call fails. */ - public function deleteIssue(DeleteIssueRequest $request, array $callOptions = []): void + public function createView(CreateViewRequest $request, array $callOptions = []): View { - $this->startApiCall('DeleteIssue', $request, $callOptions)->wait(); + return $this->startApiCall('CreateView', $request, $callOptions)->wait(); } /** - * Deletes an issue model. + * Deletes an analysis. * - * The async variant is {@see ContactCenterInsightsClient::deleteIssueModelAsync()} - * . + * The async variant is {@see ContactCenterInsightsClient::deleteAnalysisAsync()} . * - * @example samples/V1/ContactCenterInsightsClient/delete_issue_model.php + * @example samples/V1/ContactCenterInsightsClient/delete_analysis.php * - * @param DeleteIssueModelRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param DeleteAnalysisRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -975,25 +1304,23 @@ public function deleteIssue(DeleteIssueRequest $request, array $callOptions = [] * {@see RetrySettings} for example usage. * } * - * @return OperationResponse - * * @throws ApiException Thrown if the API call fails. */ - public function deleteIssueModel(DeleteIssueModelRequest $request, array $callOptions = []): OperationResponse + public function deleteAnalysis(DeleteAnalysisRequest $request, array $callOptions = []): void { - return $this->startApiCall('DeleteIssueModel', $request, $callOptions)->wait(); + $this->startApiCall('DeleteAnalysis', $request, $callOptions)->wait(); } /** - * Deletes a phrase matcher. + * Deletes a analysis rule. * * The async variant is - * {@see ContactCenterInsightsClient::deletePhraseMatcherAsync()} . + * {@see ContactCenterInsightsClient::deleteAnalysisRuleAsync()} . * - * @example samples/V1/ContactCenterInsightsClient/delete_phrase_matcher.php + * @example samples/V1/ContactCenterInsightsClient/delete_analysis_rule.php * - * @param DeletePhraseMatcherRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param DeleteAnalysisRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -1004,20 +1331,21 @@ public function deleteIssueModel(DeleteIssueModelRequest $request, array $callOp * * @throws ApiException Thrown if the API call fails. */ - public function deletePhraseMatcher(DeletePhraseMatcherRequest $request, array $callOptions = []): void + public function deleteAnalysisRule(DeleteAnalysisRuleRequest $request, array $callOptions = []): void { - $this->startApiCall('DeletePhraseMatcher', $request, $callOptions)->wait(); + $this->startApiCall('DeleteAnalysisRule', $request, $callOptions)->wait(); } /** - * Deletes a view. + * Deletes a conversation. * - * The async variant is {@see ContactCenterInsightsClient::deleteViewAsync()} . + * The async variant is + * {@see ContactCenterInsightsClient::deleteConversationAsync()} . * - * @example samples/V1/ContactCenterInsightsClient/delete_view.php + * @example samples/V1/ContactCenterInsightsClient/delete_conversation.php * - * @param DeleteViewRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param DeleteConversationRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -1028,9 +1356,209 @@ public function deletePhraseMatcher(DeletePhraseMatcherRequest $request, array $ * * @throws ApiException Thrown if the API call fails. */ - public function deleteView(DeleteViewRequest $request, array $callOptions = []): void + public function deleteConversation(DeleteConversationRequest $request, array $callOptions = []): void { - $this->startApiCall('DeleteView', $request, $callOptions)->wait(); + $this->startApiCall('DeleteConversation', $request, $callOptions)->wait(); + } + + /** + * Delete feedback label. + * + * The async variant is + * {@see ContactCenterInsightsClient::deleteFeedbackLabelAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/delete_feedback_label.php + * + * @param DeleteFeedbackLabelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteFeedbackLabel(DeleteFeedbackLabelRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteFeedbackLabel', $request, $callOptions)->wait(); + } + + /** + * Deletes an issue. + * + * The async variant is {@see ContactCenterInsightsClient::deleteIssueAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/delete_issue.php + * + * @param DeleteIssueRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteIssue(DeleteIssueRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteIssue', $request, $callOptions)->wait(); + } + + /** + * Deletes an issue model. + * + * The async variant is {@see ContactCenterInsightsClient::deleteIssueModelAsync()} + * . + * + * @example samples/V1/ContactCenterInsightsClient/delete_issue_model.php + * + * @param DeleteIssueModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteIssueModel(DeleteIssueModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteIssueModel', $request, $callOptions)->wait(); + } + + /** + * Deletes a phrase matcher. + * + * The async variant is + * {@see ContactCenterInsightsClient::deletePhraseMatcherAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/delete_phrase_matcher.php + * + * @param DeletePhraseMatcherRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deletePhraseMatcher(DeletePhraseMatcherRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeletePhraseMatcher', $request, $callOptions)->wait(); + } + + /** + * Deletes a QaQuestion. + * + * The async variant is {@see ContactCenterInsightsClient::deleteQaQuestionAsync()} + * . + * + * @example samples/V1/ContactCenterInsightsClient/delete_qa_question.php + * + * @param DeleteQaQuestionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteQaQuestion(DeleteQaQuestionRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteQaQuestion', $request, $callOptions)->wait(); + } + + /** + * Deletes a QaScorecard. + * + * The async variant is + * {@see ContactCenterInsightsClient::deleteQaScorecardAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/delete_qa_scorecard.php + * + * @param DeleteQaScorecardRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteQaScorecard(DeleteQaScorecardRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteQaScorecard', $request, $callOptions)->wait(); + } + + /** + * Deletes a QaScorecardRevision. + * + * The async variant is + * {@see ContactCenterInsightsClient::deleteQaScorecardRevisionAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/delete_qa_scorecard_revision.php + * + * @param DeleteQaScorecardRevisionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteQaScorecardRevision(DeleteQaScorecardRevisionRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteQaScorecardRevision', $request, $callOptions)->wait(); + } + + /** + * Deletes a view. + * + * The async variant is {@see ContactCenterInsightsClient::deleteViewAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/delete_view.php + * + * @param DeleteViewRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteView(DeleteViewRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteView', $request, $callOptions)->wait(); } /** @@ -1061,6 +1589,35 @@ public function deployIssueModel(DeployIssueModelRequest $request, array $callOp return $this->startApiCall('DeployIssueModel', $request, $callOptions)->wait(); } + /** + * Deploy a QaScorecardRevision. + * + * The async variant is + * {@see ContactCenterInsightsClient::deployQaScorecardRevisionAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/deploy_qa_scorecard_revision.php + * + * @param DeployQaScorecardRevisionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return QaScorecardRevision + * + * @throws ApiException Thrown if the API call fails. + */ + public function deployQaScorecardRevision( + DeployQaScorecardRevisionRequest $request, + array $callOptions = [] + ): QaScorecardRevision { + return $this->startApiCall('DeployQaScorecardRevision', $request, $callOptions)->wait(); + } + /** * Export insights data to a destination defined in the request body. * @@ -1141,6 +1698,33 @@ public function getAnalysis(GetAnalysisRequest $request, array $callOptions = [] return $this->startApiCall('GetAnalysis', $request, $callOptions)->wait(); } + /** + * Get a analysis rule. + * + * The async variant is {@see ContactCenterInsightsClient::getAnalysisRuleAsync()} + * . + * + * @example samples/V1/ContactCenterInsightsClient/get_analysis_rule.php + * + * @param GetAnalysisRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AnalysisRule + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAnalysisRule(GetAnalysisRuleRequest $request, array $callOptions = []): AnalysisRule + { + return $this->startApiCall('GetAnalysisRule', $request, $callOptions)->wait(); + } + /** * Gets a conversation. * @@ -1195,15 +1779,398 @@ public function getEncryptionSpec(GetEncryptionSpecRequest $request, array $call return $this->startApiCall('GetEncryptionSpec', $request, $callOptions)->wait(); } + /** + * Get feedback label. + * + * The async variant is {@see ContactCenterInsightsClient::getFeedbackLabelAsync()} + * . + * + * @example samples/V1/ContactCenterInsightsClient/get_feedback_label.php + * + * @param GetFeedbackLabelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FeedbackLabel + * + * @throws ApiException Thrown if the API call fails. + */ + public function getFeedbackLabel(GetFeedbackLabelRequest $request, array $callOptions = []): FeedbackLabel + { + return $this->startApiCall('GetFeedbackLabel', $request, $callOptions)->wait(); + } + /** * Gets an issue. * * The async variant is {@see ContactCenterInsightsClient::getIssueAsync()} . * - * @example samples/V1/ContactCenterInsightsClient/get_issue.php + * @example samples/V1/ContactCenterInsightsClient/get_issue.php + * + * @param GetIssueRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Issue + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIssue(GetIssueRequest $request, array $callOptions = []): Issue + { + return $this->startApiCall('GetIssue', $request, $callOptions)->wait(); + } + + /** + * Gets an issue model. + * + * The async variant is {@see ContactCenterInsightsClient::getIssueModelAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/get_issue_model.php + * + * @param GetIssueModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return IssueModel + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIssueModel(GetIssueModelRequest $request, array $callOptions = []): IssueModel + { + return $this->startApiCall('GetIssueModel', $request, $callOptions)->wait(); + } + + /** + * Gets a phrase matcher. + * + * The async variant is {@see ContactCenterInsightsClient::getPhraseMatcherAsync()} + * . + * + * @example samples/V1/ContactCenterInsightsClient/get_phrase_matcher.php + * + * @param GetPhraseMatcherRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PhraseMatcher + * + * @throws ApiException Thrown if the API call fails. + */ + public function getPhraseMatcher(GetPhraseMatcherRequest $request, array $callOptions = []): PhraseMatcher + { + return $this->startApiCall('GetPhraseMatcher', $request, $callOptions)->wait(); + } + + /** + * Gets a QaQuestion. + * + * The async variant is {@see ContactCenterInsightsClient::getQaQuestionAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/get_qa_question.php + * + * @param GetQaQuestionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return QaQuestion + * + * @throws ApiException Thrown if the API call fails. + */ + public function getQaQuestion(GetQaQuestionRequest $request, array $callOptions = []): QaQuestion + { + return $this->startApiCall('GetQaQuestion', $request, $callOptions)->wait(); + } + + /** + * Gets a QaScorecard. + * + * The async variant is {@see ContactCenterInsightsClient::getQaScorecardAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/get_qa_scorecard.php + * + * @param GetQaScorecardRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return QaScorecard + * + * @throws ApiException Thrown if the API call fails. + */ + public function getQaScorecard(GetQaScorecardRequest $request, array $callOptions = []): QaScorecard + { + return $this->startApiCall('GetQaScorecard', $request, $callOptions)->wait(); + } + + /** + * Gets a QaScorecardRevision. + * + * The async variant is + * {@see ContactCenterInsightsClient::getQaScorecardRevisionAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/get_qa_scorecard_revision.php + * + * @param GetQaScorecardRevisionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return QaScorecardRevision + * + * @throws ApiException Thrown if the API call fails. + */ + public function getQaScorecardRevision( + GetQaScorecardRevisionRequest $request, + array $callOptions = [] + ): QaScorecardRevision { + return $this->startApiCall('GetQaScorecardRevision', $request, $callOptions)->wait(); + } + + /** + * Gets project-level settings. + * + * The async variant is {@see ContactCenterInsightsClient::getSettingsAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/get_settings.php + * + * @param GetSettingsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Settings + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSettings(GetSettingsRequest $request, array $callOptions = []): Settings + { + return $this->startApiCall('GetSettings', $request, $callOptions)->wait(); + } + + /** + * Gets a view. + * + * The async variant is {@see ContactCenterInsightsClient::getViewAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/get_view.php + * + * @param GetViewRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return View + * + * @throws ApiException Thrown if the API call fails. + */ + public function getView(GetViewRequest $request, array $callOptions = []): View + { + return $this->startApiCall('GetView', $request, $callOptions)->wait(); + } + + /** + * Imports an issue model from a Cloud Storage bucket. + * + * The async variant is {@see ContactCenterInsightsClient::importIssueModelAsync()} + * . + * + * @example samples/V1/ContactCenterInsightsClient/import_issue_model.php + * + * @param ImportIssueModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importIssueModel(ImportIssueModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportIssueModel', $request, $callOptions)->wait(); + } + + /** + * Imports conversations and processes them according to the user's + * configuration. + * + * The async variant is + * {@see ContactCenterInsightsClient::ingestConversationsAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/ingest_conversations.php + * + * @param IngestConversationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function ingestConversations(IngestConversationsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('IngestConversations', $request, $callOptions)->wait(); + } + + /** + * Initializes a location-level encryption key specification. An error will + * result if the location has resources already created before the + * initialization. After 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 + * {@see ContactCenterInsightsClient::initializeEncryptionSpecAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/initialize_encryption_spec.php + * + * @param InitializeEncryptionSpecRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function initializeEncryptionSpec( + InitializeEncryptionSpecRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('InitializeEncryptionSpec', $request, $callOptions)->wait(); + } + + /** + * List all feedback labels by project number. + * + * The async variant is + * {@see ContactCenterInsightsClient::listAllFeedbackLabelsAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/list_all_feedback_labels.php + * + * @param ListAllFeedbackLabelsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAllFeedbackLabels( + ListAllFeedbackLabelsRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListAllFeedbackLabels', $request, $callOptions); + } + + /** + * Lists analyses. + * + * The async variant is {@see ContactCenterInsightsClient::listAnalysesAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/list_analyses.php + * + * @param ListAnalysesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAnalyses(ListAnalysesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAnalyses', $request, $callOptions); + } + + /** + * Lists analysis rules. + * + * The async variant is + * {@see ContactCenterInsightsClient::listAnalysisRulesAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/list_analysis_rules.php * - * @param GetIssueRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param ListAnalysisRulesRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -1212,24 +2179,25 @@ public function getEncryptionSpec(GetEncryptionSpecRequest $request, array $call * {@see RetrySettings} for example usage. * } * - * @return Issue + * @return PagedListResponse * * @throws ApiException Thrown if the API call fails. */ - public function getIssue(GetIssueRequest $request, array $callOptions = []): Issue + public function listAnalysisRules(ListAnalysisRulesRequest $request, array $callOptions = []): PagedListResponse { - return $this->startApiCall('GetIssue', $request, $callOptions)->wait(); + return $this->startApiCall('ListAnalysisRules', $request, $callOptions); } /** - * Gets an issue model. + * Lists conversations. * - * The async variant is {@see ContactCenterInsightsClient::getIssueModelAsync()} . + * The async variant is + * {@see ContactCenterInsightsClient::listConversationsAsync()} . * - * @example samples/V1/ContactCenterInsightsClient/get_issue_model.php + * @example samples/V1/ContactCenterInsightsClient/list_conversations.php * - * @param GetIssueModelRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param ListConversationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -1238,25 +2206,25 @@ public function getIssue(GetIssueRequest $request, array $callOptions = []): Iss * {@see RetrySettings} for example usage. * } * - * @return IssueModel + * @return PagedListResponse * * @throws ApiException Thrown if the API call fails. */ - public function getIssueModel(GetIssueModelRequest $request, array $callOptions = []): IssueModel + public function listConversations(ListConversationsRequest $request, array $callOptions = []): PagedListResponse { - return $this->startApiCall('GetIssueModel', $request, $callOptions)->wait(); + return $this->startApiCall('ListConversations', $request, $callOptions); } /** - * Gets a phrase matcher. + * List feedback labels. * - * The async variant is {@see ContactCenterInsightsClient::getPhraseMatcherAsync()} - * . + * The async variant is + * {@see ContactCenterInsightsClient::listFeedbackLabelsAsync()} . * - * @example samples/V1/ContactCenterInsightsClient/get_phrase_matcher.php + * @example samples/V1/ContactCenterInsightsClient/list_feedback_labels.php * - * @param GetPhraseMatcherRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param ListFeedbackLabelsRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -1265,24 +2233,25 @@ public function getIssueModel(GetIssueModelRequest $request, array $callOptions * {@see RetrySettings} for example usage. * } * - * @return PhraseMatcher + * @return PagedListResponse * * @throws ApiException Thrown if the API call fails. */ - public function getPhraseMatcher(GetPhraseMatcherRequest $request, array $callOptions = []): PhraseMatcher + public function listFeedbackLabels(ListFeedbackLabelsRequest $request, array $callOptions = []): PagedListResponse { - return $this->startApiCall('GetPhraseMatcher', $request, $callOptions)->wait(); + return $this->startApiCall('ListFeedbackLabels', $request, $callOptions); } /** - * Gets project-level settings. + * Lists issue models. * - * The async variant is {@see ContactCenterInsightsClient::getSettingsAsync()} . + * The async variant is {@see ContactCenterInsightsClient::listIssueModelsAsync()} + * . * - * @example samples/V1/ContactCenterInsightsClient/get_settings.php + * @example samples/V1/ContactCenterInsightsClient/list_issue_models.php * - * @param GetSettingsRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param ListIssueModelsRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -1291,24 +2260,24 @@ public function getPhraseMatcher(GetPhraseMatcherRequest $request, array $callOp * {@see RetrySettings} for example usage. * } * - * @return Settings + * @return ListIssueModelsResponse * * @throws ApiException Thrown if the API call fails. */ - public function getSettings(GetSettingsRequest $request, array $callOptions = []): Settings + public function listIssueModels(ListIssueModelsRequest $request, array $callOptions = []): ListIssueModelsResponse { - return $this->startApiCall('GetSettings', $request, $callOptions)->wait(); + return $this->startApiCall('ListIssueModels', $request, $callOptions)->wait(); } /** - * Gets a view. + * Lists issues. * - * The async variant is {@see ContactCenterInsightsClient::getViewAsync()} . + * The async variant is {@see ContactCenterInsightsClient::listIssuesAsync()} . * - * @example samples/V1/ContactCenterInsightsClient/get_view.php + * @example samples/V1/ContactCenterInsightsClient/list_issues.php * - * @param GetViewRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param ListIssuesRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -1317,25 +2286,25 @@ public function getSettings(GetSettingsRequest $request, array $callOptions = [] * {@see RetrySettings} for example usage. * } * - * @return View + * @return ListIssuesResponse * * @throws ApiException Thrown if the API call fails. */ - public function getView(GetViewRequest $request, array $callOptions = []): View + public function listIssues(ListIssuesRequest $request, array $callOptions = []): ListIssuesResponse { - return $this->startApiCall('GetView', $request, $callOptions)->wait(); + return $this->startApiCall('ListIssues', $request, $callOptions)->wait(); } /** - * Imports an issue model from a Cloud Storage bucket. + * Lists phrase matchers. * - * The async variant is {@see ContactCenterInsightsClient::importIssueModelAsync()} - * . + * The async variant is + * {@see ContactCenterInsightsClient::listPhraseMatchersAsync()} . * - * @example samples/V1/ContactCenterInsightsClient/import_issue_model.php + * @example samples/V1/ContactCenterInsightsClient/list_phrase_matchers.php * - * @param ImportIssueModelRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param ListPhraseMatchersRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -1344,26 +2313,25 @@ public function getView(GetViewRequest $request, array $callOptions = []): View * {@see RetrySettings} for example usage. * } * - * @return OperationResponse + * @return PagedListResponse * * @throws ApiException Thrown if the API call fails. */ - public function importIssueModel(ImportIssueModelRequest $request, array $callOptions = []): OperationResponse + public function listPhraseMatchers(ListPhraseMatchersRequest $request, array $callOptions = []): PagedListResponse { - return $this->startApiCall('ImportIssueModel', $request, $callOptions)->wait(); + return $this->startApiCall('ListPhraseMatchers', $request, $callOptions); } /** - * Imports conversations and processes them according to the user's - * configuration. + * Lists QaQuestions. * - * The async variant is - * {@see ContactCenterInsightsClient::ingestConversationsAsync()} . + * The async variant is {@see ContactCenterInsightsClient::listQaQuestionsAsync()} + * . * - * @example samples/V1/ContactCenterInsightsClient/ingest_conversations.php + * @example samples/V1/ContactCenterInsightsClient/list_qa_questions.php * - * @param IngestConversationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param ListQaQuestionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -1372,28 +2340,24 @@ public function importIssueModel(ImportIssueModelRequest $request, array $callOp * {@see RetrySettings} for example usage. * } * - * @return OperationResponse + * @return PagedListResponse * * @throws ApiException Thrown if the API call fails. */ - public function ingestConversations(IngestConversationsRequest $request, array $callOptions = []): OperationResponse + public function listQaQuestions(ListQaQuestionsRequest $request, array $callOptions = []): PagedListResponse { - return $this->startApiCall('IngestConversations', $request, $callOptions)->wait(); + return $this->startApiCall('ListQaQuestions', $request, $callOptions); } /** - * 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. + * Lists all revisions under the parent QaScorecard. * * The async variant is - * {@see ContactCenterInsightsClient::initializeEncryptionSpecAsync()} . + * {@see ContactCenterInsightsClient::listQaScorecardRevisionsAsync()} . * - * @example samples/V1/ContactCenterInsightsClient/initialize_encryption_spec.php + * @example samples/V1/ContactCenterInsightsClient/list_qa_scorecard_revisions.php * - * @param InitializeEncryptionSpecRequest $request A request to house fields associated with the call. + * @param ListQaScorecardRevisionsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. * @@ -1403,26 +2367,27 @@ public function ingestConversations(IngestConversationsRequest $request, array $ * {@see RetrySettings} for example usage. * } * - * @return OperationResponse + * @return PagedListResponse * * @throws ApiException Thrown if the API call fails. */ - public function initializeEncryptionSpec( - InitializeEncryptionSpecRequest $request, + public function listQaScorecardRevisions( + ListQaScorecardRevisionsRequest $request, array $callOptions = [] - ): OperationResponse { - return $this->startApiCall('InitializeEncryptionSpec', $request, $callOptions)->wait(); + ): PagedListResponse { + return $this->startApiCall('ListQaScorecardRevisions', $request, $callOptions); } /** - * Lists analyses. + * Lists QaScorecards. * - * The async variant is {@see ContactCenterInsightsClient::listAnalysesAsync()} . + * The async variant is {@see ContactCenterInsightsClient::listQaScorecardsAsync()} + * . * - * @example samples/V1/ContactCenterInsightsClient/list_analyses.php + * @example samples/V1/ContactCenterInsightsClient/list_qa_scorecards.php * - * @param ListAnalysesRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param ListQaScorecardsRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -1435,21 +2400,20 @@ public function initializeEncryptionSpec( * * @throws ApiException Thrown if the API call fails. */ - public function listAnalyses(ListAnalysesRequest $request, array $callOptions = []): PagedListResponse + public function listQaScorecards(ListQaScorecardsRequest $request, array $callOptions = []): PagedListResponse { - return $this->startApiCall('ListAnalyses', $request, $callOptions); + return $this->startApiCall('ListQaScorecards', $request, $callOptions); } /** - * Lists conversations. + * Lists views. * - * The async variant is - * {@see ContactCenterInsightsClient::listConversationsAsync()} . + * The async variant is {@see ContactCenterInsightsClient::listViewsAsync()} . * - * @example samples/V1/ContactCenterInsightsClient/list_conversations.php + * @example samples/V1/ContactCenterInsightsClient/list_views.php * - * @param ListConversationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param ListViewsRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -1462,21 +2426,20 @@ public function listAnalyses(ListAnalysesRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function listConversations(ListConversationsRequest $request, array $callOptions = []): PagedListResponse + public function listViews(ListViewsRequest $request, array $callOptions = []): PagedListResponse { - return $this->startApiCall('ListConversations', $request, $callOptions); + return $this->startApiCall('ListViews', $request, $callOptions); } /** - * Lists issue models. + * Query metrics. * - * The async variant is {@see ContactCenterInsightsClient::listIssueModelsAsync()} - * . + * The async variant is {@see ContactCenterInsightsClient::queryMetricsAsync()} . * - * @example samples/V1/ContactCenterInsightsClient/list_issue_models.php + * @example samples/V1/ContactCenterInsightsClient/query_metrics.php * - * @param ListIssueModelsRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param QueryMetricsRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -1485,24 +2448,25 @@ public function listConversations(ListConversationsRequest $request, array $call * {@see RetrySettings} for example usage. * } * - * @return ListIssueModelsResponse + * @return OperationResponse * * @throws ApiException Thrown if the API call fails. */ - public function listIssueModels(ListIssueModelsRequest $request, array $callOptions = []): ListIssueModelsResponse + public function queryMetrics(QueryMetricsRequest $request, array $callOptions = []): OperationResponse { - return $this->startApiCall('ListIssueModels', $request, $callOptions)->wait(); + return $this->startApiCall('QueryMetrics', $request, $callOptions)->wait(); } /** - * Lists issues. + * Fine tune one or more QaModels. * - * The async variant is {@see ContactCenterInsightsClient::listIssuesAsync()} . + * The async variant is + * {@see ContactCenterInsightsClient::tuneQaScorecardRevisionAsync()} . * - * @example samples/V1/ContactCenterInsightsClient/list_issues.php + * @example samples/V1/ContactCenterInsightsClient/tune_qa_scorecard_revision.php * - * @param ListIssuesRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param TuneQaScorecardRevisionRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -1511,24 +2475,27 @@ public function listIssueModels(ListIssueModelsRequest $request, array $callOpti * {@see RetrySettings} for example usage. * } * - * @return ListIssuesResponse + * @return OperationResponse * * @throws ApiException Thrown if the API call fails. */ - public function listIssues(ListIssuesRequest $request, array $callOptions = []): ListIssuesResponse - { - return $this->startApiCall('ListIssues', $request, $callOptions)->wait(); + public function tuneQaScorecardRevision( + TuneQaScorecardRevisionRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('TuneQaScorecardRevision', $request, $callOptions)->wait(); } /** - * Lists phrase matchers. + * Undeploys an issue model. + * An issue model can not be used in analysis after it has been undeployed. * * The async variant is - * {@see ContactCenterInsightsClient::listPhraseMatchersAsync()} . + * {@see ContactCenterInsightsClient::undeployIssueModelAsync()} . * - * @example samples/V1/ContactCenterInsightsClient/list_phrase_matchers.php + * @example samples/V1/ContactCenterInsightsClient/undeploy_issue_model.php * - * @param ListPhraseMatchersRequest $request A request to house fields associated with the call. + * @param UndeployIssueModelRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. * @@ -1538,24 +2505,25 @@ public function listIssues(ListIssuesRequest $request, array $callOptions = []): * {@see RetrySettings} for example usage. * } * - * @return PagedListResponse + * @return OperationResponse * * @throws ApiException Thrown if the API call fails. */ - public function listPhraseMatchers(ListPhraseMatchersRequest $request, array $callOptions = []): PagedListResponse + public function undeployIssueModel(UndeployIssueModelRequest $request, array $callOptions = []): OperationResponse { - return $this->startApiCall('ListPhraseMatchers', $request, $callOptions); + return $this->startApiCall('UndeployIssueModel', $request, $callOptions)->wait(); } /** - * Lists views. + * Undeploy a QaScorecardRevision. * - * The async variant is {@see ContactCenterInsightsClient::listViewsAsync()} . + * The async variant is + * {@see ContactCenterInsightsClient::undeployQaScorecardRevisionAsync()} . * - * @example samples/V1/ContactCenterInsightsClient/list_views.php + * @example samples/V1/ContactCenterInsightsClient/undeploy_qa_scorecard_revision.php * - * @param ListViewsRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param UndeployQaScorecardRevisionRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -1564,25 +2532,26 @@ public function listPhraseMatchers(ListPhraseMatchersRequest $request, array $ca * {@see RetrySettings} for example usage. * } * - * @return PagedListResponse + * @return QaScorecardRevision * * @throws ApiException Thrown if the API call fails. */ - public function listViews(ListViewsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListViews', $request, $callOptions); + public function undeployQaScorecardRevision( + UndeployQaScorecardRevisionRequest $request, + array $callOptions = [] + ): QaScorecardRevision { + return $this->startApiCall('UndeployQaScorecardRevision', $request, $callOptions)->wait(); } /** - * Undeploys an issue model. - * An issue model can not be used in analysis after it has been undeployed. + * Updates a analysis rule. * * The async variant is - * {@see ContactCenterInsightsClient::undeployIssueModelAsync()} . + * {@see ContactCenterInsightsClient::updateAnalysisRuleAsync()} . * - * @example samples/V1/ContactCenterInsightsClient/undeploy_issue_model.php + * @example samples/V1/ContactCenterInsightsClient/update_analysis_rule.php * - * @param UndeployIssueModelRequest $request A request to house fields associated with the call. + * @param UpdateAnalysisRuleRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. * @@ -1592,13 +2561,13 @@ public function listViews(ListViewsRequest $request, array $callOptions = []): P * {@see RetrySettings} for example usage. * } * - * @return OperationResponse + * @return AnalysisRule * * @throws ApiException Thrown if the API call fails. */ - public function undeployIssueModel(UndeployIssueModelRequest $request, array $callOptions = []): OperationResponse + public function updateAnalysisRule(UpdateAnalysisRuleRequest $request, array $callOptions = []): AnalysisRule { - return $this->startApiCall('UndeployIssueModel', $request, $callOptions)->wait(); + return $this->startApiCall('UpdateAnalysisRule', $request, $callOptions)->wait(); } /** @@ -1628,6 +2597,33 @@ public function updateConversation(UpdateConversationRequest $request, array $ca return $this->startApiCall('UpdateConversation', $request, $callOptions)->wait(); } + /** + * Update feedback label. + * + * The async variant is + * {@see ContactCenterInsightsClient::updateFeedbackLabelAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/update_feedback_label.php + * + * @param UpdateFeedbackLabelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FeedbackLabel + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateFeedbackLabel(UpdateFeedbackLabelRequest $request, array $callOptions = []): FeedbackLabel + { + return $this->startApiCall('UpdateFeedbackLabel', $request, $callOptions)->wait(); + } + /** * Updates an issue. * @@ -1708,6 +2704,60 @@ public function updatePhraseMatcher(UpdatePhraseMatcherRequest $request, array $ return $this->startApiCall('UpdatePhraseMatcher', $request, $callOptions)->wait(); } + /** + * Updates a QaQuestion. + * + * The async variant is {@see ContactCenterInsightsClient::updateQaQuestionAsync()} + * . + * + * @example samples/V1/ContactCenterInsightsClient/update_qa_question.php + * + * @param UpdateQaQuestionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return QaQuestion + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateQaQuestion(UpdateQaQuestionRequest $request, array $callOptions = []): QaQuestion + { + return $this->startApiCall('UpdateQaQuestion', $request, $callOptions)->wait(); + } + + /** + * Updates a QaScorecard. + * + * The async variant is + * {@see ContactCenterInsightsClient::updateQaScorecardAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/update_qa_scorecard.php + * + * @param UpdateQaScorecardRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return QaScorecard + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateQaScorecard(UpdateQaScorecardRequest $request, array $callOptions = []): QaScorecard + { + return $this->startApiCall('UpdateQaScorecard', $request, $callOptions)->wait(); + } + /** * Updates project-level settings. * diff --git a/ContactCenterInsights/src/V1/Conversation.php b/ContactCenterInsights/src/V1/Conversation.php index be3e5078a267..63d218ed77a6 100644 --- a/ContactCenterInsights/src/V1/Conversation.php +++ b/ContactCenterInsights/src/V1/Conversation.php @@ -61,8 +61,8 @@ class Conversation extends \Google\Protobuf\Internal\Message */ protected $agent_id = ''; /** - * A map for the user to specify any custom fields. A maximum of 20 labels per - * conversation is allowed, with a maximum of 256 characters per entry. + * A map for the user to specify any custom fields. A maximum of 100 labels + * per conversation is allowed, with a maximum of 256 characters per entry. * * Generated from protobuf field map labels = 6; */ @@ -74,9 +74,9 @@ class Conversation extends \Google\Protobuf\Internal\Message */ protected $quality_metadata = null; /** - * Input only. JSON Metadata encoded as a string. + * Input only. JSON metadata encoded as a string. * This field is primarily used by Insights integrations with various telphony - * systems and must be in one of Insights' supported formats. + * systems and must be in one of Insight's supported formats. * * Generated from protobuf field string metadata_json = 25 [(.google.api.field_behavior) = INPUT_ONLY]; */ @@ -174,14 +174,14 @@ class Conversation extends \Google\Protobuf\Internal\Message * An opaque, user-specified string representing the human agent who handled * the conversation. * @type array|\Google\Protobuf\Internal\MapField $labels - * A map for the user to specify any custom fields. A maximum of 20 labels per - * conversation is allowed, with a maximum of 256 characters per entry. + * A map for the user to specify any custom fields. A maximum of 100 labels + * per conversation is allowed, with a maximum of 256 characters per entry. * @type \Google\Cloud\ContactCenterInsights\V1\Conversation\QualityMetadata $quality_metadata * Conversation metadata related to quality management. * @type string $metadata_json - * Input only. JSON Metadata encoded as a string. + * Input only. JSON metadata encoded as a string. * This field is primarily used by Insights integrations with various telphony - * systems and must be in one of Insights' supported formats. + * systems and must be in one of Insight's supported formats. * @type \Google\Cloud\ContactCenterInsights\V1\Conversation\Transcript $transcript * Output only. The conversation transcript. * @type int $medium @@ -537,8 +537,8 @@ public function setAgentId($var) } /** - * A map for the user to specify any custom fields. A maximum of 20 labels per - * conversation is allowed, with a maximum of 256 characters per entry. + * A map for the user to specify any custom fields. A maximum of 100 labels + * per conversation is allowed, with a maximum of 256 characters per entry. * * Generated from protobuf field map labels = 6; * @return \Google\Protobuf\Internal\MapField @@ -549,8 +549,8 @@ public function getLabels() } /** - * A map for the user to specify any custom fields. A maximum of 20 labels per - * conversation is allowed, with a maximum of 256 characters per entry. + * A map for the user to specify any custom fields. A maximum of 100 labels + * per conversation is allowed, with a maximum of 256 characters per entry. * * Generated from protobuf field map labels = 6; * @param array|\Google\Protobuf\Internal\MapField $var @@ -601,9 +601,9 @@ public function setQualityMetadata($var) } /** - * Input only. JSON Metadata encoded as a string. + * Input only. JSON metadata encoded as a string. * This field is primarily used by Insights integrations with various telphony - * systems and must be in one of Insights' supported formats. + * systems and must be in one of Insight's supported formats. * * Generated from protobuf field string metadata_json = 25 [(.google.api.field_behavior) = INPUT_ONLY]; * @return string @@ -614,9 +614,9 @@ public function getMetadataJson() } /** - * Input only. JSON Metadata encoded as a string. + * Input only. JSON metadata encoded as a string. * This field is primarily used by Insights integrations with various telphony - * systems and must be in one of Insights' supported formats. + * systems and must be in one of Insight's supported formats. * * Generated from protobuf field string metadata_json = 25 [(.google.api.field_behavior) = INPUT_ONLY]; * @param string $var diff --git a/ContactCenterInsights/src/V1/CreateAnalysisRuleRequest.php b/ContactCenterInsights/src/V1/CreateAnalysisRuleRequest.php new file mode 100644 index 000000000000..21a929607024 --- /dev/null +++ b/ContactCenterInsights/src/V1/CreateAnalysisRuleRequest.php @@ -0,0 +1,143 @@ +google.cloud.contactcenterinsights.v1.CreateAnalysisRuleRequest + */ +class CreateAnalysisRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the analysis rule. Required. The location + * to create a analysis rule for. Format: `projects//locations/` or `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The analysis rule resource to create. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.AnalysisRule analysis_rule = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $analysis_rule = null; + + /** + * @param string $parent Required. The parent resource of the analysis rule. Required. The location + * to create a analysis rule for. Format: `projects//locations/` or `projects//locations/` + * Please see {@see ContactCenterInsightsClient::locationName()} for help formatting this field. + * @param \Google\Cloud\ContactCenterInsights\V1\AnalysisRule $analysisRule Required. The analysis rule resource to create. + * + * @return \Google\Cloud\ContactCenterInsights\V1\CreateAnalysisRuleRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\ContactCenterInsights\V1\AnalysisRule $analysisRule): self + { + return (new self()) + ->setParent($parent) + ->setAnalysisRule($analysisRule); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the analysis rule. Required. The location + * to create a analysis rule for. Format: `projects//locations/` or `projects//locations/` + * @type \Google\Cloud\ContactCenterInsights\V1\AnalysisRule $analysis_rule + * Required. The analysis rule resource to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the analysis rule. Required. The location + * to create a analysis rule for. Format: `projects//locations/` or `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the analysis rule. Required. The location + * to create a analysis rule for. Format: `projects//locations/` or `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The analysis rule resource to create. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.AnalysisRule analysis_rule = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ContactCenterInsights\V1\AnalysisRule|null + */ + public function getAnalysisRule() + { + return $this->analysis_rule; + } + + public function hasAnalysisRule() + { + return isset($this->analysis_rule); + } + + public function clearAnalysisRule() + { + unset($this->analysis_rule); + } + + /** + * Required. The analysis rule resource to create. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.AnalysisRule analysis_rule = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ContactCenterInsights\V1\AnalysisRule $var + * @return $this + */ + public function setAnalysisRule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\AnalysisRule::class); + $this->analysis_rule = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/CreateFeedbackLabelRequest.php b/ContactCenterInsights/src/V1/CreateFeedbackLabelRequest.php new file mode 100644 index 000000000000..50a5c0c2082c --- /dev/null +++ b/ContactCenterInsights/src/V1/CreateFeedbackLabelRequest.php @@ -0,0 +1,168 @@ +google.cloud.contactcenterinsights.v1.CreateFeedbackLabelRequest + */ +class CreateFeedbackLabelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the feedback label. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The ID of the feedback label to create. + * If one is not specified it will be generated by the server. + * + * Generated from protobuf field string feedback_label_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $feedback_label_id = ''; + /** + * Required. The feedback label to create. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.FeedbackLabel feedback_label = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $feedback_label = null; + + /** + * @param string $parent Required. The parent resource of the feedback label. Please see + * {@see ContactCenterInsightsClient::conversationName()} for help formatting this field. + * @param \Google\Cloud\ContactCenterInsights\V1\FeedbackLabel $feedbackLabel Required. The feedback label to create. + * @param string $feedbackLabelId Optional. The ID of the feedback label to create. + * If one is not specified it will be generated by the server. + * + * @return \Google\Cloud\ContactCenterInsights\V1\CreateFeedbackLabelRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\ContactCenterInsights\V1\FeedbackLabel $feedbackLabel, string $feedbackLabelId): self + { + return (new self()) + ->setParent($parent) + ->setFeedbackLabel($feedbackLabel) + ->setFeedbackLabelId($feedbackLabelId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the feedback label. + * @type string $feedback_label_id + * Optional. The ID of the feedback label to create. + * If one is not specified it will be generated by the server. + * @type \Google\Cloud\ContactCenterInsights\V1\FeedbackLabel $feedback_label + * Required. The feedback label to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the feedback label. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the feedback label. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The ID of the feedback label to create. + * If one is not specified it will be generated by the server. + * + * Generated from protobuf field string feedback_label_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFeedbackLabelId() + { + return $this->feedback_label_id; + } + + /** + * Optional. The ID of the feedback label to create. + * If one is not specified it will be generated by the server. + * + * Generated from protobuf field string feedback_label_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFeedbackLabelId($var) + { + GPBUtil::checkString($var, True); + $this->feedback_label_id = $var; + + return $this; + } + + /** + * Required. The feedback label to create. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.FeedbackLabel feedback_label = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ContactCenterInsights\V1\FeedbackLabel|null + */ + public function getFeedbackLabel() + { + return $this->feedback_label; + } + + public function hasFeedbackLabel() + { + return isset($this->feedback_label); + } + + public function clearFeedbackLabel() + { + unset($this->feedback_label); + } + + /** + * Required. The feedback label to create. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.FeedbackLabel feedback_label = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ContactCenterInsights\V1\FeedbackLabel $var + * @return $this + */ + public function setFeedbackLabel($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\FeedbackLabel::class); + $this->feedback_label = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/CreateQaQuestionRequest.php b/ContactCenterInsights/src/V1/CreateQaQuestionRequest.php new file mode 100644 index 000000000000..31601d96bdd5 --- /dev/null +++ b/ContactCenterInsights/src/V1/CreateQaQuestionRequest.php @@ -0,0 +1,184 @@ +google.cloud.contactcenterinsights.v1.CreateQaQuestionRequest + */ +class CreateQaQuestionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the QaQuestion. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The QaQuestion to create. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaQuestion qa_question = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $qa_question = null; + /** + * Optional. A unique ID for the new question. This ID will become the final + * component of the question's resource name. If no ID is specified, a + * server-generated ID will be used. + * This value should be 4-64 characters and must match the regular + * expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-`. + * + * Generated from protobuf field string qa_question_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $qa_question_id = ''; + + /** + * @param string $parent Required. The parent resource of the QaQuestion. Please see + * {@see ContactCenterInsightsClient::qaScorecardRevisionName()} for help formatting this field. + * @param \Google\Cloud\ContactCenterInsights\V1\QaQuestion $qaQuestion Required. The QaQuestion to create. + * @param string $qaQuestionId Optional. A unique ID for the new question. This ID will become the final + * component of the question's resource name. If no ID is specified, a + * server-generated ID will be used. + * + * This value should be 4-64 characters and must match the regular + * expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-`. + * + * @return \Google\Cloud\ContactCenterInsights\V1\CreateQaQuestionRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\ContactCenterInsights\V1\QaQuestion $qaQuestion, string $qaQuestionId): self + { + return (new self()) + ->setParent($parent) + ->setQaQuestion($qaQuestion) + ->setQaQuestionId($qaQuestionId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the QaQuestion. + * @type \Google\Cloud\ContactCenterInsights\V1\QaQuestion $qa_question + * Required. The QaQuestion to create. + * @type string $qa_question_id + * Optional. A unique ID for the new question. This ID will become the final + * component of the question's resource name. If no ID is specified, a + * server-generated ID will be used. + * This value should be 4-64 characters and must match the regular + * expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the QaQuestion. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the QaQuestion. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The QaQuestion to create. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaQuestion qa_question = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ContactCenterInsights\V1\QaQuestion|null + */ + public function getQaQuestion() + { + return $this->qa_question; + } + + public function hasQaQuestion() + { + return isset($this->qa_question); + } + + public function clearQaQuestion() + { + unset($this->qa_question); + } + + /** + * Required. The QaQuestion to create. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaQuestion qa_question = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ContactCenterInsights\V1\QaQuestion $var + * @return $this + */ + public function setQaQuestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\QaQuestion::class); + $this->qa_question = $var; + + return $this; + } + + /** + * Optional. A unique ID for the new question. This ID will become the final + * component of the question's resource name. If no ID is specified, a + * server-generated ID will be used. + * This value should be 4-64 characters and must match the regular + * expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-`. + * + * Generated from protobuf field string qa_question_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQaQuestionId() + { + return $this->qa_question_id; + } + + /** + * Optional. A unique ID for the new question. This ID will become the final + * component of the question's resource name. If no ID is specified, a + * server-generated ID will be used. + * This value should be 4-64 characters and must match the regular + * expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-`. + * + * Generated from protobuf field string qa_question_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQaQuestionId($var) + { + GPBUtil::checkString($var, True); + $this->qa_question_id = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/CreateQaScorecardRequest.php b/ContactCenterInsights/src/V1/CreateQaScorecardRequest.php new file mode 100644 index 000000000000..e2b75165ff8e --- /dev/null +++ b/ContactCenterInsights/src/V1/CreateQaScorecardRequest.php @@ -0,0 +1,184 @@ +google.cloud.contactcenterinsights.v1.CreateQaScorecardRequest + */ +class CreateQaScorecardRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the QaScorecard. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The QaScorecard to create. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaScorecard qa_scorecard = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $qa_scorecard = null; + /** + * Optional. A unique ID for the new QaScorecard. This ID will become the + * final component of the QaScorecard's resource name. If no ID is specified, + * a server-generated ID will be used. + * This value should be 4-64 characters and must match the regular + * expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-`. + * + * Generated from protobuf field string qa_scorecard_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $qa_scorecard_id = ''; + + /** + * @param string $parent Required. The parent resource of the QaScorecard. Please see + * {@see ContactCenterInsightsClient::locationName()} for help formatting this field. + * @param \Google\Cloud\ContactCenterInsights\V1\QaScorecard $qaScorecard Required. The QaScorecard to create. + * @param string $qaScorecardId Optional. A unique ID for the new QaScorecard. This ID will become the + * final component of the QaScorecard's resource name. If no ID is specified, + * a server-generated ID will be used. + * + * This value should be 4-64 characters and must match the regular + * expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-`. + * + * @return \Google\Cloud\ContactCenterInsights\V1\CreateQaScorecardRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\ContactCenterInsights\V1\QaScorecard $qaScorecard, string $qaScorecardId): self + { + return (new self()) + ->setParent($parent) + ->setQaScorecard($qaScorecard) + ->setQaScorecardId($qaScorecardId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the QaScorecard. + * @type \Google\Cloud\ContactCenterInsights\V1\QaScorecard $qa_scorecard + * Required. The QaScorecard to create. + * @type string $qa_scorecard_id + * Optional. A unique ID for the new QaScorecard. This ID will become the + * final component of the QaScorecard's resource name. If no ID is specified, + * a server-generated ID will be used. + * This value should be 4-64 characters and must match the regular + * expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the QaScorecard. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the QaScorecard. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The QaScorecard to create. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaScorecard qa_scorecard = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ContactCenterInsights\V1\QaScorecard|null + */ + public function getQaScorecard() + { + return $this->qa_scorecard; + } + + public function hasQaScorecard() + { + return isset($this->qa_scorecard); + } + + public function clearQaScorecard() + { + unset($this->qa_scorecard); + } + + /** + * Required. The QaScorecard to create. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaScorecard qa_scorecard = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ContactCenterInsights\V1\QaScorecard $var + * @return $this + */ + public function setQaScorecard($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\QaScorecard::class); + $this->qa_scorecard = $var; + + return $this; + } + + /** + * Optional. A unique ID for the new QaScorecard. This ID will become the + * final component of the QaScorecard's resource name. If no ID is specified, + * a server-generated ID will be used. + * This value should be 4-64 characters and must match the regular + * expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-`. + * + * Generated from protobuf field string qa_scorecard_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQaScorecardId() + { + return $this->qa_scorecard_id; + } + + /** + * Optional. A unique ID for the new QaScorecard. This ID will become the + * final component of the QaScorecard's resource name. If no ID is specified, + * a server-generated ID will be used. + * This value should be 4-64 characters and must match the regular + * expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-`. + * + * Generated from protobuf field string qa_scorecard_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQaScorecardId($var) + { + GPBUtil::checkString($var, True); + $this->qa_scorecard_id = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/CreateQaScorecardRevisionRequest.php b/ContactCenterInsights/src/V1/CreateQaScorecardRevisionRequest.php new file mode 100644 index 000000000000..9a55b26b8168 --- /dev/null +++ b/ContactCenterInsights/src/V1/CreateQaScorecardRevisionRequest.php @@ -0,0 +1,184 @@ +google.cloud.contactcenterinsights.v1.CreateQaScorecardRevisionRequest + */ +class CreateQaScorecardRevisionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the QaScorecardRevision. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The QaScorecardRevision to create. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaScorecardRevision qa_scorecard_revision = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $qa_scorecard_revision = null; + /** + * Optional. A unique ID for the new QaScorecardRevision. This ID will become + * the final component of the QaScorecardRevision's resource name. If no ID is + * specified, a server-generated ID will be used. + * This value should be 4-64 characters and must match the regular + * expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-`. + * + * Generated from protobuf field string qa_scorecard_revision_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $qa_scorecard_revision_id = ''; + + /** + * @param string $parent Required. The parent resource of the QaScorecardRevision. Please see + * {@see ContactCenterInsightsClient::qaScorecardName()} for help formatting this field. + * @param \Google\Cloud\ContactCenterInsights\V1\QaScorecardRevision $qaScorecardRevision Required. The QaScorecardRevision to create. + * @param string $qaScorecardRevisionId Optional. A unique ID for the new QaScorecardRevision. This ID will become + * the final component of the QaScorecardRevision's resource name. If no ID is + * specified, a server-generated ID will be used. + * + * This value should be 4-64 characters and must match the regular + * expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-`. + * + * @return \Google\Cloud\ContactCenterInsights\V1\CreateQaScorecardRevisionRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\ContactCenterInsights\V1\QaScorecardRevision $qaScorecardRevision, string $qaScorecardRevisionId): self + { + return (new self()) + ->setParent($parent) + ->setQaScorecardRevision($qaScorecardRevision) + ->setQaScorecardRevisionId($qaScorecardRevisionId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the QaScorecardRevision. + * @type \Google\Cloud\ContactCenterInsights\V1\QaScorecardRevision $qa_scorecard_revision + * Required. The QaScorecardRevision to create. + * @type string $qa_scorecard_revision_id + * Optional. A unique ID for the new QaScorecardRevision. This ID will become + * the final component of the QaScorecardRevision's resource name. If no ID is + * specified, a server-generated ID will be used. + * This value should be 4-64 characters and must match the regular + * expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the QaScorecardRevision. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the QaScorecardRevision. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The QaScorecardRevision to create. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaScorecardRevision qa_scorecard_revision = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ContactCenterInsights\V1\QaScorecardRevision|null + */ + public function getQaScorecardRevision() + { + return $this->qa_scorecard_revision; + } + + public function hasQaScorecardRevision() + { + return isset($this->qa_scorecard_revision); + } + + public function clearQaScorecardRevision() + { + unset($this->qa_scorecard_revision); + } + + /** + * Required. The QaScorecardRevision to create. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaScorecardRevision qa_scorecard_revision = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ContactCenterInsights\V1\QaScorecardRevision $var + * @return $this + */ + public function setQaScorecardRevision($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\QaScorecardRevision::class); + $this->qa_scorecard_revision = $var; + + return $this; + } + + /** + * Optional. A unique ID for the new QaScorecardRevision. This ID will become + * the final component of the QaScorecardRevision's resource name. If no ID is + * specified, a server-generated ID will be used. + * This value should be 4-64 characters and must match the regular + * expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-`. + * + * Generated from protobuf field string qa_scorecard_revision_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQaScorecardRevisionId() + { + return $this->qa_scorecard_revision_id; + } + + /** + * Optional. A unique ID for the new QaScorecardRevision. This ID will become + * the final component of the QaScorecardRevision's resource name. If no ID is + * specified, a server-generated ID will be used. + * This value should be 4-64 characters and must match the regular + * expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-`. + * + * Generated from protobuf field string qa_scorecard_revision_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQaScorecardRevisionId($var) + { + GPBUtil::checkString($var, True); + $this->qa_scorecard_revision_id = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/DatasetValidationWarning.php b/ContactCenterInsights/src/V1/DatasetValidationWarning.php new file mode 100644 index 000000000000..d7e898af1a6f --- /dev/null +++ b/ContactCenterInsights/src/V1/DatasetValidationWarning.php @@ -0,0 +1,79 @@ +google.cloud.contactcenterinsights.v1.DatasetValidationWarning + */ +class DatasetValidationWarning +{ + /** + * Unspecified data validation warning. + * + * Generated from protobuf enum DATASET_VALIDATION_WARNING_UNSPECIFIED = 0; + */ + const DATASET_VALIDATION_WARNING_UNSPECIFIED = 0; + /** + * A non-trivial percentage of the feedback labels are invalid. + * + * Generated from protobuf enum TOO_MANY_INVALID_FEEDBACK_LABELS = 1; + */ + const TOO_MANY_INVALID_FEEDBACK_LABELS = 1; + /** + * The quantity of valid feedback labels provided is less than the + * recommended minimum. + * + * Generated from protobuf enum INSUFFICIENT_FEEDBACK_LABELS = 2; + */ + const INSUFFICIENT_FEEDBACK_LABELS = 2; + /** + * One or more of the answers have less than the recommended minimum of + * feedback labels. + * + * Generated from protobuf enum INSUFFICIENT_FEEDBACK_LABELS_PER_ANSWER = 3; + */ + const INSUFFICIENT_FEEDBACK_LABELS_PER_ANSWER = 3; + /** + * All the labels in the dataset come from a single answer choice. + * + * Generated from protobuf enum ALL_FEEDBACK_LABELS_HAVE_THE_SAME_ANSWER = 4; + */ + const ALL_FEEDBACK_LABELS_HAVE_THE_SAME_ANSWER = 4; + + private static $valueToName = [ + self::DATASET_VALIDATION_WARNING_UNSPECIFIED => 'DATASET_VALIDATION_WARNING_UNSPECIFIED', + self::TOO_MANY_INVALID_FEEDBACK_LABELS => 'TOO_MANY_INVALID_FEEDBACK_LABELS', + self::INSUFFICIENT_FEEDBACK_LABELS => 'INSUFFICIENT_FEEDBACK_LABELS', + self::INSUFFICIENT_FEEDBACK_LABELS_PER_ANSWER => 'INSUFFICIENT_FEEDBACK_LABELS_PER_ANSWER', + self::ALL_FEEDBACK_LABELS_HAVE_THE_SAME_ANSWER => 'ALL_FEEDBACK_LABELS_HAVE_THE_SAME_ANSWER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/ContactCenterInsights/src/V1/DeleteAnalysisRuleRequest.php b/ContactCenterInsights/src/V1/DeleteAnalysisRuleRequest.php new file mode 100644 index 000000000000..2d693b7c329e --- /dev/null +++ b/ContactCenterInsights/src/V1/DeleteAnalysisRuleRequest.php @@ -0,0 +1,81 @@ +google.cloud.contactcenterinsights.v1.DeleteAnalysisRuleRequest + */ +class DeleteAnalysisRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the analysis rule to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the analysis rule to delete. Please see + * {@see ContactCenterInsightsClient::analysisRuleName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\DeleteAnalysisRuleRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the analysis rule to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the analysis rule to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the analysis rule to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/DeleteFeedbackLabelRequest.php b/ContactCenterInsights/src/V1/DeleteFeedbackLabelRequest.php new file mode 100644 index 000000000000..cf448a2a09a5 --- /dev/null +++ b/ContactCenterInsights/src/V1/DeleteFeedbackLabelRequest.php @@ -0,0 +1,81 @@ +google.cloud.contactcenterinsights.v1.DeleteFeedbackLabelRequest + */ +class DeleteFeedbackLabelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the feedback label to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the feedback label to delete. Please see + * {@see ContactCenterInsightsClient::feedbackLabelName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\DeleteFeedbackLabelRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the feedback label to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the feedback label to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the feedback label to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/DeleteQaQuestionRequest.php b/ContactCenterInsights/src/V1/DeleteQaQuestionRequest.php new file mode 100644 index 000000000000..b7994758c941 --- /dev/null +++ b/ContactCenterInsights/src/V1/DeleteQaQuestionRequest.php @@ -0,0 +1,81 @@ +google.cloud.contactcenterinsights.v1.DeleteQaQuestionRequest + */ +class DeleteQaQuestionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the QaQuestion to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the QaQuestion to delete. Please see + * {@see ContactCenterInsightsClient::qaQuestionName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\DeleteQaQuestionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the QaQuestion to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the QaQuestion to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the QaQuestion to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/DeleteQaScorecardRequest.php b/ContactCenterInsights/src/V1/DeleteQaScorecardRequest.php new file mode 100644 index 000000000000..ecf15d68b5a5 --- /dev/null +++ b/ContactCenterInsights/src/V1/DeleteQaScorecardRequest.php @@ -0,0 +1,119 @@ +google.cloud.contactcenterinsights.v1.DeleteQaScorecardRequest + */ +class DeleteQaScorecardRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the QaScorecard to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. If set to true, all of this QaScorecard's child resources will + * also be deleted. Otherwise, the request will only succeed if it has none. + * + * Generated from protobuf field bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $force = false; + + /** + * @param string $name Required. The name of the QaScorecard to delete. Please see + * {@see ContactCenterInsightsClient::qaScorecardName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\DeleteQaScorecardRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the QaScorecard to delete. + * @type bool $force + * Optional. If set to true, all of this QaScorecard's child resources will + * also be deleted. Otherwise, the request will only succeed if it has none. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the QaScorecard to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the QaScorecard to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. If set to true, all of this QaScorecard's child resources will + * also be deleted. Otherwise, the request will only succeed if it has none. + * + * Generated from protobuf field bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Optional. If set to true, all of this QaScorecard's child resources will + * also be deleted. Otherwise, the request will only succeed if it has none. + * + * Generated from protobuf field bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/DeleteQaScorecardRevisionRequest.php b/ContactCenterInsights/src/V1/DeleteQaScorecardRevisionRequest.php new file mode 100644 index 000000000000..f3178e0d913b --- /dev/null +++ b/ContactCenterInsights/src/V1/DeleteQaScorecardRevisionRequest.php @@ -0,0 +1,123 @@ +google.cloud.contactcenterinsights.v1.DeleteQaScorecardRevisionRequest + */ +class DeleteQaScorecardRevisionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the QaScorecardRevision to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. If set to true, all of this QaScorecardRevision's child resources + * will also be deleted. Otherwise, the request will only succeed if it has + * none. + * + * Generated from protobuf field bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $force = false; + + /** + * @param string $name Required. The name of the QaScorecardRevision to delete. Please see + * {@see ContactCenterInsightsClient::qaScorecardRevisionName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\DeleteQaScorecardRevisionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the QaScorecardRevision to delete. + * @type bool $force + * Optional. If set to true, all of this QaScorecardRevision's child resources + * will also be deleted. Otherwise, the request will only succeed if it has + * none. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the QaScorecardRevision to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the QaScorecardRevision to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. If set to true, all of this QaScorecardRevision's child resources + * will also be deleted. Otherwise, the request will only succeed if it has + * none. + * + * Generated from protobuf field bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Optional. If set to true, all of this QaScorecardRevision's child resources + * will also be deleted. Otherwise, the request will only succeed if it has + * none. + * + * Generated from protobuf field bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/DeployQaScorecardRevisionRequest.php b/ContactCenterInsights/src/V1/DeployQaScorecardRevisionRequest.php new file mode 100644 index 000000000000..9df7d1cefd8f --- /dev/null +++ b/ContactCenterInsights/src/V1/DeployQaScorecardRevisionRequest.php @@ -0,0 +1,67 @@ +google.cloud.contactcenterinsights.v1.DeployQaScorecardRevisionRequest + */ +class DeployQaScorecardRevisionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the QaScorecardRevision to deploy. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the QaScorecardRevision to deploy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the QaScorecardRevision to deploy. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the QaScorecardRevision to deploy. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/Dimension.php b/ContactCenterInsights/src/V1/Dimension.php new file mode 100644 index 000000000000..a6abb3ae6da3 --- /dev/null +++ b/ContactCenterInsights/src/V1/Dimension.php @@ -0,0 +1,209 @@ +google.cloud.contactcenterinsights.v1.Dimension + */ +class Dimension extends \Google\Protobuf\Internal\Message +{ + /** + * The key of the dimension. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.Dimension.DimensionKey dimension_key = 1; + */ + protected $dimension_key = 0; + protected $dimension_metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ContactCenterInsights\V1\Dimension\IssueDimensionMetadata $issue_dimension_metadata + * Output only. Metadata about the issue dimension. + * @type \Google\Cloud\ContactCenterInsights\V1\Dimension\AgentDimensionMetadata $agent_dimension_metadata + * Output only. Metadata about the agent dimension. + * @type \Google\Cloud\ContactCenterInsights\V1\Dimension\QaQuestionDimensionMetadata $qa_question_dimension_metadata + * Output only. Metadata about the QA question dimension. + * @type \Google\Cloud\ContactCenterInsights\V1\Dimension\QaQuestionAnswerDimensionMetadata $qa_question_answer_dimension_metadata + * Output only. Metadata about the QA question-answer dimension. + * @type int $dimension_key + * The key of the dimension. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Metadata about the issue dimension. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.Dimension.IssueDimensionMetadata issue_dimension_metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\ContactCenterInsights\V1\Dimension\IssueDimensionMetadata|null + */ + public function getIssueDimensionMetadata() + { + return $this->readOneof(2); + } + + public function hasIssueDimensionMetadata() + { + return $this->hasOneof(2); + } + + /** + * Output only. Metadata about the issue dimension. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.Dimension.IssueDimensionMetadata issue_dimension_metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\ContactCenterInsights\V1\Dimension\IssueDimensionMetadata $var + * @return $this + */ + public function setIssueDimensionMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\Dimension\IssueDimensionMetadata::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Output only. Metadata about the agent dimension. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.Dimension.AgentDimensionMetadata agent_dimension_metadata = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\ContactCenterInsights\V1\Dimension\AgentDimensionMetadata|null + */ + public function getAgentDimensionMetadata() + { + return $this->readOneof(3); + } + + public function hasAgentDimensionMetadata() + { + return $this->hasOneof(3); + } + + /** + * Output only. Metadata about the agent dimension. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.Dimension.AgentDimensionMetadata agent_dimension_metadata = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\ContactCenterInsights\V1\Dimension\AgentDimensionMetadata $var + * @return $this + */ + public function setAgentDimensionMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\Dimension\AgentDimensionMetadata::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Output only. Metadata about the QA question dimension. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.Dimension.QaQuestionDimensionMetadata qa_question_dimension_metadata = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\ContactCenterInsights\V1\Dimension\QaQuestionDimensionMetadata|null + */ + public function getQaQuestionDimensionMetadata() + { + return $this->readOneof(4); + } + + public function hasQaQuestionDimensionMetadata() + { + return $this->hasOneof(4); + } + + /** + * Output only. Metadata about the QA question dimension. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.Dimension.QaQuestionDimensionMetadata qa_question_dimension_metadata = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\ContactCenterInsights\V1\Dimension\QaQuestionDimensionMetadata $var + * @return $this + */ + public function setQaQuestionDimensionMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\Dimension\QaQuestionDimensionMetadata::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Output only. Metadata about the QA question-answer dimension. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.Dimension.QaQuestionAnswerDimensionMetadata qa_question_answer_dimension_metadata = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\ContactCenterInsights\V1\Dimension\QaQuestionAnswerDimensionMetadata|null + */ + public function getQaQuestionAnswerDimensionMetadata() + { + return $this->readOneof(5); + } + + public function hasQaQuestionAnswerDimensionMetadata() + { + return $this->hasOneof(5); + } + + /** + * Output only. Metadata about the QA question-answer dimension. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.Dimension.QaQuestionAnswerDimensionMetadata qa_question_answer_dimension_metadata = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\ContactCenterInsights\V1\Dimension\QaQuestionAnswerDimensionMetadata $var + * @return $this + */ + public function setQaQuestionAnswerDimensionMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\Dimension\QaQuestionAnswerDimensionMetadata::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The key of the dimension. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.Dimension.DimensionKey dimension_key = 1; + * @return int + */ + public function getDimensionKey() + { + return $this->dimension_key; + } + + /** + * The key of the dimension. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.Dimension.DimensionKey dimension_key = 1; + * @param int $var + * @return $this + */ + public function setDimensionKey($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ContactCenterInsights\V1\Dimension\DimensionKey::class); + $this->dimension_key = $var; + + return $this; + } + + /** + * @return string + */ + public function getDimensionMetadata() + { + return $this->whichOneof("dimension_metadata"); + } + +} + diff --git a/ContactCenterInsights/src/V1/Dimension/AgentDimensionMetadata.php b/ContactCenterInsights/src/V1/Dimension/AgentDimensionMetadata.php new file mode 100644 index 000000000000..20bc00a6acba --- /dev/null +++ b/ContactCenterInsights/src/V1/Dimension/AgentDimensionMetadata.php @@ -0,0 +1,136 @@ +google.cloud.contactcenterinsights.v1.Dimension.AgentDimensionMetadata + */ +class AgentDimensionMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A user-specified string representing the agent. + * + * Generated from protobuf field string agent_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $agent_id = ''; + /** + * Optional. The agent's name + * + * Generated from protobuf field string agent_display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $agent_display_name = ''; + /** + * Optional. A user-specified string representing the agent's team. + * + * Generated from protobuf field string agent_team = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $agent_team = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $agent_id + * Optional. A user-specified string representing the agent. + * @type string $agent_display_name + * Optional. The agent's name + * @type string $agent_team + * Optional. A user-specified string representing the agent's team. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A user-specified string representing the agent. + * + * Generated from protobuf field string agent_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAgentId() + { + return $this->agent_id; + } + + /** + * Optional. A user-specified string representing the agent. + * + * Generated from protobuf field string agent_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAgentId($var) + { + GPBUtil::checkString($var, True); + $this->agent_id = $var; + + return $this; + } + + /** + * Optional. The agent's name + * + * Generated from protobuf field string agent_display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAgentDisplayName() + { + return $this->agent_display_name; + } + + /** + * Optional. The agent's name + * + * Generated from protobuf field string agent_display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAgentDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->agent_display_name = $var; + + return $this; + } + + /** + * Optional. A user-specified string representing the agent's team. + * + * Generated from protobuf field string agent_team = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAgentTeam() + { + return $this->agent_team; + } + + /** + * Optional. A user-specified string representing the agent's team. + * + * Generated from protobuf field string agent_team = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAgentTeam($var) + { + GPBUtil::checkString($var, True); + $this->agent_team = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/Dimension/DimensionKey.php b/ContactCenterInsights/src/V1/Dimension/DimensionKey.php new file mode 100644 index 000000000000..ea9c0721720a --- /dev/null +++ b/ContactCenterInsights/src/V1/Dimension/DimensionKey.php @@ -0,0 +1,97 @@ +google.cloud.contactcenterinsights.v1.Dimension.DimensionKey + */ +class DimensionKey +{ + /** + * The key of the dimension is unspecified. + * + * Generated from protobuf enum DIMENSION_KEY_UNSPECIFIED = 0; + */ + const DIMENSION_KEY_UNSPECIFIED = 0; + /** + * The dimension is keyed by issues. + * + * Generated from protobuf enum ISSUE = 1; + */ + const ISSUE = 1; + /** + * The dimension is keyed by agents. + * + * Generated from protobuf enum AGENT = 2; + */ + const AGENT = 2; + /** + * The dimension is keyed by agent teams. + * + * Generated from protobuf enum AGENT_TEAM = 3; + */ + const AGENT_TEAM = 3; + /** + * The dimension is keyed by QaQuestionIds. + * Note that: We only group by the QuestionId and not the revision-id of the + * scorecard this question is a part of. This allows for showing stats for + * the same question across different scorecard revisions. + * + * Generated from protobuf enum QA_QUESTION_ID = 4; + */ + const QA_QUESTION_ID = 4; + /** + * The dimension is keyed by QaQuestionIds-Answer value pairs. + * Note that: We only group by the QuestionId and not the revision-id of the + * scorecard this question is a part of. This allows for showing + * distribution of answers per question across different scorecard + * revisions. + * + * Generated from protobuf enum QA_QUESTION_ANSWER_VALUE = 5; + */ + const QA_QUESTION_ANSWER_VALUE = 5; + /** + * The dimension is keyed by the conversation profile ID. + * + * Generated from protobuf enum CONVERSATION_PROFILE_ID = 6; + */ + const CONVERSATION_PROFILE_ID = 6; + + private static $valueToName = [ + self::DIMENSION_KEY_UNSPECIFIED => 'DIMENSION_KEY_UNSPECIFIED', + self::ISSUE => 'ISSUE', + self::AGENT => 'AGENT', + self::AGENT_TEAM => 'AGENT_TEAM', + self::QA_QUESTION_ID => 'QA_QUESTION_ID', + self::QA_QUESTION_ANSWER_VALUE => 'QA_QUESTION_ANSWER_VALUE', + self::CONVERSATION_PROFILE_ID => 'CONVERSATION_PROFILE_ID', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ContactCenterInsights/src/V1/Dimension/IssueDimensionMetadata.php b/ContactCenterInsights/src/V1/Dimension/IssueDimensionMetadata.php new file mode 100644 index 000000000000..149666f0c582 --- /dev/null +++ b/ContactCenterInsights/src/V1/Dimension/IssueDimensionMetadata.php @@ -0,0 +1,136 @@ +google.cloud.contactcenterinsights.v1.Dimension.IssueDimensionMetadata + */ +class IssueDimensionMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The issue ID. + * + * Generated from protobuf field string issue_id = 1 [(.google.api.resource_reference) = { + */ + protected $issue_id = ''; + /** + * The issue display name. + * + * Generated from protobuf field string issue_display_name = 2; + */ + protected $issue_display_name = ''; + /** + * The parent issue model ID. + * + * Generated from protobuf field string issue_model_id = 3 [(.google.api.resource_reference) = { + */ + protected $issue_model_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $issue_id + * The issue ID. + * @type string $issue_display_name + * The issue display name. + * @type string $issue_model_id + * The parent issue model ID. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * The issue ID. + * + * Generated from protobuf field string issue_id = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getIssueId() + { + return $this->issue_id; + } + + /** + * The issue ID. + * + * Generated from protobuf field string issue_id = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setIssueId($var) + { + GPBUtil::checkString($var, True); + $this->issue_id = $var; + + return $this; + } + + /** + * The issue display name. + * + * Generated from protobuf field string issue_display_name = 2; + * @return string + */ + public function getIssueDisplayName() + { + return $this->issue_display_name; + } + + /** + * The issue display name. + * + * Generated from protobuf field string issue_display_name = 2; + * @param string $var + * @return $this + */ + public function setIssueDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->issue_display_name = $var; + + return $this; + } + + /** + * The parent issue model ID. + * + * Generated from protobuf field string issue_model_id = 3 [(.google.api.resource_reference) = { + * @return string + */ + public function getIssueModelId() + { + return $this->issue_model_id; + } + + /** + * The parent issue model ID. + * + * Generated from protobuf field string issue_model_id = 3 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setIssueModelId($var) + { + GPBUtil::checkString($var, True); + $this->issue_model_id = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/Dimension/QaQuestionAnswerDimensionMetadata.php b/ContactCenterInsights/src/V1/Dimension/QaQuestionAnswerDimensionMetadata.php new file mode 100644 index 000000000000..0e1bcdfbe327 --- /dev/null +++ b/ContactCenterInsights/src/V1/Dimension/QaQuestionAnswerDimensionMetadata.php @@ -0,0 +1,172 @@ +google.cloud.contactcenterinsights.v1.Dimension.QaQuestionAnswerDimensionMetadata + */ +class QaQuestionAnswerDimensionMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The QA scorecard ID. + * + * Generated from protobuf field string qa_scorecard_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $qa_scorecard_id = ''; + /** + * Optional. The QA question ID. + * + * Generated from protobuf field string qa_question_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $qa_question_id = ''; + /** + * Optional. The full body of the question. + * + * Generated from protobuf field string question_body = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $question_body = ''; + /** + * Optional. The full body of the question. + * + * Generated from protobuf field string answer_value = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $answer_value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $qa_scorecard_id + * Optional. The QA scorecard ID. + * @type string $qa_question_id + * Optional. The QA question ID. + * @type string $question_body + * Optional. The full body of the question. + * @type string $answer_value + * Optional. The full body of the question. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The QA scorecard ID. + * + * Generated from protobuf field string qa_scorecard_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQaScorecardId() + { + return $this->qa_scorecard_id; + } + + /** + * Optional. The QA scorecard ID. + * + * Generated from protobuf field string qa_scorecard_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQaScorecardId($var) + { + GPBUtil::checkString($var, True); + $this->qa_scorecard_id = $var; + + return $this; + } + + /** + * Optional. The QA question ID. + * + * Generated from protobuf field string qa_question_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQaQuestionId() + { + return $this->qa_question_id; + } + + /** + * Optional. The QA question ID. + * + * Generated from protobuf field string qa_question_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQaQuestionId($var) + { + GPBUtil::checkString($var, True); + $this->qa_question_id = $var; + + return $this; + } + + /** + * Optional. The full body of the question. + * + * Generated from protobuf field string question_body = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQuestionBody() + { + return $this->question_body; + } + + /** + * Optional. The full body of the question. + * + * Generated from protobuf field string question_body = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQuestionBody($var) + { + GPBUtil::checkString($var, True); + $this->question_body = $var; + + return $this; + } + + /** + * Optional. The full body of the question. + * + * Generated from protobuf field string answer_value = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAnswerValue() + { + return $this->answer_value; + } + + /** + * Optional. The full body of the question. + * + * Generated from protobuf field string answer_value = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAnswerValue($var) + { + GPBUtil::checkString($var, True); + $this->answer_value = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/Dimension/QaQuestionDimensionMetadata.php b/ContactCenterInsights/src/V1/Dimension/QaQuestionDimensionMetadata.php new file mode 100644 index 000000000000..3c703d579cbc --- /dev/null +++ b/ContactCenterInsights/src/V1/Dimension/QaQuestionDimensionMetadata.php @@ -0,0 +1,136 @@ +google.cloud.contactcenterinsights.v1.Dimension.QaQuestionDimensionMetadata + */ +class QaQuestionDimensionMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The QA scorecard ID. + * + * Generated from protobuf field string qa_scorecard_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $qa_scorecard_id = ''; + /** + * Optional. The QA question ID. + * + * Generated from protobuf field string qa_question_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $qa_question_id = ''; + /** + * Optional. The full body of the question. + * + * Generated from protobuf field string question_body = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $question_body = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $qa_scorecard_id + * Optional. The QA scorecard ID. + * @type string $qa_question_id + * Optional. The QA question ID. + * @type string $question_body + * Optional. The full body of the question. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The QA scorecard ID. + * + * Generated from protobuf field string qa_scorecard_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQaScorecardId() + { + return $this->qa_scorecard_id; + } + + /** + * Optional. The QA scorecard ID. + * + * Generated from protobuf field string qa_scorecard_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQaScorecardId($var) + { + GPBUtil::checkString($var, True); + $this->qa_scorecard_id = $var; + + return $this; + } + + /** + * Optional. The QA question ID. + * + * Generated from protobuf field string qa_question_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQaQuestionId() + { + return $this->qa_question_id; + } + + /** + * Optional. The QA question ID. + * + * Generated from protobuf field string qa_question_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQaQuestionId($var) + { + GPBUtil::checkString($var, True); + $this->qa_question_id = $var; + + return $this; + } + + /** + * Optional. The full body of the question. + * + * Generated from protobuf field string question_body = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQuestionBody() + { + return $this->question_body; + } + + /** + * Optional. The full body of the question. + * + * Generated from protobuf field string question_body = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQuestionBody($var) + { + GPBUtil::checkString($var, True); + $this->question_body = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/EncryptionSpec.php b/ContactCenterInsights/src/V1/EncryptionSpec.php index d3efccef926d..a91fa3437b17 100644 --- a/ContactCenterInsights/src/V1/EncryptionSpec.php +++ b/ContactCenterInsights/src/V1/EncryptionSpec.php @@ -10,7 +10,7 @@ /** * A customer-managed encryption key specification that can be applied to all - * created resources (e.g. Conversation). + * created resources (e.g. `Conversation`). * * Generated from protobuf message google.cloud.contactcenterinsights.v1.EncryptionSpec */ @@ -27,8 +27,8 @@ class EncryptionSpec extends \Google\Protobuf\Internal\Message /** * Required. 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: + * by our default 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}` * * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -48,8 +48,8 @@ class EncryptionSpec extends \Google\Protobuf\Internal\Message * @type string $kms_key * Required. 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: + * by our default 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}` * } */ @@ -91,8 +91,8 @@ public function setName($var) /** * Required. 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: + * by our default 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}` * * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -106,8 +106,8 @@ public function getKmsKey() /** * Required. 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: + * by our default 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}` * * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = REQUIRED]; diff --git a/ContactCenterInsights/src/V1/FeedbackLabel.php b/ContactCenterInsights/src/V1/FeedbackLabel.php new file mode 100644 index 000000000000..e59875d7d42d --- /dev/null +++ b/ContactCenterInsights/src/V1/FeedbackLabel.php @@ -0,0 +1,272 @@ +google.cloud.contactcenterinsights.v1.FeedbackLabel + */ +class FeedbackLabel extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. Resource name of the FeedbackLabel. + * Format: + * projects/{project}/locations/{location}/conversations/{conversation}/feedbackLabels/{feedback_label} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Resource name of the resource to be labeled. + * + * Generated from protobuf field string labeled_resource = 3; + */ + protected $labeled_resource = ''; + /** + * Output only. Create time of the label. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time of the label. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + protected $label_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $label + * String label. + * @type \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerValue $qa_answer_label + * QaAnswer label. + * @type string $name + * Immutable. Resource name of the FeedbackLabel. + * Format: + * projects/{project}/locations/{location}/conversations/{conversation}/feedbackLabels/{feedback_label} + * @type string $labeled_resource + * Resource name of the resource to be labeled. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time of the label. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time of the label. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * String label. + * + * Generated from protobuf field string label = 4; + * @return string + */ + public function getLabel() + { + return $this->readOneof(4); + } + + public function hasLabel() + { + return $this->hasOneof(4); + } + + /** + * String label. + * + * Generated from protobuf field string label = 4; + * @param string $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * QaAnswer label. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaAnswer.AnswerValue qa_answer_label = 7; + * @return \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerValue|null + */ + public function getQaAnswerLabel() + { + return $this->readOneof(7); + } + + public function hasQaAnswerLabel() + { + return $this->hasOneof(7); + } + + /** + * QaAnswer label. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaAnswer.AnswerValue qa_answer_label = 7; + * @param \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerValue $var + * @return $this + */ + public function setQaAnswerLabel($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerValue::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Immutable. Resource name of the FeedbackLabel. + * Format: + * projects/{project}/locations/{location}/conversations/{conversation}/feedbackLabels/{feedback_label} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. Resource name of the FeedbackLabel. + * Format: + * projects/{project}/locations/{location}/conversations/{conversation}/feedbackLabels/{feedback_label} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Resource name of the resource to be labeled. + * + * Generated from protobuf field string labeled_resource = 3; + * @return string + */ + public function getLabeledResource() + { + return $this->labeled_resource; + } + + /** + * Resource name of the resource to be labeled. + * + * Generated from protobuf field string labeled_resource = 3; + * @param string $var + * @return $this + */ + public function setLabeledResource($var) + { + GPBUtil::checkString($var, True); + $this->labeled_resource = $var; + + return $this; + } + + /** + * Output only. Create time of the label. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Create time of the label. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Update time of the label. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Update time of the label. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * @return string + */ + public function getLabelType() + { + return $this->whichOneof("label_type"); + } + +} + diff --git a/ContactCenterInsights/src/V1/GetAnalysisRuleRequest.php b/ContactCenterInsights/src/V1/GetAnalysisRuleRequest.php new file mode 100644 index 000000000000..06b729e7dfc0 --- /dev/null +++ b/ContactCenterInsights/src/V1/GetAnalysisRuleRequest.php @@ -0,0 +1,81 @@ +google.cloud.contactcenterinsights.v1.GetAnalysisRuleRequest + */ +class GetAnalysisRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the AnalysisRule to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the AnalysisRule to get. Please see + * {@see ContactCenterInsightsClient::analysisRuleName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\GetAnalysisRuleRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the AnalysisRule to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the AnalysisRule to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the AnalysisRule to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/GetFeedbackLabelRequest.php b/ContactCenterInsights/src/V1/GetFeedbackLabelRequest.php new file mode 100644 index 000000000000..e9b96851b796 --- /dev/null +++ b/ContactCenterInsights/src/V1/GetFeedbackLabelRequest.php @@ -0,0 +1,81 @@ +google.cloud.contactcenterinsights.v1.GetFeedbackLabelRequest + */ +class GetFeedbackLabelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the feedback label to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the feedback label to get. Please see + * {@see ContactCenterInsightsClient::feedbackLabelName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\GetFeedbackLabelRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the feedback label to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the feedback label to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the feedback label to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/GetQaQuestionRequest.php b/ContactCenterInsights/src/V1/GetQaQuestionRequest.php new file mode 100644 index 000000000000..583d9137487c --- /dev/null +++ b/ContactCenterInsights/src/V1/GetQaQuestionRequest.php @@ -0,0 +1,81 @@ +google.cloud.contactcenterinsights.v1.GetQaQuestionRequest + */ +class GetQaQuestionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the QaQuestion to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the QaQuestion to get. Please see + * {@see ContactCenterInsightsClient::qaQuestionName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\GetQaQuestionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the QaQuestion to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the QaQuestion to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the QaQuestion to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/GetQaScorecardRequest.php b/ContactCenterInsights/src/V1/GetQaScorecardRequest.php new file mode 100644 index 000000000000..c88916de02d3 --- /dev/null +++ b/ContactCenterInsights/src/V1/GetQaScorecardRequest.php @@ -0,0 +1,81 @@ +google.cloud.contactcenterinsights.v1.GetQaScorecardRequest + */ +class GetQaScorecardRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the QaScorecard to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the QaScorecard to get. Please see + * {@see ContactCenterInsightsClient::qaScorecardName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\GetQaScorecardRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the QaScorecard to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the QaScorecard to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the QaScorecard to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/GetQaScorecardRevisionRequest.php b/ContactCenterInsights/src/V1/GetQaScorecardRevisionRequest.php new file mode 100644 index 000000000000..33e32dde8325 --- /dev/null +++ b/ContactCenterInsights/src/V1/GetQaScorecardRevisionRequest.php @@ -0,0 +1,81 @@ +google.cloud.contactcenterinsights.v1.GetQaScorecardRevisionRequest + */ +class GetQaScorecardRevisionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the QaScorecardRevision to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the QaScorecardRevision to get. Please see + * {@see ContactCenterInsightsClient::qaScorecardRevisionName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\GetQaScorecardRevisionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the QaScorecardRevision to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the QaScorecardRevision to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the QaScorecardRevision to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/IngestConversationsRequest/GcsSource.php b/ContactCenterInsights/src/V1/IngestConversationsRequest/GcsSource.php index b09e2ad81e11..a4b85453eae3 100644 --- a/ContactCenterInsights/src/V1/IngestConversationsRequest/GcsSource.php +++ b/ContactCenterInsights/src/V1/IngestConversationsRequest/GcsSource.php @@ -43,7 +43,7 @@ class GcsSource extends \Google\Protobuf\Internal\Message /** * Optional. Custom keys to extract as conversation labels from metadata * files in `metadata_bucket_uri`. Keys not included in this field will be - * ignored. Note that there is a limit of 20 labels per conversation. + * ignored. Note that there is a limit of 100 labels per conversation. * * Generated from protobuf field repeated string custom_metadata_keys = 12 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -71,7 +71,7 @@ class GcsSource extends \Google\Protobuf\Internal\Message * @type array|\Google\Protobuf\Internal\RepeatedField $custom_metadata_keys * Optional. Custom keys to extract as conversation labels from metadata * files in `metadata_bucket_uri`. Keys not included in this field will be - * ignored. Note that there is a limit of 20 labels per conversation. + * ignored. Note that there is a limit of 100 labels per conversation. * } */ public function __construct($data = NULL) { @@ -184,7 +184,7 @@ public function setMetadataBucketUri($var) /** * Optional. Custom keys to extract as conversation labels from metadata * files in `metadata_bucket_uri`. Keys not included in this field will be - * ignored. Note that there is a limit of 20 labels per conversation. + * ignored. Note that there is a limit of 100 labels per conversation. * * Generated from protobuf field repeated string custom_metadata_keys = 12 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Protobuf\Internal\RepeatedField @@ -197,7 +197,7 @@ public function getCustomMetadataKeys() /** * Optional. Custom keys to extract as conversation labels from metadata * files in `metadata_bucket_uri`. Keys not included in this field will be - * ignored. Note that there is a limit of 20 labels per conversation. + * ignored. Note that there is a limit of 100 labels per conversation. * * Generated from protobuf field repeated string custom_metadata_keys = 12 [(.google.api.field_behavior) = OPTIONAL]; * @param array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/ContactCenterInsights/src/V1/InitializeEncryptionSpecMetadata.php b/ContactCenterInsights/src/V1/InitializeEncryptionSpecMetadata.php index c0baf71e1a3d..861225e3918f 100644 --- a/ContactCenterInsights/src/V1/InitializeEncryptionSpecMetadata.php +++ b/ContactCenterInsights/src/V1/InitializeEncryptionSpecMetadata.php @@ -34,7 +34,7 @@ class InitializeEncryptionSpecMetadata extends \Google\Protobuf\Internal\Message */ protected $request = null; /** - * Partial errors during initialising operation that might cause the operation + * Partial errors during initializing operation that might cause the operation * output to be incomplete. * * Generated from protobuf field repeated .google.rpc.Status partial_errors = 4; @@ -54,7 +54,7 @@ class InitializeEncryptionSpecMetadata extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\ContactCenterInsights\V1\InitializeEncryptionSpecRequest $request * Output only. The original request for initialization. * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $partial_errors - * Partial errors during initialising operation that might cause the operation + * Partial errors during initializing operation that might cause the operation * output to be incomplete. * } */ @@ -172,7 +172,7 @@ public function setRequest($var) } /** - * Partial errors during initialising operation that might cause the operation + * Partial errors during initializing operation that might cause the operation * output to be incomplete. * * Generated from protobuf field repeated .google.rpc.Status partial_errors = 4; @@ -184,7 +184,7 @@ public function getPartialErrors() } /** - * Partial errors during initialising operation that might cause the operation + * Partial errors during initializing operation that might cause the operation * output to be incomplete. * * Generated from protobuf field repeated .google.rpc.Status partial_errors = 4; diff --git a/ContactCenterInsights/src/V1/InitializeEncryptionSpecRequest.php b/ContactCenterInsights/src/V1/InitializeEncryptionSpecRequest.php index a140e2788c3e..46e5af435e5d 100644 --- a/ContactCenterInsights/src/V1/InitializeEncryptionSpecRequest.php +++ b/ContactCenterInsights/src/V1/InitializeEncryptionSpecRequest.php @@ -19,7 +19,7 @@ class InitializeEncryptionSpecRequest extends \Google\Protobuf\Internal\Message * Required. The encryption spec used for CMEK encryption. It is required that * the kms key is in the same region as the endpoint. The same key will be * used for all provisioned resources, if encryption is available. If the - * kms_key_name is left empty, no encryption will be enforced. + * `kms_key_name` field is left empty, no encryption will be enforced. * * Generated from protobuf field .google.cloud.contactcenterinsights.v1.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED]; */ @@ -29,7 +29,7 @@ class InitializeEncryptionSpecRequest extends \Google\Protobuf\Internal\Message * @param \Google\Cloud\ContactCenterInsights\V1\EncryptionSpec $encryptionSpec Required. The encryption spec used for CMEK encryption. It is required that * the kms key is in the same region as the endpoint. The same key will be * used for all provisioned resources, if encryption is available. If the - * kms_key_name is left empty, no encryption will be enforced. + * `kms_key_name` field is left empty, no encryption will be enforced. * * @return \Google\Cloud\ContactCenterInsights\V1\InitializeEncryptionSpecRequest * @@ -51,7 +51,7 @@ public static function build(\Google\Cloud\ContactCenterInsights\V1\EncryptionSp * Required. The encryption spec used for CMEK encryption. It is required that * the kms key is in the same region as the endpoint. The same key will be * used for all provisioned resources, if encryption is available. If the - * kms_key_name is left empty, no encryption will be enforced. + * `kms_key_name` field is left empty, no encryption will be enforced. * } */ public function __construct($data = NULL) { @@ -63,7 +63,7 @@ public function __construct($data = NULL) { * Required. The encryption spec used for CMEK encryption. It is required that * the kms key is in the same region as the endpoint. The same key will be * used for all provisioned resources, if encryption is available. If the - * kms_key_name is left empty, no encryption will be enforced. + * `kms_key_name` field is left empty, no encryption will be enforced. * * Generated from protobuf field .google.cloud.contactcenterinsights.v1.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Cloud\ContactCenterInsights\V1\EncryptionSpec|null @@ -87,7 +87,7 @@ public function clearEncryptionSpec() * Required. The encryption spec used for CMEK encryption. It is required that * the kms key is in the same region as the endpoint. The same key will be * used for all provisioned resources, if encryption is available. If the - * kms_key_name is left empty, no encryption will be enforced. + * `kms_key_name` field is left empty, no encryption will be enforced. * * Generated from protobuf field .google.cloud.contactcenterinsights.v1.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED]; * @param \Google\Cloud\ContactCenterInsights\V1\EncryptionSpec $var diff --git a/ContactCenterInsights/src/V1/ListAllFeedbackLabelsRequest.php b/ContactCenterInsights/src/V1/ListAllFeedbackLabelsRequest.php new file mode 100644 index 000000000000..ef9e60d9bc14 --- /dev/null +++ b/ContactCenterInsights/src/V1/ListAllFeedbackLabelsRequest.php @@ -0,0 +1,243 @@ +google.cloud.contactcenterinsights.v1.ListAllFeedbackLabelsRequest + */ +class ListAllFeedbackLabelsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of all feedback labels per project. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of feedback labels to return in the response. + * A valid page size ranges from 0 to 100,000 inclusive. If the page size is + * zero or unspecified, a default page size of 100 will be chosen. Note that a + * call might return fewer results than the requested page size. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The value returned by the last `ListAllFeedbackLabelsResponse`. + * This value indicates that this is a continuation of a prior + * `ListAllFeedbackLabels` call and that the system should return the next + * page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A filter to reduce results to a specific subset in the entire + * project. Supports disjunctions (OR) and conjunctions (AND). + * Supported fields: + * * `issue_model_id` + * * `qa_question_id` + * * `min_create_time` + * * `max_create_time` + * * `min_update_time` + * * `max_update_time` + * * `feedback_label_type`: QUALITY_AI, TOPIC_MODELING + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The parent resource of all feedback labels per project. Please see + * {@see ContactCenterInsightsClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\ListAllFeedbackLabelsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of all feedback labels per project. + * @type int $page_size + * Optional. The maximum number of feedback labels to return in the response. + * A valid page size ranges from 0 to 100,000 inclusive. If the page size is + * zero or unspecified, a default page size of 100 will be chosen. Note that a + * call might return fewer results than the requested page size. + * @type string $page_token + * Optional. The value returned by the last `ListAllFeedbackLabelsResponse`. + * This value indicates that this is a continuation of a prior + * `ListAllFeedbackLabels` call and that the system should return the next + * page of data. + * @type string $filter + * Optional. A filter to reduce results to a specific subset in the entire + * project. Supports disjunctions (OR) and conjunctions (AND). + * Supported fields: + * * `issue_model_id` + * * `qa_question_id` + * * `min_create_time` + * * `max_create_time` + * * `min_update_time` + * * `max_update_time` + * * `feedback_label_type`: QUALITY_AI, TOPIC_MODELING + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of all feedback labels per project. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of all feedback labels per project. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of feedback labels to return in the response. + * A valid page size ranges from 0 to 100,000 inclusive. If the page size is + * zero or unspecified, a default page size of 100 will be chosen. Note that a + * call might return fewer results than the requested page size. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of feedback labels to return in the response. + * A valid page size ranges from 0 to 100,000 inclusive. If the page size is + * zero or unspecified, a default page size of 100 will be chosen. Note that a + * call might return fewer results than the requested page size. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The value returned by the last `ListAllFeedbackLabelsResponse`. + * This value indicates that this is a continuation of a prior + * `ListAllFeedbackLabels` call and that the system should return the next + * page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The value returned by the last `ListAllFeedbackLabelsResponse`. + * This value indicates that this is a continuation of a prior + * `ListAllFeedbackLabels` call and that the system should return the next + * page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. A filter to reduce results to a specific subset in the entire + * project. Supports disjunctions (OR) and conjunctions (AND). + * Supported fields: + * * `issue_model_id` + * * `qa_question_id` + * * `min_create_time` + * * `max_create_time` + * * `min_update_time` + * * `max_update_time` + * * `feedback_label_type`: QUALITY_AI, TOPIC_MODELING + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A filter to reduce results to a specific subset in the entire + * project. Supports disjunctions (OR) and conjunctions (AND). + * Supported fields: + * * `issue_model_id` + * * `qa_question_id` + * * `min_create_time` + * * `max_create_time` + * * `min_update_time` + * * `max_update_time` + * * `feedback_label_type`: QUALITY_AI, TOPIC_MODELING + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/ListAllFeedbackLabelsResponse.php b/ContactCenterInsights/src/V1/ListAllFeedbackLabelsResponse.php new file mode 100644 index 000000000000..91eba08eec2c --- /dev/null +++ b/ContactCenterInsights/src/V1/ListAllFeedbackLabelsResponse.php @@ -0,0 +1,105 @@ +google.cloud.contactcenterinsights.v1.ListAllFeedbackLabelsResponse + */ +class ListAllFeedbackLabelsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The feedback labels that match the request. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.FeedbackLabel feedback_labels = 1; + */ + private $feedback_labels; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ContactCenterInsights\V1\FeedbackLabel>|\Google\Protobuf\Internal\RepeatedField $feedback_labels + * The feedback labels that match the request. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * The feedback labels that match the request. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.FeedbackLabel feedback_labels = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFeedbackLabels() + { + return $this->feedback_labels; + } + + /** + * The feedback labels that match the request. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.FeedbackLabel feedback_labels = 1; + * @param array<\Google\Cloud\ContactCenterInsights\V1\FeedbackLabel>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFeedbackLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\FeedbackLabel::class); + $this->feedback_labels = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/ListAnalysisRulesRequest.php b/ContactCenterInsights/src/V1/ListAnalysisRulesRequest.php new file mode 100644 index 000000000000..669c2c1a5bb4 --- /dev/null +++ b/ContactCenterInsights/src/V1/ListAnalysisRulesRequest.php @@ -0,0 +1,169 @@ +google.cloud.contactcenterinsights.v1.ListAnalysisRulesRequest + */ +class ListAnalysisRulesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the analysis rules. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of analysis rule to return in the response. If + * this value is zero, the service will select a default size. A call may + * return fewer objects than requested. A non-empty `next_page_token` in the + * response indicates that more data is available. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The value returned by the last `ListAnalysisRulesResponse`; + * indicates that this is a continuation of a prior `ListAnalysisRules` call + * and the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent resource of the analysis rules. Please see + * {@see ContactCenterInsightsClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\ListAnalysisRulesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the analysis rules. + * @type int $page_size + * Optional. The maximum number of analysis rule to return in the response. If + * this value is zero, the service will select a default size. A call may + * return fewer objects than requested. A non-empty `next_page_token` in the + * response indicates that more data is available. + * @type string $page_token + * Optional. The value returned by the last `ListAnalysisRulesResponse`; + * indicates that this is a continuation of a prior `ListAnalysisRules` call + * and the system should return the next page of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the analysis rules. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the analysis rules. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of analysis rule to return in the response. If + * this value is zero, the service will select a default size. A call may + * return fewer objects than requested. A non-empty `next_page_token` in the + * response indicates that more data is available. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of analysis rule to return in the response. If + * this value is zero, the service will select a default size. A call may + * return fewer objects than requested. A non-empty `next_page_token` in the + * response indicates that more data is available. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The value returned by the last `ListAnalysisRulesResponse`; + * indicates that this is a continuation of a prior `ListAnalysisRules` call + * and the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The value returned by the last `ListAnalysisRulesResponse`; + * indicates that this is a continuation of a prior `ListAnalysisRules` call + * and the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/ListAnalysisRulesResponse.php b/ContactCenterInsights/src/V1/ListAnalysisRulesResponse.php new file mode 100644 index 000000000000..9ac585f2aeea --- /dev/null +++ b/ContactCenterInsights/src/V1/ListAnalysisRulesResponse.php @@ -0,0 +1,105 @@ +google.cloud.contactcenterinsights.v1.ListAnalysisRulesResponse + */ +class ListAnalysisRulesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The analysis_rule that match the request. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.AnalysisRule analysis_rules = 1; + */ + private $analysis_rules; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ContactCenterInsights\V1\AnalysisRule>|\Google\Protobuf\Internal\RepeatedField $analysis_rules + * The analysis_rule that match the request. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * The analysis_rule that match the request. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.AnalysisRule analysis_rules = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnalysisRules() + { + return $this->analysis_rules; + } + + /** + * The analysis_rule that match the request. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.AnalysisRule analysis_rules = 1; + * @param array<\Google\Cloud\ContactCenterInsights\V1\AnalysisRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnalysisRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\AnalysisRule::class); + $this->analysis_rules = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/ListFeedbackLabelsRequest.php b/ContactCenterInsights/src/V1/ListFeedbackLabelsRequest.php new file mode 100644 index 000000000000..d8d7ac6fe694 --- /dev/null +++ b/ContactCenterInsights/src/V1/ListFeedbackLabelsRequest.php @@ -0,0 +1,251 @@ +google.cloud.contactcenterinsights.v1.ListFeedbackLabelsRequest + */ +class ListFeedbackLabelsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the feedback labels. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. A filter to reduce results to a specific subset. Supports + * disjunctions (OR) and conjunctions (AND). Automatically sorts by + * conversation ID. To sort by all feedback labels in a project see + * ListAllFeedbackLabels. + * Supported fields: + * * `issue_model_id` + * * `qa_question_id` + * * `qa_scorecard_id` + * * `min_create_time` + * * `max_create_time` + * * `min_update_time` + * * `max_update_time` + * * `feedback_label_type`: QUALITY_AI, TOPIC_MODELING + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The maximum number of feedback labels to return in the response. + * A valid page size ranges from 0 to 100,000 inclusive. If the page size is + * zero or unspecified, a default page size of 100 will be chosen. Note that a + * call might return fewer results than the requested page size. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The value returned by the last `ListFeedbackLabelsResponse`. This + * value indicates that this is a continuation of a prior `ListFeedbackLabels` + * call and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent resource of the feedback labels. Please see + * {@see ContactCenterInsightsClient::conversationName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\ListFeedbackLabelsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the feedback labels. + * @type string $filter + * Optional. A filter to reduce results to a specific subset. Supports + * disjunctions (OR) and conjunctions (AND). Automatically sorts by + * conversation ID. To sort by all feedback labels in a project see + * ListAllFeedbackLabels. + * Supported fields: + * * `issue_model_id` + * * `qa_question_id` + * * `qa_scorecard_id` + * * `min_create_time` + * * `max_create_time` + * * `min_update_time` + * * `max_update_time` + * * `feedback_label_type`: QUALITY_AI, TOPIC_MODELING + * @type int $page_size + * Optional. The maximum number of feedback labels to return in the response. + * A valid page size ranges from 0 to 100,000 inclusive. If the page size is + * zero or unspecified, a default page size of 100 will be chosen. Note that a + * call might return fewer results than the requested page size. + * @type string $page_token + * Optional. The value returned by the last `ListFeedbackLabelsResponse`. This + * value indicates that this is a continuation of a prior `ListFeedbackLabels` + * call and that the system should return the next page of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the feedback labels. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the feedback labels. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. A filter to reduce results to a specific subset. Supports + * disjunctions (OR) and conjunctions (AND). Automatically sorts by + * conversation ID. To sort by all feedback labels in a project see + * ListAllFeedbackLabels. + * Supported fields: + * * `issue_model_id` + * * `qa_question_id` + * * `qa_scorecard_id` + * * `min_create_time` + * * `max_create_time` + * * `min_update_time` + * * `max_update_time` + * * `feedback_label_type`: QUALITY_AI, TOPIC_MODELING + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A filter to reduce results to a specific subset. Supports + * disjunctions (OR) and conjunctions (AND). Automatically sorts by + * conversation ID. To sort by all feedback labels in a project see + * ListAllFeedbackLabels. + * Supported fields: + * * `issue_model_id` + * * `qa_question_id` + * * `qa_scorecard_id` + * * `min_create_time` + * * `max_create_time` + * * `min_update_time` + * * `max_update_time` + * * `feedback_label_type`: QUALITY_AI, TOPIC_MODELING + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The maximum number of feedback labels to return in the response. + * A valid page size ranges from 0 to 100,000 inclusive. If the page size is + * zero or unspecified, a default page size of 100 will be chosen. Note that a + * call might return fewer results than the requested page size. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of feedback labels to return in the response. + * A valid page size ranges from 0 to 100,000 inclusive. If the page size is + * zero or unspecified, a default page size of 100 will be chosen. Note that a + * call might return fewer results than the requested page size. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The value returned by the last `ListFeedbackLabelsResponse`. This + * value indicates that this is a continuation of a prior `ListFeedbackLabels` + * call and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The value returned by the last `ListFeedbackLabelsResponse`. This + * value indicates that this is a continuation of a prior `ListFeedbackLabels` + * call and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/ListFeedbackLabelsResponse.php b/ContactCenterInsights/src/V1/ListFeedbackLabelsResponse.php new file mode 100644 index 000000000000..de015c00ba02 --- /dev/null +++ b/ContactCenterInsights/src/V1/ListFeedbackLabelsResponse.php @@ -0,0 +1,101 @@ +google.cloud.contactcenterinsights.v1.ListFeedbackLabelsResponse + */ +class ListFeedbackLabelsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The feedback labels that match the request. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.FeedbackLabel feedback_labels = 1; + */ + private $feedback_labels; + /** + * The next page token. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ContactCenterInsights\V1\FeedbackLabel>|\Google\Protobuf\Internal\RepeatedField $feedback_labels + * The feedback labels that match the request. + * @type string $next_page_token + * The next page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * The feedback labels that match the request. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.FeedbackLabel feedback_labels = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFeedbackLabels() + { + return $this->feedback_labels; + } + + /** + * The feedback labels that match the request. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.FeedbackLabel feedback_labels = 1; + * @param array<\Google\Cloud\ContactCenterInsights\V1\FeedbackLabel>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFeedbackLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\FeedbackLabel::class); + $this->feedback_labels = $arr; + + return $this; + } + + /** + * The next page token. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The next page token. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/ListQaQuestionsRequest.php b/ContactCenterInsights/src/V1/ListQaQuestionsRequest.php new file mode 100644 index 000000000000..7f6fe2028e34 --- /dev/null +++ b/ContactCenterInsights/src/V1/ListQaQuestionsRequest.php @@ -0,0 +1,169 @@ +google.cloud.contactcenterinsights.v1.ListQaQuestionsRequest + */ +class ListQaQuestionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the questions. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of questions to return in the response. If the + * value is zero, the service will select a default size. A call might return + * fewer objects than requested. A non-empty `next_page_token` in the response + * indicates that more data is available. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The value returned by the last `ListQaQuestionsResponse`. This + * value indicates that this is a continuation of a prior `ListQaQuestions` + * call and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent resource of the questions. Please see + * {@see ContactCenterInsightsClient::qaScorecardRevisionName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\ListQaQuestionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the questions. + * @type int $page_size + * Optional. The maximum number of questions to return in the response. If the + * value is zero, the service will select a default size. A call might return + * fewer objects than requested. A non-empty `next_page_token` in the response + * indicates that more data is available. + * @type string $page_token + * Optional. The value returned by the last `ListQaQuestionsResponse`. This + * value indicates that this is a continuation of a prior `ListQaQuestions` + * call and that the system should return the next page of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the questions. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the questions. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of questions to return in the response. If the + * value is zero, the service will select a default size. A call might return + * fewer objects than requested. A non-empty `next_page_token` in the response + * indicates that more data is available. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of questions to return in the response. If the + * value is zero, the service will select a default size. A call might return + * fewer objects than requested. A non-empty `next_page_token` in the response + * indicates that more data is available. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The value returned by the last `ListQaQuestionsResponse`. This + * value indicates that this is a continuation of a prior `ListQaQuestions` + * call and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The value returned by the last `ListQaQuestionsResponse`. This + * value indicates that this is a continuation of a prior `ListQaQuestions` + * call and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/ListQaQuestionsResponse.php b/ContactCenterInsights/src/V1/ListQaQuestionsResponse.php new file mode 100644 index 000000000000..dd2b4921404d --- /dev/null +++ b/ContactCenterInsights/src/V1/ListQaQuestionsResponse.php @@ -0,0 +1,105 @@ +google.cloud.contactcenterinsights.v1.ListQaQuestionsResponse + */ +class ListQaQuestionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The QaQuestions under the parent. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaQuestion qa_questions = 1; + */ + private $qa_questions; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ContactCenterInsights\V1\QaQuestion>|\Google\Protobuf\Internal\RepeatedField $qa_questions + * The QaQuestions under the parent. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * The QaQuestions under the parent. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaQuestion qa_questions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQaQuestions() + { + return $this->qa_questions; + } + + /** + * The QaQuestions under the parent. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaQuestion qa_questions = 1; + * @param array<\Google\Cloud\ContactCenterInsights\V1\QaQuestion>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQaQuestions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\QaQuestion::class); + $this->qa_questions = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/ListQaScorecardRevisionsRequest.php b/ContactCenterInsights/src/V1/ListQaScorecardRevisionsRequest.php new file mode 100644 index 000000000000..101d88e101b5 --- /dev/null +++ b/ContactCenterInsights/src/V1/ListQaScorecardRevisionsRequest.php @@ -0,0 +1,221 @@ +google.cloud.contactcenterinsights.v1.ListQaScorecardRevisionsRequest + */ +class ListQaScorecardRevisionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the scorecard revisions. To list all + * revisions of all scorecards, substitute the QaScorecard ID with a '-' + * character. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of scorecard revisions to return in the + * response. If the value is zero, the service will select a default size. A + * call might return fewer objects than requested. A non-empty + * `next_page_token` in the response indicates that more data is available. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The value returned by the last + * `ListQaScorecardRevisionsResponse`. This value indicates that this is a + * continuation of a prior `ListQaScorecardRevisions` call and that the system + * should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A filter to reduce results to a specific subset. Useful for + * querying scorecard revisions with specific properties. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The parent resource of the scorecard revisions. To list all + * revisions of all scorecards, substitute the QaScorecard ID with a '-' + * character. Please see + * {@see ContactCenterInsightsClient::qaScorecardName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\ListQaScorecardRevisionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the scorecard revisions. To list all + * revisions of all scorecards, substitute the QaScorecard ID with a '-' + * character. + * @type int $page_size + * Optional. The maximum number of scorecard revisions to return in the + * response. If the value is zero, the service will select a default size. A + * call might return fewer objects than requested. A non-empty + * `next_page_token` in the response indicates that more data is available. + * @type string $page_token + * Optional. The value returned by the last + * `ListQaScorecardRevisionsResponse`. This value indicates that this is a + * continuation of a prior `ListQaScorecardRevisions` call and that the system + * should return the next page of data. + * @type string $filter + * Optional. A filter to reduce results to a specific subset. Useful for + * querying scorecard revisions with specific properties. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the scorecard revisions. To list all + * revisions of all scorecards, substitute the QaScorecard ID with a '-' + * character. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the scorecard revisions. To list all + * revisions of all scorecards, substitute the QaScorecard ID with a '-' + * character. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of scorecard revisions to return in the + * response. If the value is zero, the service will select a default size. A + * call might return fewer objects than requested. A non-empty + * `next_page_token` in the response indicates that more data is available. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of scorecard revisions to return in the + * response. If the value is zero, the service will select a default size. A + * call might return fewer objects than requested. A non-empty + * `next_page_token` in the response indicates that more data is available. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The value returned by the last + * `ListQaScorecardRevisionsResponse`. This value indicates that this is a + * continuation of a prior `ListQaScorecardRevisions` call and that the system + * should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The value returned by the last + * `ListQaScorecardRevisionsResponse`. This value indicates that this is a + * continuation of a prior `ListQaScorecardRevisions` call and that the system + * should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. A filter to reduce results to a specific subset. Useful for + * querying scorecard revisions with specific properties. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A filter to reduce results to a specific subset. Useful for + * querying scorecard revisions with specific properties. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/ListQaScorecardRevisionsResponse.php b/ContactCenterInsights/src/V1/ListQaScorecardRevisionsResponse.php new file mode 100644 index 000000000000..94602098bcc8 --- /dev/null +++ b/ContactCenterInsights/src/V1/ListQaScorecardRevisionsResponse.php @@ -0,0 +1,105 @@ +google.cloud.contactcenterinsights.v1.ListQaScorecardRevisionsResponse + */ +class ListQaScorecardRevisionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The QaScorecards under the parent. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaScorecardRevision qa_scorecard_revisions = 1; + */ + private $qa_scorecard_revisions; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ContactCenterInsights\V1\QaScorecardRevision>|\Google\Protobuf\Internal\RepeatedField $qa_scorecard_revisions + * The QaScorecards under the parent. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * The QaScorecards under the parent. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaScorecardRevision qa_scorecard_revisions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQaScorecardRevisions() + { + return $this->qa_scorecard_revisions; + } + + /** + * The QaScorecards under the parent. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaScorecardRevision qa_scorecard_revisions = 1; + * @param array<\Google\Cloud\ContactCenterInsights\V1\QaScorecardRevision>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQaScorecardRevisions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\QaScorecardRevision::class); + $this->qa_scorecard_revisions = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/ListQaScorecardsRequest.php b/ContactCenterInsights/src/V1/ListQaScorecardsRequest.php new file mode 100644 index 000000000000..2c3c43c14352 --- /dev/null +++ b/ContactCenterInsights/src/V1/ListQaScorecardsRequest.php @@ -0,0 +1,169 @@ +google.cloud.contactcenterinsights.v1.ListQaScorecardsRequest + */ +class ListQaScorecardsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the scorecards. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of scorecards to return in the response. If + * the value is zero, the service will select a default size. A call might + * return fewer objects than requested. A non-empty `next_page_token` in the + * response indicates that more data is available. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The value returned by the last `ListQaScorecardsResponse`. This + * value indicates that this is a continuation of a prior `ListQaScorecards` + * call and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent resource of the scorecards. Please see + * {@see ContactCenterInsightsClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\ListQaScorecardsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the scorecards. + * @type int $page_size + * Optional. The maximum number of scorecards to return in the response. If + * the value is zero, the service will select a default size. A call might + * return fewer objects than requested. A non-empty `next_page_token` in the + * response indicates that more data is available. + * @type string $page_token + * Optional. The value returned by the last `ListQaScorecardsResponse`. This + * value indicates that this is a continuation of a prior `ListQaScorecards` + * call and that the system should return the next page of data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the scorecards. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the scorecards. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of scorecards to return in the response. If + * the value is zero, the service will select a default size. A call might + * return fewer objects than requested. A non-empty `next_page_token` in the + * response indicates that more data is available. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of scorecards to return in the response. If + * the value is zero, the service will select a default size. A call might + * return fewer objects than requested. A non-empty `next_page_token` in the + * response indicates that more data is available. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The value returned by the last `ListQaScorecardsResponse`. This + * value indicates that this is a continuation of a prior `ListQaScorecards` + * call and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The value returned by the last `ListQaScorecardsResponse`. This + * value indicates that this is a continuation of a prior `ListQaScorecards` + * call and that the system should return the next page of data. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/ListQaScorecardsResponse.php b/ContactCenterInsights/src/V1/ListQaScorecardsResponse.php new file mode 100644 index 000000000000..0ba9b256c4df --- /dev/null +++ b/ContactCenterInsights/src/V1/ListQaScorecardsResponse.php @@ -0,0 +1,105 @@ +google.cloud.contactcenterinsights.v1.ListQaScorecardsResponse + */ +class ListQaScorecardsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The QaScorecards under the parent. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaScorecard qa_scorecards = 1; + */ + private $qa_scorecards; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ContactCenterInsights\V1\QaScorecard>|\Google\Protobuf\Internal\RepeatedField $qa_scorecards + * The QaScorecards under the parent. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * The QaScorecards under the parent. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaScorecard qa_scorecards = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQaScorecards() + { + return $this->qa_scorecards; + } + + /** + * The QaScorecards under the parent. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaScorecard qa_scorecards = 1; + * @param array<\Google\Cloud\ContactCenterInsights\V1\QaScorecard>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQaScorecards($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\QaScorecard::class); + $this->qa_scorecards = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/QaAnswer.php b/ContactCenterInsights/src/V1/QaAnswer.php new file mode 100644 index 000000000000..5c63506b940d --- /dev/null +++ b/ContactCenterInsights/src/V1/QaAnswer.php @@ -0,0 +1,255 @@ +google.cloud.contactcenterinsights.v1.QaAnswer + */ +class QaAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The QaQuestion answered by this answer. + * + * Generated from protobuf field string qa_question = 7 [(.google.api.resource_reference) = { + */ + protected $qa_question = ''; + /** + * The conversation the answer applies to. + * + * Generated from protobuf field string conversation = 2 [(.google.api.resource_reference) = { + */ + protected $conversation = ''; + /** + * Question text. E.g., "Did the agent greet the customer?" + * + * Generated from protobuf field string question_body = 6; + */ + protected $question_body = ''; + /** + * The main answer value, incorporating any manual edits if they exist. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaAnswer.AnswerValue answer_value = 3; + */ + protected $answer_value = null; + /** + * User-defined list of arbitrary tags. Matches the value from + * QaScorecard.ScorecardQuestion.tags. Used for grouping/organization and + * for weighting the score of each answer. + * + * Generated from protobuf field repeated string tags = 5; + */ + private $tags; + /** + * List of all individual answers given to the question. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaAnswer.AnswerSource answer_sources = 8; + */ + private $answer_sources; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $qa_question + * The QaQuestion answered by this answer. + * @type string $conversation + * The conversation the answer applies to. + * @type string $question_body + * Question text. E.g., "Did the agent greet the customer?" + * @type \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerValue $answer_value + * The main answer value, incorporating any manual edits if they exist. + * @type array|\Google\Protobuf\Internal\RepeatedField $tags + * User-defined list of arbitrary tags. Matches the value from + * QaScorecard.ScorecardQuestion.tags. Used for grouping/organization and + * for weighting the score of each answer. + * @type array<\Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerSource>|\Google\Protobuf\Internal\RepeatedField $answer_sources + * List of all individual answers given to the question. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The QaQuestion answered by this answer. + * + * Generated from protobuf field string qa_question = 7 [(.google.api.resource_reference) = { + * @return string + */ + public function getQaQuestion() + { + return $this->qa_question; + } + + /** + * The QaQuestion answered by this answer. + * + * Generated from protobuf field string qa_question = 7 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setQaQuestion($var) + { + GPBUtil::checkString($var, True); + $this->qa_question = $var; + + return $this; + } + + /** + * The conversation the answer applies to. + * + * Generated from protobuf field string conversation = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getConversation() + { + return $this->conversation; + } + + /** + * The conversation the answer applies to. + * + * Generated from protobuf field string conversation = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkString($var, True); + $this->conversation = $var; + + return $this; + } + + /** + * Question text. E.g., "Did the agent greet the customer?" + * + * Generated from protobuf field string question_body = 6; + * @return string + */ + public function getQuestionBody() + { + return $this->question_body; + } + + /** + * Question text. E.g., "Did the agent greet the customer?" + * + * Generated from protobuf field string question_body = 6; + * @param string $var + * @return $this + */ + public function setQuestionBody($var) + { + GPBUtil::checkString($var, True); + $this->question_body = $var; + + return $this; + } + + /** + * The main answer value, incorporating any manual edits if they exist. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaAnswer.AnswerValue answer_value = 3; + * @return \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerValue|null + */ + public function getAnswerValue() + { + return $this->answer_value; + } + + public function hasAnswerValue() + { + return isset($this->answer_value); + } + + public function clearAnswerValue() + { + unset($this->answer_value); + } + + /** + * The main answer value, incorporating any manual edits if they exist. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaAnswer.AnswerValue answer_value = 3; + * @param \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerValue $var + * @return $this + */ + public function setAnswerValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerValue::class); + $this->answer_value = $var; + + return $this; + } + + /** + * User-defined list of arbitrary tags. Matches the value from + * QaScorecard.ScorecardQuestion.tags. Used for grouping/organization and + * for weighting the score of each answer. + * + * Generated from protobuf field repeated string tags = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * User-defined list of arbitrary tags. Matches the value from + * QaScorecard.ScorecardQuestion.tags. Used for grouping/organization and + * for weighting the score of each answer. + * + * Generated from protobuf field repeated string tags = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + + /** + * List of all individual answers given to the question. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaAnswer.AnswerSource answer_sources = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnswerSources() + { + return $this->answer_sources; + } + + /** + * List of all individual answers given to the question. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaAnswer.AnswerSource answer_sources = 8; + * @param array<\Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerSource>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnswerSources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerSource::class); + $this->answer_sources = $arr; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/QaAnswer/AnswerSource.php b/ContactCenterInsights/src/V1/QaAnswer/AnswerSource.php new file mode 100644 index 000000000000..7429babb83cf --- /dev/null +++ b/ContactCenterInsights/src/V1/QaAnswer/AnswerSource.php @@ -0,0 +1,114 @@ +google.cloud.contactcenterinsights.v1.QaAnswer.AnswerSource + */ +class AnswerSource extends \Google\Protobuf\Internal\Message +{ + /** + * What created the answer. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaAnswer.AnswerSource.SourceType source_type = 1; + */ + protected $source_type = 0; + /** + * The answer value from this source. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaAnswer.AnswerValue answer_value = 2; + */ + protected $answer_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $source_type + * What created the answer. + * @type \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerValue $answer_value + * The answer value from this source. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * What created the answer. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaAnswer.AnswerSource.SourceType source_type = 1; + * @return int + */ + public function getSourceType() + { + return $this->source_type; + } + + /** + * What created the answer. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaAnswer.AnswerSource.SourceType source_type = 1; + * @param int $var + * @return $this + */ + public function setSourceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerSource\SourceType::class); + $this->source_type = $var; + + return $this; + } + + /** + * The answer value from this source. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaAnswer.AnswerValue answer_value = 2; + * @return \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerValue|null + */ + public function getAnswerValue() + { + return $this->answer_value; + } + + public function hasAnswerValue() + { + return isset($this->answer_value); + } + + public function clearAnswerValue() + { + unset($this->answer_value); + } + + /** + * The answer value from this source. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaAnswer.AnswerValue answer_value = 2; + * @param \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerValue $var + * @return $this + */ + public function setAnswerValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerValue::class); + $this->answer_value = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/QaAnswer/AnswerSource/SourceType.php b/ContactCenterInsights/src/V1/QaAnswer/AnswerSource/SourceType.php new file mode 100644 index 000000000000..2e8c035efb29 --- /dev/null +++ b/ContactCenterInsights/src/V1/QaAnswer/AnswerSource/SourceType.php @@ -0,0 +1,62 @@ +google.cloud.contactcenterinsights.v1.QaAnswer.AnswerSource.SourceType + */ +class SourceType +{ + /** + * Source type is unspecified. + * + * Generated from protobuf enum SOURCE_TYPE_UNSPECIFIED = 0; + */ + const SOURCE_TYPE_UNSPECIFIED = 0; + /** + * Answer was system-generated; created during an Insights analysis. + * + * Generated from protobuf enum SYSTEM_GENERATED = 1; + */ + const SYSTEM_GENERATED = 1; + /** + * Answer was created by a human via manual edit. + * + * Generated from protobuf enum MANUAL_EDIT = 2; + */ + const MANUAL_EDIT = 2; + + private static $valueToName = [ + self::SOURCE_TYPE_UNSPECIFIED => 'SOURCE_TYPE_UNSPECIFIED', + self::SYSTEM_GENERATED => 'SYSTEM_GENERATED', + self::MANUAL_EDIT => 'MANUAL_EDIT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ContactCenterInsights/src/V1/QaAnswer/AnswerValue.php b/ContactCenterInsights/src/V1/QaAnswer/AnswerValue.php new file mode 100644 index 000000000000..ce9291af6f75 --- /dev/null +++ b/ContactCenterInsights/src/V1/QaAnswer/AnswerValue.php @@ -0,0 +1,352 @@ +google.cloud.contactcenterinsights.v1.QaAnswer.AnswerValue + */ +class AnswerValue extends \Google\Protobuf\Internal\Message +{ + /** + * A short string used as an identifier. Matches the value used in + * QaQuestion.AnswerChoice.key. + * + * Generated from protobuf field string key = 1; + */ + protected $key = ''; + /** + * Output only. Numerical score of the answer. + * + * Generated from protobuf field optional double score = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $score = null; + /** + * Output only. The maximum potential score of the question. + * + * Generated from protobuf field optional double potential_score = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $potential_score = null; + /** + * Output only. Normalized score of the questions. Calculated as score / + * potential_score. + * + * Generated from protobuf field optional double normalized_score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $normalized_score = null; + protected $value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $str_value + * String value. + * @type float $num_value + * Numerical value. + * @type bool $bool_value + * Boolean value. + * @type bool $na_value + * A value of "Not Applicable (N/A)". Should only ever be `true`. + * @type string $key + * A short string used as an identifier. Matches the value used in + * QaQuestion.AnswerChoice.key. + * @type float $score + * Output only. Numerical score of the answer. + * @type float $potential_score + * Output only. The maximum potential score of the question. + * @type float $normalized_score + * Output only. Normalized score of the questions. Calculated as score / + * potential_score. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * String value. + * + * Generated from protobuf field string str_value = 2; + * @return string + */ + public function getStrValue() + { + return $this->readOneof(2); + } + + public function hasStrValue() + { + return $this->hasOneof(2); + } + + /** + * String value. + * + * Generated from protobuf field string str_value = 2; + * @param string $var + * @return $this + */ + public function setStrValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Numerical value. + * + * Generated from protobuf field double num_value = 3; + * @return float + */ + public function getNumValue() + { + return $this->readOneof(3); + } + + public function hasNumValue() + { + return $this->hasOneof(3); + } + + /** + * Numerical value. + * + * Generated from protobuf field double num_value = 3; + * @param float $var + * @return $this + */ + public function setNumValue($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Boolean value. + * + * Generated from protobuf field bool bool_value = 4; + * @return bool + */ + public function getBoolValue() + { + return $this->readOneof(4); + } + + public function hasBoolValue() + { + return $this->hasOneof(4); + } + + /** + * Boolean value. + * + * Generated from protobuf field bool bool_value = 4; + * @param bool $var + * @return $this + */ + public function setBoolValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * A value of "Not Applicable (N/A)". Should only ever be `true`. + * + * Generated from protobuf field bool na_value = 5; + * @return bool + */ + public function getNaValue() + { + return $this->readOneof(5); + } + + public function hasNaValue() + { + return $this->hasOneof(5); + } + + /** + * A value of "Not Applicable (N/A)". Should only ever be `true`. + * + * Generated from protobuf field bool na_value = 5; + * @param bool $var + * @return $this + */ + public function setNaValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * A short string used as an identifier. Matches the value used in + * QaQuestion.AnswerChoice.key. + * + * Generated from protobuf field string key = 1; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * A short string used as an identifier. Matches the value used in + * QaQuestion.AnswerChoice.key. + * + * Generated from protobuf field string key = 1; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Output only. Numerical score of the answer. + * + * Generated from protobuf field optional double score = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getScore() + { + return isset($this->score) ? $this->score : 0.0; + } + + public function hasScore() + { + return isset($this->score); + } + + public function clearScore() + { + unset($this->score); + } + + /** + * Output only. Numerical score of the answer. + * + * Generated from protobuf field optional double score = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setScore($var) + { + GPBUtil::checkDouble($var); + $this->score = $var; + + return $this; + } + + /** + * Output only. The maximum potential score of the question. + * + * Generated from protobuf field optional double potential_score = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getPotentialScore() + { + return isset($this->potential_score) ? $this->potential_score : 0.0; + } + + public function hasPotentialScore() + { + return isset($this->potential_score); + } + + public function clearPotentialScore() + { + unset($this->potential_score); + } + + /** + * Output only. The maximum potential score of the question. + * + * Generated from protobuf field optional double potential_score = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setPotentialScore($var) + { + GPBUtil::checkDouble($var); + $this->potential_score = $var; + + return $this; + } + + /** + * Output only. Normalized score of the questions. Calculated as score / + * potential_score. + * + * Generated from protobuf field optional double normalized_score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getNormalizedScore() + { + return isset($this->normalized_score) ? $this->normalized_score : 0.0; + } + + public function hasNormalizedScore() + { + return isset($this->normalized_score); + } + + public function clearNormalizedScore() + { + unset($this->normalized_score); + } + + /** + * Output only. Normalized score of the questions. Calculated as score / + * potential_score. + * + * Generated from protobuf field optional double normalized_score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setNormalizedScore($var) + { + GPBUtil::checkDouble($var); + $this->normalized_score = $var; + + return $this; + } + + /** + * @return string + */ + public function getValue() + { + return $this->whichOneof("value"); + } + +} + + diff --git a/ContactCenterInsights/src/V1/QaQuestion.php b/ContactCenterInsights/src/V1/QaQuestion.php new file mode 100644 index 000000000000..5bad7f28f6b3 --- /dev/null +++ b/ContactCenterInsights/src/V1/QaQuestion.php @@ -0,0 +1,483 @@ +google.cloud.contactcenterinsights.v1.QaQuestion + */ +class QaQuestion extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the question. + * Format: + * projects/{project}/locations/{location}/qaScorecards/{qa_scorecard}/revisions/{revision}/qaQuestions/{qa_question} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Short, descriptive string, used in the UI where it's not practical + * to display the full question body. E.g., "Greeting". + * + * Generated from protobuf field string abbreviation = 2; + */ + protected $abbreviation = ''; + /** + * Output only. The time at which this question was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The most recent time at which the question was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Question text. E.g., "Did the agent greet the customer?" + * + * Generated from protobuf field string question_body = 5; + */ + protected $question_body = ''; + /** + * Instructions describing how to determine the answer. + * + * Generated from protobuf field string answer_instructions = 9; + */ + protected $answer_instructions = ''; + /** + * A list of valid answers to the question, which the LLM must choose from. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaQuestion.AnswerChoice answer_choices = 6; + */ + private $answer_choices; + /** + * User-defined list of arbitrary tags for the question. Used for + * grouping/organization and for weighting the score of each question. + * + * Generated from protobuf field repeated string tags = 7; + */ + private $tags; + /** + * Defines the order of the question within its parent scorecard revision. + * + * Generated from protobuf field int32 order = 8; + */ + protected $order = 0; + /** + * Metrics of the underlying tuned LLM over a holdout/test set while fine + * tuning the underlying LLM for the given question. This field will only be + * populated if and only if the question is part of a scorecard revision that + * has been tuned. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaQuestion.Metrics metrics = 10; + */ + protected $metrics = null; + /** + * Metadata about the tuning operation for the question.This field will only + * be populated if and only if the question is part of a scorecard revision + * that has been tuned. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaQuestion.TuningMetadata tuning_metadata = 11; + */ + protected $tuning_metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the question. + * Format: + * projects/{project}/locations/{location}/qaScorecards/{qa_scorecard}/revisions/{revision}/qaQuestions/{qa_question} + * @type string $abbreviation + * Short, descriptive string, used in the UI where it's not practical + * to display the full question body. E.g., "Greeting". + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time at which this question was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The most recent time at which the question was updated. + * @type string $question_body + * Question text. E.g., "Did the agent greet the customer?" + * @type string $answer_instructions + * Instructions describing how to determine the answer. + * @type array<\Google\Cloud\ContactCenterInsights\V1\QaQuestion\AnswerChoice>|\Google\Protobuf\Internal\RepeatedField $answer_choices + * A list of valid answers to the question, which the LLM must choose from. + * @type array|\Google\Protobuf\Internal\RepeatedField $tags + * User-defined list of arbitrary tags for the question. Used for + * grouping/organization and for weighting the score of each question. + * @type int $order + * Defines the order of the question within its parent scorecard revision. + * @type \Google\Cloud\ContactCenterInsights\V1\QaQuestion\Metrics $metrics + * Metrics of the underlying tuned LLM over a holdout/test set while fine + * tuning the underlying LLM for the given question. This field will only be + * populated if and only if the question is part of a scorecard revision that + * has been tuned. + * @type \Google\Cloud\ContactCenterInsights\V1\QaQuestion\TuningMetadata $tuning_metadata + * Metadata about the tuning operation for the question.This field will only + * be populated if and only if the question is part of a scorecard revision + * that has been tuned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the question. + * Format: + * projects/{project}/locations/{location}/qaScorecards/{qa_scorecard}/revisions/{revision}/qaQuestions/{qa_question} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the question. + * Format: + * projects/{project}/locations/{location}/qaScorecards/{qa_scorecard}/revisions/{revision}/qaQuestions/{qa_question} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Short, descriptive string, used in the UI where it's not practical + * to display the full question body. E.g., "Greeting". + * + * Generated from protobuf field string abbreviation = 2; + * @return string + */ + public function getAbbreviation() + { + return $this->abbreviation; + } + + /** + * Short, descriptive string, used in the UI where it's not practical + * to display the full question body. E.g., "Greeting". + * + * Generated from protobuf field string abbreviation = 2; + * @param string $var + * @return $this + */ + public function setAbbreviation($var) + { + GPBUtil::checkString($var, True); + $this->abbreviation = $var; + + return $this; + } + + /** + * Output only. The time at which this question was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time at which this question was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The most recent time at which the question was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The most recent time at which the question was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Question text. E.g., "Did the agent greet the customer?" + * + * Generated from protobuf field string question_body = 5; + * @return string + */ + public function getQuestionBody() + { + return $this->question_body; + } + + /** + * Question text. E.g., "Did the agent greet the customer?" + * + * Generated from protobuf field string question_body = 5; + * @param string $var + * @return $this + */ + public function setQuestionBody($var) + { + GPBUtil::checkString($var, True); + $this->question_body = $var; + + return $this; + } + + /** + * Instructions describing how to determine the answer. + * + * Generated from protobuf field string answer_instructions = 9; + * @return string + */ + public function getAnswerInstructions() + { + return $this->answer_instructions; + } + + /** + * Instructions describing how to determine the answer. + * + * Generated from protobuf field string answer_instructions = 9; + * @param string $var + * @return $this + */ + public function setAnswerInstructions($var) + { + GPBUtil::checkString($var, True); + $this->answer_instructions = $var; + + return $this; + } + + /** + * A list of valid answers to the question, which the LLM must choose from. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaQuestion.AnswerChoice answer_choices = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnswerChoices() + { + return $this->answer_choices; + } + + /** + * A list of valid answers to the question, which the LLM must choose from. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaQuestion.AnswerChoice answer_choices = 6; + * @param array<\Google\Cloud\ContactCenterInsights\V1\QaQuestion\AnswerChoice>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnswerChoices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\QaQuestion\AnswerChoice::class); + $this->answer_choices = $arr; + + return $this; + } + + /** + * User-defined list of arbitrary tags for the question. Used for + * grouping/organization and for weighting the score of each question. + * + * Generated from protobuf field repeated string tags = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * User-defined list of arbitrary tags for the question. Used for + * grouping/organization and for weighting the score of each question. + * + * Generated from protobuf field repeated string tags = 7; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + + /** + * Defines the order of the question within its parent scorecard revision. + * + * Generated from protobuf field int32 order = 8; + * @return int + */ + public function getOrder() + { + return $this->order; + } + + /** + * Defines the order of the question within its parent scorecard revision. + * + * Generated from protobuf field int32 order = 8; + * @param int $var + * @return $this + */ + public function setOrder($var) + { + GPBUtil::checkInt32($var); + $this->order = $var; + + return $this; + } + + /** + * Metrics of the underlying tuned LLM over a holdout/test set while fine + * tuning the underlying LLM for the given question. This field will only be + * populated if and only if the question is part of a scorecard revision that + * has been tuned. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaQuestion.Metrics metrics = 10; + * @return \Google\Cloud\ContactCenterInsights\V1\QaQuestion\Metrics|null + */ + public function getMetrics() + { + return $this->metrics; + } + + public function hasMetrics() + { + return isset($this->metrics); + } + + public function clearMetrics() + { + unset($this->metrics); + } + + /** + * Metrics of the underlying tuned LLM over a holdout/test set while fine + * tuning the underlying LLM for the given question. This field will only be + * populated if and only if the question is part of a scorecard revision that + * has been tuned. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaQuestion.Metrics metrics = 10; + * @param \Google\Cloud\ContactCenterInsights\V1\QaQuestion\Metrics $var + * @return $this + */ + public function setMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\QaQuestion\Metrics::class); + $this->metrics = $var; + + return $this; + } + + /** + * Metadata about the tuning operation for the question.This field will only + * be populated if and only if the question is part of a scorecard revision + * that has been tuned. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaQuestion.TuningMetadata tuning_metadata = 11; + * @return \Google\Cloud\ContactCenterInsights\V1\QaQuestion\TuningMetadata|null + */ + public function getTuningMetadata() + { + return $this->tuning_metadata; + } + + public function hasTuningMetadata() + { + return isset($this->tuning_metadata); + } + + public function clearTuningMetadata() + { + unset($this->tuning_metadata); + } + + /** + * Metadata about the tuning operation for the question.This field will only + * be populated if and only if the question is part of a scorecard revision + * that has been tuned. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaQuestion.TuningMetadata tuning_metadata = 11; + * @param \Google\Cloud\ContactCenterInsights\V1\QaQuestion\TuningMetadata $var + * @return $this + */ + public function setTuningMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\QaQuestion\TuningMetadata::class); + $this->tuning_metadata = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/QaQuestion/AnswerChoice.php b/ContactCenterInsights/src/V1/QaQuestion/AnswerChoice.php new file mode 100644 index 000000000000..e9387731086e --- /dev/null +++ b/ContactCenterInsights/src/V1/QaQuestion/AnswerChoice.php @@ -0,0 +1,263 @@ +google.cloud.contactcenterinsights.v1.QaQuestion.AnswerChoice + */ +class AnswerChoice extends \Google\Protobuf\Internal\Message +{ + /** + * A short string used as an identifier. + * + * Generated from protobuf field string key = 1; + */ + protected $key = ''; + /** + * Numerical score of the answer, used for generating the overall score of + * a QaScorecardResult. If the answer uses na_value, this field is unused. + * + * Generated from protobuf field optional double score = 6; + */ + protected $score = null; + protected $value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $str_value + * String value. + * @type float $num_value + * Numerical value. + * @type bool $bool_value + * Boolean value. + * @type bool $na_value + * A value of "Not Applicable (N/A)". If provided, this field may only + * be set to `true`. If a question receives this answer, it will be + * excluded from any score calculations. + * @type string $key + * A short string used as an identifier. + * @type float $score + * Numerical score of the answer, used for generating the overall score of + * a QaScorecardResult. If the answer uses na_value, this field is unused. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * String value. + * + * Generated from protobuf field string str_value = 2; + * @return string + */ + public function getStrValue() + { + return $this->readOneof(2); + } + + public function hasStrValue() + { + return $this->hasOneof(2); + } + + /** + * String value. + * + * Generated from protobuf field string str_value = 2; + * @param string $var + * @return $this + */ + public function setStrValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Numerical value. + * + * Generated from protobuf field double num_value = 3; + * @return float + */ + public function getNumValue() + { + return $this->readOneof(3); + } + + public function hasNumValue() + { + return $this->hasOneof(3); + } + + /** + * Numerical value. + * + * Generated from protobuf field double num_value = 3; + * @param float $var + * @return $this + */ + public function setNumValue($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Boolean value. + * + * Generated from protobuf field bool bool_value = 4; + * @return bool + */ + public function getBoolValue() + { + return $this->readOneof(4); + } + + public function hasBoolValue() + { + return $this->hasOneof(4); + } + + /** + * Boolean value. + * + * Generated from protobuf field bool bool_value = 4; + * @param bool $var + * @return $this + */ + public function setBoolValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * A value of "Not Applicable (N/A)". If provided, this field may only + * be set to `true`. If a question receives this answer, it will be + * excluded from any score calculations. + * + * Generated from protobuf field bool na_value = 5; + * @return bool + */ + public function getNaValue() + { + return $this->readOneof(5); + } + + public function hasNaValue() + { + return $this->hasOneof(5); + } + + /** + * A value of "Not Applicable (N/A)". If provided, this field may only + * be set to `true`. If a question receives this answer, it will be + * excluded from any score calculations. + * + * Generated from protobuf field bool na_value = 5; + * @param bool $var + * @return $this + */ + public function setNaValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * A short string used as an identifier. + * + * Generated from protobuf field string key = 1; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * A short string used as an identifier. + * + * Generated from protobuf field string key = 1; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Numerical score of the answer, used for generating the overall score of + * a QaScorecardResult. If the answer uses na_value, this field is unused. + * + * Generated from protobuf field optional double score = 6; + * @return float + */ + public function getScore() + { + return isset($this->score) ? $this->score : 0.0; + } + + public function hasScore() + { + return isset($this->score); + } + + public function clearScore() + { + unset($this->score); + } + + /** + * Numerical score of the answer, used for generating the overall score of + * a QaScorecardResult. If the answer uses na_value, this field is unused. + * + * Generated from protobuf field optional double score = 6; + * @param float $var + * @return $this + */ + public function setScore($var) + { + GPBUtil::checkDouble($var); + $this->score = $var; + + return $this; + } + + /** + * @return string + */ + public function getValue() + { + return $this->whichOneof("value"); + } + +} + + diff --git a/ContactCenterInsights/src/V1/QaQuestion/Metrics.php b/ContactCenterInsights/src/V1/QaQuestion/Metrics.php new file mode 100644 index 000000000000..e22fb529e8ff --- /dev/null +++ b/ContactCenterInsights/src/V1/QaQuestion/Metrics.php @@ -0,0 +1,73 @@ +google.cloud.contactcenterinsights.v1.QaQuestion.Metrics + */ +class Metrics extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Accuracy of the model. Measures the percentage of correct + * answers the model gave on the test set. + * + * Generated from protobuf field double accuracy = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $accuracy = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $accuracy + * Output only. Accuracy of the model. Measures the percentage of correct + * answers the model gave on the test set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Accuracy of the model. Measures the percentage of correct + * answers the model gave on the test set. + * + * Generated from protobuf field double accuracy = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getAccuracy() + { + return $this->accuracy; + } + + /** + * Output only. Accuracy of the model. Measures the percentage of correct + * answers the model gave on the test set. + * + * Generated from protobuf field double accuracy = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setAccuracy($var) + { + GPBUtil::checkDouble($var); + $this->accuracy = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/QaQuestion/TuningMetadata.php b/ContactCenterInsights/src/V1/QaQuestion/TuningMetadata.php new file mode 100644 index 000000000000..d7ca38b4a5d0 --- /dev/null +++ b/ContactCenterInsights/src/V1/QaQuestion/TuningMetadata.php @@ -0,0 +1,149 @@ +google.cloud.contactcenterinsights.v1.QaQuestion.TuningMetadata + */ +class TuningMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Total number of valid labels provided for the question at the time of + * tuining. + * + * Generated from protobuf field int64 total_valid_label_count = 1; + */ + protected $total_valid_label_count = 0; + /** + * A list of any applicable data validation warnings about the question's + * feedback labels. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.DatasetValidationWarning dataset_validation_warnings = 2; + */ + private $dataset_validation_warnings; + /** + * Error status of the tuning operation for the question. Will only be set + * if the tuning operation failed. + * + * Generated from protobuf field string tuning_error = 3; + */ + protected $tuning_error = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $total_valid_label_count + * Total number of valid labels provided for the question at the time of + * tuining. + * @type array|\Google\Protobuf\Internal\RepeatedField $dataset_validation_warnings + * A list of any applicable data validation warnings about the question's + * feedback labels. + * @type string $tuning_error + * Error status of the tuning operation for the question. Will only be set + * if the tuning operation failed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Total number of valid labels provided for the question at the time of + * tuining. + * + * Generated from protobuf field int64 total_valid_label_count = 1; + * @return int|string + */ + public function getTotalValidLabelCount() + { + return $this->total_valid_label_count; + } + + /** + * Total number of valid labels provided for the question at the time of + * tuining. + * + * Generated from protobuf field int64 total_valid_label_count = 1; + * @param int|string $var + * @return $this + */ + public function setTotalValidLabelCount($var) + { + GPBUtil::checkInt64($var); + $this->total_valid_label_count = $var; + + return $this; + } + + /** + * A list of any applicable data validation warnings about the question's + * feedback labels. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.DatasetValidationWarning dataset_validation_warnings = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDatasetValidationWarnings() + { + return $this->dataset_validation_warnings; + } + + /** + * A list of any applicable data validation warnings about the question's + * feedback labels. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.DatasetValidationWarning dataset_validation_warnings = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDatasetValidationWarnings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\ContactCenterInsights\V1\DatasetValidationWarning::class); + $this->dataset_validation_warnings = $arr; + + return $this; + } + + /** + * Error status of the tuning operation for the question. Will only be set + * if the tuning operation failed. + * + * Generated from protobuf field string tuning_error = 3; + * @return string + */ + public function getTuningError() + { + return $this->tuning_error; + } + + /** + * Error status of the tuning operation for the question. Will only be set + * if the tuning operation failed. + * + * Generated from protobuf field string tuning_error = 3; + * @param string $var + * @return $this + */ + public function setTuningError($var) + { + GPBUtil::checkString($var, True); + $this->tuning_error = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/QaScorecard.php b/ContactCenterInsights/src/V1/QaScorecard.php new file mode 100644 index 000000000000..7a80c6edb141 --- /dev/null +++ b/ContactCenterInsights/src/V1/QaScorecard.php @@ -0,0 +1,232 @@ +google.cloud.contactcenterinsights.v1.QaScorecard + */ +class QaScorecard extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The scorecard name. + * Format: + * projects/{project}/locations/{location}/qaScorecards/{qa_scorecard} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * The user-specified display name of the scorecard. + * + * Generated from protobuf field string display_name = 7; + */ + protected $display_name = ''; + /** + * A text description explaining the intent of the scorecard. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * Output only. The time at which this scorecard was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The most recent time at which the scorecard was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The scorecard name. + * Format: + * projects/{project}/locations/{location}/qaScorecards/{qa_scorecard} + * @type string $display_name + * The user-specified display name of the scorecard. + * @type string $description + * A text description explaining the intent of the scorecard. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time at which this scorecard was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The most recent time at which the scorecard was updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The scorecard name. + * Format: + * projects/{project}/locations/{location}/qaScorecards/{qa_scorecard} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The scorecard name. + * Format: + * projects/{project}/locations/{location}/qaScorecards/{qa_scorecard} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The user-specified display name of the scorecard. + * + * Generated from protobuf field string display_name = 7; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The user-specified display name of the scorecard. + * + * Generated from protobuf field string display_name = 7; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * A text description explaining the intent of the scorecard. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * A text description explaining the intent of the scorecard. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The time at which this scorecard was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time at which this scorecard was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The most recent time at which the scorecard was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The most recent time at which the scorecard was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/QaScorecardResult.php b/ContactCenterInsights/src/V1/QaScorecardResult.php new file mode 100644 index 000000000000..82da408ddbc2 --- /dev/null +++ b/ContactCenterInsights/src/V1/QaScorecardResult.php @@ -0,0 +1,468 @@ +google.cloud.contactcenterinsights.v1.QaScorecardResult + */ +class QaScorecardResult extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The name of the scorecard result. + * Format: + * projects/{project}/locations/{location}/qaScorecardResults/{qa_scorecard_result} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * The QaScorecardRevision scored by this result. + * + * Generated from protobuf field string qa_scorecard_revision = 2 [(.google.api.resource_reference) = { + */ + protected $qa_scorecard_revision = ''; + /** + * The conversation scored by this result. + * + * Generated from protobuf field string conversation = 3 [(.google.api.resource_reference) = { + */ + protected $conversation = ''; + /** + * Output only. The timestamp that the revision was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * ID of the agent that handled the conversation. + * + * Generated from protobuf field string agent_id = 5; + */ + protected $agent_id = ''; + /** + * Set of QaAnswers represented in the result. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaAnswer qa_answers = 6; + */ + private $qa_answers; + /** + * The overall numerical score of the result, incorporating any manual edits + * if they exist. + * + * Generated from protobuf field optional double score = 7; + */ + protected $score = null; + /** + * The maximum potential overall score of the scorecard. Any questions + * answered using `na_value` are excluded from this calculation. + * + * Generated from protobuf field optional double potential_score = 8; + */ + protected $potential_score = null; + /** + * The normalized score, which is the score divided by the potential score. + * Any manual edits are included if they exist. + * + * Generated from protobuf field optional double normalized_score = 9; + */ + protected $normalized_score = null; + /** + * Collection of tags and their scores. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaScorecardResult.QaTagResult qa_tag_results = 10; + */ + private $qa_tag_results; + /** + * List of all individual score sets. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaScorecardResult.ScoreSource score_sources = 11; + */ + private $score_sources; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The name of the scorecard result. + * Format: + * projects/{project}/locations/{location}/qaScorecardResults/{qa_scorecard_result} + * @type string $qa_scorecard_revision + * The QaScorecardRevision scored by this result. + * @type string $conversation + * The conversation scored by this result. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp that the revision was created. + * @type string $agent_id + * ID of the agent that handled the conversation. + * @type array<\Google\Cloud\ContactCenterInsights\V1\QaAnswer>|\Google\Protobuf\Internal\RepeatedField $qa_answers + * Set of QaAnswers represented in the result. + * @type float $score + * The overall numerical score of the result, incorporating any manual edits + * if they exist. + * @type float $potential_score + * The maximum potential overall score of the scorecard. Any questions + * answered using `na_value` are excluded from this calculation. + * @type float $normalized_score + * The normalized score, which is the score divided by the potential score. + * Any manual edits are included if they exist. + * @type array<\Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\QaTagResult>|\Google\Protobuf\Internal\RepeatedField $qa_tag_results + * Collection of tags and their scores. + * @type array<\Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\ScoreSource>|\Google\Protobuf\Internal\RepeatedField $score_sources + * List of all individual score sets. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The name of the scorecard result. + * Format: + * projects/{project}/locations/{location}/qaScorecardResults/{qa_scorecard_result} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The name of the scorecard result. + * Format: + * projects/{project}/locations/{location}/qaScorecardResults/{qa_scorecard_result} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The QaScorecardRevision scored by this result. + * + * Generated from protobuf field string qa_scorecard_revision = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getQaScorecardRevision() + { + return $this->qa_scorecard_revision; + } + + /** + * The QaScorecardRevision scored by this result. + * + * Generated from protobuf field string qa_scorecard_revision = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setQaScorecardRevision($var) + { + GPBUtil::checkString($var, True); + $this->qa_scorecard_revision = $var; + + return $this; + } + + /** + * The conversation scored by this result. + * + * Generated from protobuf field string conversation = 3 [(.google.api.resource_reference) = { + * @return string + */ + public function getConversation() + { + return $this->conversation; + } + + /** + * The conversation scored by this result. + * + * Generated from protobuf field string conversation = 3 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkString($var, True); + $this->conversation = $var; + + return $this; + } + + /** + * Output only. The timestamp that the revision was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp that the revision was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * ID of the agent that handled the conversation. + * + * Generated from protobuf field string agent_id = 5; + * @return string + */ + public function getAgentId() + { + return $this->agent_id; + } + + /** + * ID of the agent that handled the conversation. + * + * Generated from protobuf field string agent_id = 5; + * @param string $var + * @return $this + */ + public function setAgentId($var) + { + GPBUtil::checkString($var, True); + $this->agent_id = $var; + + return $this; + } + + /** + * Set of QaAnswers represented in the result. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaAnswer qa_answers = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQaAnswers() + { + return $this->qa_answers; + } + + /** + * Set of QaAnswers represented in the result. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaAnswer qa_answers = 6; + * @param array<\Google\Cloud\ContactCenterInsights\V1\QaAnswer>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQaAnswers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\QaAnswer::class); + $this->qa_answers = $arr; + + return $this; + } + + /** + * The overall numerical score of the result, incorporating any manual edits + * if they exist. + * + * Generated from protobuf field optional double score = 7; + * @return float + */ + public function getScore() + { + return isset($this->score) ? $this->score : 0.0; + } + + public function hasScore() + { + return isset($this->score); + } + + public function clearScore() + { + unset($this->score); + } + + /** + * The overall numerical score of the result, incorporating any manual edits + * if they exist. + * + * Generated from protobuf field optional double score = 7; + * @param float $var + * @return $this + */ + public function setScore($var) + { + GPBUtil::checkDouble($var); + $this->score = $var; + + return $this; + } + + /** + * The maximum potential overall score of the scorecard. Any questions + * answered using `na_value` are excluded from this calculation. + * + * Generated from protobuf field optional double potential_score = 8; + * @return float + */ + public function getPotentialScore() + { + return isset($this->potential_score) ? $this->potential_score : 0.0; + } + + public function hasPotentialScore() + { + return isset($this->potential_score); + } + + public function clearPotentialScore() + { + unset($this->potential_score); + } + + /** + * The maximum potential overall score of the scorecard. Any questions + * answered using `na_value` are excluded from this calculation. + * + * Generated from protobuf field optional double potential_score = 8; + * @param float $var + * @return $this + */ + public function setPotentialScore($var) + { + GPBUtil::checkDouble($var); + $this->potential_score = $var; + + return $this; + } + + /** + * The normalized score, which is the score divided by the potential score. + * Any manual edits are included if they exist. + * + * Generated from protobuf field optional double normalized_score = 9; + * @return float + */ + public function getNormalizedScore() + { + return isset($this->normalized_score) ? $this->normalized_score : 0.0; + } + + public function hasNormalizedScore() + { + return isset($this->normalized_score); + } + + public function clearNormalizedScore() + { + unset($this->normalized_score); + } + + /** + * The normalized score, which is the score divided by the potential score. + * Any manual edits are included if they exist. + * + * Generated from protobuf field optional double normalized_score = 9; + * @param float $var + * @return $this + */ + public function setNormalizedScore($var) + { + GPBUtil::checkDouble($var); + $this->normalized_score = $var; + + return $this; + } + + /** + * Collection of tags and their scores. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaScorecardResult.QaTagResult qa_tag_results = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQaTagResults() + { + return $this->qa_tag_results; + } + + /** + * Collection of tags and their scores. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaScorecardResult.QaTagResult qa_tag_results = 10; + * @param array<\Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\QaTagResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQaTagResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\QaTagResult::class); + $this->qa_tag_results = $arr; + + return $this; + } + + /** + * List of all individual score sets. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaScorecardResult.ScoreSource score_sources = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScoreSources() + { + return $this->score_sources; + } + + /** + * List of all individual score sets. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaScorecardResult.ScoreSource score_sources = 11; + * @param array<\Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\ScoreSource>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScoreSources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\ScoreSource::class); + $this->score_sources = $arr; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/QaScorecardResult/QaTagResult.php b/ContactCenterInsights/src/V1/QaScorecardResult/QaTagResult.php new file mode 100644 index 000000000000..06b9adedf4a6 --- /dev/null +++ b/ContactCenterInsights/src/V1/QaScorecardResult/QaTagResult.php @@ -0,0 +1,200 @@ +google.cloud.contactcenterinsights.v1.QaScorecardResult.QaTagResult + */ +class QaTagResult extends \Google\Protobuf\Internal\Message +{ + /** + * The tag the score applies to. + * + * Generated from protobuf field string tag = 1; + */ + protected $tag = ''; + /** + * The score the tag applies to. + * + * Generated from protobuf field optional double score = 2; + */ + protected $score = null; + /** + * The potential score the tag applies to. + * + * Generated from protobuf field optional double potential_score = 3; + */ + protected $potential_score = null; + /** + * The normalized score the tag applies to. + * + * Generated from protobuf field optional double normalized_score = 4; + */ + protected $normalized_score = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $tag + * The tag the score applies to. + * @type float $score + * The score the tag applies to. + * @type float $potential_score + * The potential score the tag applies to. + * @type float $normalized_score + * The normalized score the tag applies to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The tag the score applies to. + * + * Generated from protobuf field string tag = 1; + * @return string + */ + public function getTag() + { + return $this->tag; + } + + /** + * The tag the score applies to. + * + * Generated from protobuf field string tag = 1; + * @param string $var + * @return $this + */ + public function setTag($var) + { + GPBUtil::checkString($var, True); + $this->tag = $var; + + return $this; + } + + /** + * The score the tag applies to. + * + * Generated from protobuf field optional double score = 2; + * @return float + */ + public function getScore() + { + return isset($this->score) ? $this->score : 0.0; + } + + public function hasScore() + { + return isset($this->score); + } + + public function clearScore() + { + unset($this->score); + } + + /** + * The score the tag applies to. + * + * Generated from protobuf field optional double score = 2; + * @param float $var + * @return $this + */ + public function setScore($var) + { + GPBUtil::checkDouble($var); + $this->score = $var; + + return $this; + } + + /** + * The potential score the tag applies to. + * + * Generated from protobuf field optional double potential_score = 3; + * @return float + */ + public function getPotentialScore() + { + return isset($this->potential_score) ? $this->potential_score : 0.0; + } + + public function hasPotentialScore() + { + return isset($this->potential_score); + } + + public function clearPotentialScore() + { + unset($this->potential_score); + } + + /** + * The potential score the tag applies to. + * + * Generated from protobuf field optional double potential_score = 3; + * @param float $var + * @return $this + */ + public function setPotentialScore($var) + { + GPBUtil::checkDouble($var); + $this->potential_score = $var; + + return $this; + } + + /** + * The normalized score the tag applies to. + * + * Generated from protobuf field optional double normalized_score = 4; + * @return float + */ + public function getNormalizedScore() + { + return isset($this->normalized_score) ? $this->normalized_score : 0.0; + } + + public function hasNormalizedScore() + { + return isset($this->normalized_score); + } + + public function clearNormalizedScore() + { + unset($this->normalized_score); + } + + /** + * The normalized score the tag applies to. + * + * Generated from protobuf field optional double normalized_score = 4; + * @param float $var + * @return $this + */ + public function setNormalizedScore($var) + { + GPBUtil::checkDouble($var); + $this->normalized_score = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/QaScorecardResult/ScoreSource.php b/ContactCenterInsights/src/V1/QaScorecardResult/ScoreSource.php new file mode 100644 index 000000000000..4832c2236ec4 --- /dev/null +++ b/ContactCenterInsights/src/V1/QaScorecardResult/ScoreSource.php @@ -0,0 +1,240 @@ +google.cloud.contactcenterinsights.v1.QaScorecardResult.ScoreSource + */ +class ScoreSource extends \Google\Protobuf\Internal\Message +{ + /** + * What created the score. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaScorecardResult.ScoreSource.SourceType source_type = 1; + */ + protected $source_type = 0; + /** + * The overall numerical score of the result. + * + * Generated from protobuf field optional double score = 2; + */ + protected $score = null; + /** + * The maximum potential overall score of the scorecard. Any questions + * answered using `na_value` are excluded from this calculation. + * + * Generated from protobuf field optional double potential_score = 3; + */ + protected $potential_score = null; + /** + * The normalized score, which is the score divided by the potential score. + * + * Generated from protobuf field optional double normalized_score = 4; + */ + protected $normalized_score = null; + /** + * Collection of tags and their scores. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaScorecardResult.QaTagResult qa_tag_results = 5; + */ + private $qa_tag_results; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $source_type + * What created the score. + * @type float $score + * The overall numerical score of the result. + * @type float $potential_score + * The maximum potential overall score of the scorecard. Any questions + * answered using `na_value` are excluded from this calculation. + * @type float $normalized_score + * The normalized score, which is the score divided by the potential score. + * @type array<\Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\QaTagResult>|\Google\Protobuf\Internal\RepeatedField $qa_tag_results + * Collection of tags and their scores. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * What created the score. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaScorecardResult.ScoreSource.SourceType source_type = 1; + * @return int + */ + public function getSourceType() + { + return $this->source_type; + } + + /** + * What created the score. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaScorecardResult.ScoreSource.SourceType source_type = 1; + * @param int $var + * @return $this + */ + public function setSourceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\ScoreSource\SourceType::class); + $this->source_type = $var; + + return $this; + } + + /** + * The overall numerical score of the result. + * + * Generated from protobuf field optional double score = 2; + * @return float + */ + public function getScore() + { + return isset($this->score) ? $this->score : 0.0; + } + + public function hasScore() + { + return isset($this->score); + } + + public function clearScore() + { + unset($this->score); + } + + /** + * The overall numerical score of the result. + * + * Generated from protobuf field optional double score = 2; + * @param float $var + * @return $this + */ + public function setScore($var) + { + GPBUtil::checkDouble($var); + $this->score = $var; + + return $this; + } + + /** + * The maximum potential overall score of the scorecard. Any questions + * answered using `na_value` are excluded from this calculation. + * + * Generated from protobuf field optional double potential_score = 3; + * @return float + */ + public function getPotentialScore() + { + return isset($this->potential_score) ? $this->potential_score : 0.0; + } + + public function hasPotentialScore() + { + return isset($this->potential_score); + } + + public function clearPotentialScore() + { + unset($this->potential_score); + } + + /** + * The maximum potential overall score of the scorecard. Any questions + * answered using `na_value` are excluded from this calculation. + * + * Generated from protobuf field optional double potential_score = 3; + * @param float $var + * @return $this + */ + public function setPotentialScore($var) + { + GPBUtil::checkDouble($var); + $this->potential_score = $var; + + return $this; + } + + /** + * The normalized score, which is the score divided by the potential score. + * + * Generated from protobuf field optional double normalized_score = 4; + * @return float + */ + public function getNormalizedScore() + { + return isset($this->normalized_score) ? $this->normalized_score : 0.0; + } + + public function hasNormalizedScore() + { + return isset($this->normalized_score); + } + + public function clearNormalizedScore() + { + unset($this->normalized_score); + } + + /** + * The normalized score, which is the score divided by the potential score. + * + * Generated from protobuf field optional double normalized_score = 4; + * @param float $var + * @return $this + */ + public function setNormalizedScore($var) + { + GPBUtil::checkDouble($var); + $this->normalized_score = $var; + + return $this; + } + + /** + * Collection of tags and their scores. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaScorecardResult.QaTagResult qa_tag_results = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQaTagResults() + { + return $this->qa_tag_results; + } + + /** + * Collection of tags and their scores. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QaScorecardResult.QaTagResult qa_tag_results = 5; + * @param array<\Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\QaTagResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQaTagResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\QaTagResult::class); + $this->qa_tag_results = $arr; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/QaScorecardResult/ScoreSource/SourceType.php b/ContactCenterInsights/src/V1/QaScorecardResult/ScoreSource/SourceType.php new file mode 100644 index 000000000000..176dbcda8b9c --- /dev/null +++ b/ContactCenterInsights/src/V1/QaScorecardResult/ScoreSource/SourceType.php @@ -0,0 +1,63 @@ +google.cloud.contactcenterinsights.v1.QaScorecardResult.ScoreSource.SourceType + */ +class SourceType +{ + /** + * Source type is unspecified. + * + * Generated from protobuf enum SOURCE_TYPE_UNSPECIFIED = 0; + */ + const SOURCE_TYPE_UNSPECIFIED = 0; + /** + * Score is derived only from system-generated answers. + * + * Generated from protobuf enum SYSTEM_GENERATED_ONLY = 1; + */ + const SYSTEM_GENERATED_ONLY = 1; + /** + * Score is derived from both system-generated answers, and includes + * any manual edits if they exist. + * + * Generated from protobuf enum INCLUDES_MANUAL_EDITS = 2; + */ + const INCLUDES_MANUAL_EDITS = 2; + + private static $valueToName = [ + self::SOURCE_TYPE_UNSPECIFIED => 'SOURCE_TYPE_UNSPECIFIED', + self::SYSTEM_GENERATED_ONLY => 'SYSTEM_GENERATED_ONLY', + self::INCLUDES_MANUAL_EDITS => 'INCLUDES_MANUAL_EDITS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ContactCenterInsights/src/V1/QaScorecardRevision.php b/ContactCenterInsights/src/V1/QaScorecardRevision.php new file mode 100644 index 000000000000..61fe6a876d3e --- /dev/null +++ b/ContactCenterInsights/src/V1/QaScorecardRevision.php @@ -0,0 +1,243 @@ +google.cloud.contactcenterinsights.v1.QaScorecardRevision + */ +class QaScorecardRevision extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The name of the scorecard revision. + * Format: + * projects/{project}/locations/{location}/qaScorecards/{qa_scorecard}/revisions/{revision} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * The snapshot of the scorecard at the time of this revision's creation. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaScorecard snapshot = 2; + */ + protected $snapshot = null; + /** + * Output only. The timestamp that the revision was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Alternative IDs for this revision of the scorecard, e.g., + * `latest`. + * + * Generated from protobuf field repeated string alternate_ids = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $alternate_ids; + /** + * Output only. State of the scorecard revision, indicating whether it's ready + * to be used in analysis. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaScorecardRevision.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The name of the scorecard revision. + * Format: + * projects/{project}/locations/{location}/qaScorecards/{qa_scorecard}/revisions/{revision} + * @type \Google\Cloud\ContactCenterInsights\V1\QaScorecard $snapshot + * The snapshot of the scorecard at the time of this revision's creation. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp that the revision was created. + * @type array|\Google\Protobuf\Internal\RepeatedField $alternate_ids + * Output only. Alternative IDs for this revision of the scorecard, e.g., + * `latest`. + * @type int $state + * Output only. State of the scorecard revision, indicating whether it's ready + * to be used in analysis. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The name of the scorecard revision. + * Format: + * projects/{project}/locations/{location}/qaScorecards/{qa_scorecard}/revisions/{revision} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The name of the scorecard revision. + * Format: + * projects/{project}/locations/{location}/qaScorecards/{qa_scorecard}/revisions/{revision} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The snapshot of the scorecard at the time of this revision's creation. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaScorecard snapshot = 2; + * @return \Google\Cloud\ContactCenterInsights\V1\QaScorecard|null + */ + public function getSnapshot() + { + return $this->snapshot; + } + + public function hasSnapshot() + { + return isset($this->snapshot); + } + + public function clearSnapshot() + { + unset($this->snapshot); + } + + /** + * The snapshot of the scorecard at the time of this revision's creation. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaScorecard snapshot = 2; + * @param \Google\Cloud\ContactCenterInsights\V1\QaScorecard $var + * @return $this + */ + public function setSnapshot($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\QaScorecard::class); + $this->snapshot = $var; + + return $this; + } + + /** + * Output only. The timestamp that the revision was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp that the revision was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Alternative IDs for this revision of the scorecard, e.g., + * `latest`. + * + * Generated from protobuf field repeated string alternate_ids = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAlternateIds() + { + return $this->alternate_ids; + } + + /** + * Output only. Alternative IDs for this revision of the scorecard, e.g., + * `latest`. + * + * Generated from protobuf field repeated string alternate_ids = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAlternateIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->alternate_ids = $arr; + + return $this; + } + + /** + * Output only. State of the scorecard revision, indicating whether it's ready + * to be used in analysis. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaScorecardRevision.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the scorecard revision, indicating whether it's ready + * to be used in analysis. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaScorecardRevision.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ContactCenterInsights\V1\QaScorecardRevision\State::class); + $this->state = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/QaScorecardRevision/State.php b/ContactCenterInsights/src/V1/QaScorecardRevision/State.php new file mode 100644 index 000000000000..7c5b92684ca5 --- /dev/null +++ b/ContactCenterInsights/src/V1/QaScorecardRevision/State.php @@ -0,0 +1,90 @@ +google.cloud.contactcenterinsights.v1.QaScorecardRevision.State + */ +class State +{ + /** + * Unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The scorecard revision can be edited. + * + * Generated from protobuf enum EDITABLE = 12; + */ + const EDITABLE = 12; + /** + * Scorecard model training is in progress. + * + * Generated from protobuf enum TRAINING = 2; + */ + const TRAINING = 2; + /** + * Scorecard revision model training failed. + * + * Generated from protobuf enum TRAINING_FAILED = 9; + */ + const TRAINING_FAILED = 9; + /** + * The revision can be used in analysis. + * + * Generated from protobuf enum READY = 11; + */ + const READY = 11; + /** + * Scorecard is being deleted. + * + * Generated from protobuf enum DELETING = 7; + */ + const DELETING = 7; + /** + * Scorecard model training was explicitly cancelled by the user. + * + * Generated from protobuf enum TRAINING_CANCELLED = 14; + */ + const TRAINING_CANCELLED = 14; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::EDITABLE => 'EDITABLE', + self::TRAINING => 'TRAINING', + self::TRAINING_FAILED => 'TRAINING_FAILED', + self::READY => 'READY', + self::DELETING => 'DELETING', + self::TRAINING_CANCELLED => 'TRAINING_CANCELLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ContactCenterInsights/src/V1/QueryMetricsMetadata.php b/ContactCenterInsights/src/V1/QueryMetricsMetadata.php new file mode 100644 index 000000000000..45229d4d6ef3 --- /dev/null +++ b/ContactCenterInsights/src/V1/QueryMetricsMetadata.php @@ -0,0 +1,33 @@ +google.cloud.contactcenterinsights.v1.QueryMetricsMetadata + */ +class QueryMetricsMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + +} + diff --git a/ContactCenterInsights/src/V1/QueryMetricsRequest.php b/ContactCenterInsights/src/V1/QueryMetricsRequest.php new file mode 100644 index 000000000000..07948915505c --- /dev/null +++ b/ContactCenterInsights/src/V1/QueryMetricsRequest.php @@ -0,0 +1,265 @@ +google.cloud.contactcenterinsights.v1.QueryMetricsRequest + */ +class QueryMetricsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location of the data. + * "projects/{project}/locations/{location}" + * + * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $location = ''; + /** + * Required. Filter to select a subset of conversations to compute the + * metrics. Must specify a window of the conversation create time to compute + * the metrics. The returned metrics will be from the range [DATE(starting + * create time), DATE(ending create time)). + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filter = ''; + /** + * The time granularity of each data point in the time series. + * Defaults to NONE if this field is unspecified. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QueryMetricsRequest.TimeGranularity time_granularity = 3; + */ + protected $time_granularity = 0; + /** + * The dimensions that determine the grouping key for the query. Defaults to + * no dimension if this field is unspecified. If a dimension is specified, + * its key must also be specified. Each dimension's key must be unique. + * If a time granularity is also specified, metric values in the dimension + * will be bucketed by this granularity. + * Up to one dimension is supported for now. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.Dimension dimensions = 4; + */ + private $dimensions; + /** + * Measures to return. Defaults to all measures if this field is unspecified. + * A valid mask should traverse from the `measure` field from the response. + * For example, a path from a measure mask to get the conversation count is + * "conversation_measure.count". + * + * Generated from protobuf field .google.protobuf.FieldMask measure_mask = 5; + */ + protected $measure_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $location + * Required. The location of the data. + * "projects/{project}/locations/{location}" + * @type string $filter + * Required. Filter to select a subset of conversations to compute the + * metrics. Must specify a window of the conversation create time to compute + * the metrics. The returned metrics will be from the range [DATE(starting + * create time), DATE(ending create time)). + * @type int $time_granularity + * The time granularity of each data point in the time series. + * Defaults to NONE if this field is unspecified. + * @type array<\Google\Cloud\ContactCenterInsights\V1\Dimension>|\Google\Protobuf\Internal\RepeatedField $dimensions + * The dimensions that determine the grouping key for the query. Defaults to + * no dimension if this field is unspecified. If a dimension is specified, + * its key must also be specified. Each dimension's key must be unique. + * If a time granularity is also specified, metric values in the dimension + * will be bucketed by this granularity. + * Up to one dimension is supported for now. + * @type \Google\Protobuf\FieldMask $measure_mask + * Measures to return. Defaults to all measures if this field is unspecified. + * A valid mask should traverse from the `measure` field from the response. + * For example, a path from a measure mask to get the conversation count is + * "conversation_measure.count". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location of the data. + * "projects/{project}/locations/{location}" + * + * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Required. The location of the data. + * "projects/{project}/locations/{location}" + * + * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * Required. Filter to select a subset of conversations to compute the + * metrics. Must specify a window of the conversation create time to compute + * the metrics. The returned metrics will be from the range [DATE(starting + * create time), DATE(ending create time)). + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Required. Filter to select a subset of conversations to compute the + * metrics. Must specify a window of the conversation create time to compute + * the metrics. The returned metrics will be from the range [DATE(starting + * create time), DATE(ending create time)). + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * The time granularity of each data point in the time series. + * Defaults to NONE if this field is unspecified. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QueryMetricsRequest.TimeGranularity time_granularity = 3; + * @return int + */ + public function getTimeGranularity() + { + return $this->time_granularity; + } + + /** + * The time granularity of each data point in the time series. + * Defaults to NONE if this field is unspecified. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QueryMetricsRequest.TimeGranularity time_granularity = 3; + * @param int $var + * @return $this + */ + public function setTimeGranularity($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ContactCenterInsights\V1\QueryMetricsRequest\TimeGranularity::class); + $this->time_granularity = $var; + + return $this; + } + + /** + * The dimensions that determine the grouping key for the query. Defaults to + * no dimension if this field is unspecified. If a dimension is specified, + * its key must also be specified. Each dimension's key must be unique. + * If a time granularity is also specified, metric values in the dimension + * will be bucketed by this granularity. + * Up to one dimension is supported for now. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.Dimension dimensions = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDimensions() + { + return $this->dimensions; + } + + /** + * The dimensions that determine the grouping key for the query. Defaults to + * no dimension if this field is unspecified. If a dimension is specified, + * its key must also be specified. Each dimension's key must be unique. + * If a time granularity is also specified, metric values in the dimension + * will be bucketed by this granularity. + * Up to one dimension is supported for now. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.Dimension dimensions = 4; + * @param array<\Google\Cloud\ContactCenterInsights\V1\Dimension>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDimensions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\Dimension::class); + $this->dimensions = $arr; + + return $this; + } + + /** + * Measures to return. Defaults to all measures if this field is unspecified. + * A valid mask should traverse from the `measure` field from the response. + * For example, a path from a measure mask to get the conversation count is + * "conversation_measure.count". + * + * Generated from protobuf field .google.protobuf.FieldMask measure_mask = 5; + * @return \Google\Protobuf\FieldMask|null + */ + public function getMeasureMask() + { + return $this->measure_mask; + } + + public function hasMeasureMask() + { + return isset($this->measure_mask); + } + + public function clearMeasureMask() + { + unset($this->measure_mask); + } + + /** + * Measures to return. Defaults to all measures if this field is unspecified. + * A valid mask should traverse from the `measure` field from the response. + * For example, a path from a measure mask to get the conversation count is + * "conversation_measure.count". + * + * Generated from protobuf field .google.protobuf.FieldMask measure_mask = 5; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setMeasureMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->measure_mask = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/QueryMetricsRequest/TimeGranularity.php b/ContactCenterInsights/src/V1/QueryMetricsRequest/TimeGranularity.php new file mode 100644 index 000000000000..ff399ac864b6 --- /dev/null +++ b/ContactCenterInsights/src/V1/QueryMetricsRequest/TimeGranularity.php @@ -0,0 +1,98 @@ +google.cloud.contactcenterinsights.v1.QueryMetricsRequest.TimeGranularity + */ +class TimeGranularity +{ + /** + * The time granularity is unspecified and will default to NONE. + * + * Generated from protobuf enum TIME_GRANULARITY_UNSPECIFIED = 0; + */ + const TIME_GRANULARITY_UNSPECIFIED = 0; + /** + * No time granularity. The response won't contain a time series. + * This is the default value if no time granularity is specified. + * + * Generated from protobuf enum NONE = 1; + */ + const NONE = 1; + /** + * Data points in the time series will aggregate at a daily granularity. + * 1 day means [midnight to midnight). + * + * Generated from protobuf enum DAILY = 2; + */ + const DAILY = 2; + /** + * Data points in the time series will aggregate at a daily granularity. + * 1 HOUR means [01:00 to 02:00). + * + * Generated from protobuf enum HOURLY = 3; + */ + const HOURLY = 3; + /** + * Data points in the time series will aggregate at a daily granularity. + * PER_MINUTE means [01:00 to 01:01). + * + * Generated from protobuf enum PER_MINUTE = 4; + */ + const PER_MINUTE = 4; + /** + * Data points in the time series will aggregate at a 1 minute granularity. + * PER_5_MINUTES means [01:00 to 01:05). + * + * Generated from protobuf enum PER_5_MINUTES = 5; + */ + const PER_5_MINUTES = 5; + /** + * Data points in the time series will aggregate at a monthly granularity. + * 1 MONTH means [01st of the month to 1st of the next month). + * + * Generated from protobuf enum MONTHLY = 6; + */ + const MONTHLY = 6; + + private static $valueToName = [ + self::TIME_GRANULARITY_UNSPECIFIED => 'TIME_GRANULARITY_UNSPECIFIED', + self::NONE => 'NONE', + self::DAILY => 'DAILY', + self::HOURLY => 'HOURLY', + self::PER_MINUTE => 'PER_MINUTE', + self::PER_5_MINUTES => 'PER_5_MINUTES', + self::MONTHLY => 'MONTHLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ContactCenterInsights/src/V1/QueryMetricsResponse.php b/ContactCenterInsights/src/V1/QueryMetricsResponse.php new file mode 100644 index 000000000000..8baf5ef1fac7 --- /dev/null +++ b/ContactCenterInsights/src/V1/QueryMetricsResponse.php @@ -0,0 +1,213 @@ +google.cloud.contactcenterinsights.v1.QueryMetricsResponse + */ +class QueryMetricsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location of the data. + * "projects/{project}/locations/{location}" + * + * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $location = ''; + /** + * The metrics last update time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3; + */ + protected $update_time = null; + /** + * A slice contains a total and (if the request specified a time granularity) + * a time series of metric values. Each slice contains a unique combination of + * the cardinality of dimensions from the request. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice slices = 2; + */ + private $slices; + /** + * The macro average slice contains aggregated averages across the selected + * dimension. i.e. if group_by agent is specified this field will contain the + * average across all agents. + * This field is only populated if the request specifies a Dimension. + * + * Generated from protobuf field optional .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice macro_average_slice = 4; + */ + protected $macro_average_slice = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $location + * Required. The location of the data. + * "projects/{project}/locations/{location}" + * @type \Google\Protobuf\Timestamp $update_time + * The metrics last update time. + * @type array<\Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice>|\Google\Protobuf\Internal\RepeatedField $slices + * A slice contains a total and (if the request specified a time granularity) + * a time series of metric values. Each slice contains a unique combination of + * the cardinality of dimensions from the request. + * @type \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice $macro_average_slice + * The macro average slice contains aggregated averages across the selected + * dimension. i.e. if group_by agent is specified this field will contain the + * average across all agents. + * This field is only populated if the request specifies a Dimension. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location of the data. + * "projects/{project}/locations/{location}" + * + * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Required. The location of the data. + * "projects/{project}/locations/{location}" + * + * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * The metrics last update time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * The metrics last update time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * A slice contains a total and (if the request specified a time granularity) + * a time series of metric values. Each slice contains a unique combination of + * the cardinality of dimensions from the request. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice slices = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSlices() + { + return $this->slices; + } + + /** + * A slice contains a total and (if the request specified a time granularity) + * a time series of metric values. Each slice contains a unique combination of + * the cardinality of dimensions from the request. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice slices = 2; + * @param array<\Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSlices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice::class); + $this->slices = $arr; + + return $this; + } + + /** + * The macro average slice contains aggregated averages across the selected + * dimension. i.e. if group_by agent is specified this field will contain the + * average across all agents. + * This field is only populated if the request specifies a Dimension. + * + * Generated from protobuf field optional .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice macro_average_slice = 4; + * @return \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice|null + */ + public function getMacroAverageSlice() + { + return $this->macro_average_slice; + } + + public function hasMacroAverageSlice() + { + return isset($this->macro_average_slice); + } + + public function clearMacroAverageSlice() + { + unset($this->macro_average_slice); + } + + /** + * The macro average slice contains aggregated averages across the selected + * dimension. i.e. if group_by agent is specified this field will contain the + * average across all agents. + * This field is only populated if the request specifies a Dimension. + * + * Generated from protobuf field optional .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice macro_average_slice = 4; + * @param \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice $var + * @return $this + */ + public function setMacroAverageSlice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice::class); + $this->macro_average_slice = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/QueryMetricsResponse/Slice.php b/ContactCenterInsights/src/V1/QueryMetricsResponse/Slice.php new file mode 100644 index 000000000000..5ad3f4e94c32 --- /dev/null +++ b/ContactCenterInsights/src/V1/QueryMetricsResponse/Slice.php @@ -0,0 +1,171 @@ + dimensions=[Issue 1] + * * Slice 2 -> dimensions=[Issue 2] + * + * Generated from protobuf message google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice + */ +class Slice extends \Google\Protobuf\Internal\Message +{ + /** + * A unique combination of dimensions that this slice represents. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.Dimension dimensions = 1; + */ + private $dimensions; + /** + * The total metric value. The interval of this data point is + * [starting create time, ending create time) from the request. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice.DataPoint total = 2; + */ + protected $total = null; + /** + * A time series of metric values. This is only populated if the request + * specifies a time granularity other than NONE. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice.TimeSeries time_series = 3; + */ + protected $time_series = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ContactCenterInsights\V1\Dimension>|\Google\Protobuf\Internal\RepeatedField $dimensions + * A unique combination of dimensions that this slice represents. + * @type \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice\DataPoint $total + * The total metric value. The interval of this data point is + * [starting create time, ending create time) from the request. + * @type \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice\TimeSeries $time_series + * A time series of metric values. This is only populated if the request + * specifies a time granularity other than NONE. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * A unique combination of dimensions that this slice represents. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.Dimension dimensions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDimensions() + { + return $this->dimensions; + } + + /** + * A unique combination of dimensions that this slice represents. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.Dimension dimensions = 1; + * @param array<\Google\Cloud\ContactCenterInsights\V1\Dimension>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDimensions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\Dimension::class); + $this->dimensions = $arr; + + return $this; + } + + /** + * The total metric value. The interval of this data point is + * [starting create time, ending create time) from the request. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice.DataPoint total = 2; + * @return \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice\DataPoint|null + */ + public function getTotal() + { + return $this->total; + } + + public function hasTotal() + { + return isset($this->total); + } + + public function clearTotal() + { + unset($this->total); + } + + /** + * The total metric value. The interval of this data point is + * [starting create time, ending create time) from the request. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice.DataPoint total = 2; + * @param \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice\DataPoint $var + * @return $this + */ + public function setTotal($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice\DataPoint::class); + $this->total = $var; + + return $this; + } + + /** + * A time series of metric values. This is only populated if the request + * specifies a time granularity other than NONE. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice.TimeSeries time_series = 3; + * @return \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice\TimeSeries|null + */ + public function getTimeSeries() + { + return $this->time_series; + } + + public function hasTimeSeries() + { + return isset($this->time_series); + } + + public function clearTimeSeries() + { + unset($this->time_series); + } + + /** + * A time series of metric values. This is only populated if the request + * specifies a time granularity other than NONE. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice.TimeSeries time_series = 3; + * @param \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice\TimeSeries $var + * @return $this + */ + public function setTimeSeries($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice\TimeSeries::class); + $this->time_series = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/QueryMetricsResponse/Slice/DataPoint.php b/ContactCenterInsights/src/V1/QueryMetricsResponse/Slice/DataPoint.php new file mode 100644 index 000000000000..030144394b4d --- /dev/null +++ b/ContactCenterInsights/src/V1/QueryMetricsResponse/Slice/DataPoint.php @@ -0,0 +1,136 @@ +google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice.DataPoint + */ +class DataPoint extends \Google\Protobuf\Internal\Message +{ + /** + * The interval that this data point represents. + * * If this is the total data point, the interval is + * [starting create time, ending create time) from the request. + * * If this a data point from the time series, the interval is + * [time, time + time granularity from the request). + * + * Generated from protobuf field .google.type.Interval interval = 1; + */ + protected $interval = null; + protected $measure; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice\DataPoint\ConversationMeasure $conversation_measure + * The measure related to conversations. + * @type \Google\Type\Interval $interval + * The interval that this data point represents. + * * If this is the total data point, the interval is + * [starting create time, ending create time) from the request. + * * If this a data point from the time series, the interval is + * [time, time + time granularity from the request). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * The measure related to conversations. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice.DataPoint.ConversationMeasure conversation_measure = 2; + * @return \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice\DataPoint\ConversationMeasure|null + */ + public function getConversationMeasure() + { + return $this->readOneof(2); + } + + public function hasConversationMeasure() + { + return $this->hasOneof(2); + } + + /** + * The measure related to conversations. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice.DataPoint.ConversationMeasure conversation_measure = 2; + * @param \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice\DataPoint\ConversationMeasure $var + * @return $this + */ + public function setConversationMeasure($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice\DataPoint\ConversationMeasure::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The interval that this data point represents. + * * If this is the total data point, the interval is + * [starting create time, ending create time) from the request. + * * If this a data point from the time series, the interval is + * [time, time + time granularity from the request). + * + * Generated from protobuf field .google.type.Interval interval = 1; + * @return \Google\Type\Interval|null + */ + public function getInterval() + { + return $this->interval; + } + + public function hasInterval() + { + return isset($this->interval); + } + + public function clearInterval() + { + unset($this->interval); + } + + /** + * The interval that this data point represents. + * * If this is the total data point, the interval is + * [starting create time, ending create time) from the request. + * * If this a data point from the time series, the interval is + * [time, time + time granularity from the request). + * + * Generated from protobuf field .google.type.Interval interval = 1; + * @param \Google\Type\Interval $var + * @return $this + */ + public function setInterval($var) + { + GPBUtil::checkMessage($var, \Google\Type\Interval::class); + $this->interval = $var; + + return $this; + } + + /** + * @return string + */ + public function getMeasure() + { + return $this->whichOneof("measure"); + } + +} + + diff --git a/ContactCenterInsights/src/V1/QueryMetricsResponse/Slice/DataPoint/ConversationMeasure.php b/ContactCenterInsights/src/V1/QueryMetricsResponse/Slice/DataPoint/ConversationMeasure.php new file mode 100644 index 000000000000..423e1b699894 --- /dev/null +++ b/ContactCenterInsights/src/V1/QueryMetricsResponse/Slice/DataPoint/ConversationMeasure.php @@ -0,0 +1,480 @@ +google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice.DataPoint.ConversationMeasure + */ +class ConversationMeasure extends \Google\Protobuf\Internal\Message +{ + /** + * The conversation count. + * + * Generated from protobuf field optional int32 conversation_count = 1; + */ + protected $conversation_count = null; + /** + * The average silence percentage. + * + * Generated from protobuf field optional float average_silence_percentage = 2; + */ + protected $average_silence_percentage = null; + /** + * The average duration. + * + * Generated from protobuf field optional .google.protobuf.Duration average_duration = 3; + */ + protected $average_duration = null; + /** + * The average turn count. + * + * Generated from protobuf field optional float average_turn_count = 4; + */ + protected $average_turn_count = null; + /** + * The average agent's sentiment score. + * + * Generated from protobuf field optional float average_agent_sentiment_score = 5; + */ + protected $average_agent_sentiment_score = null; + /** + * The average client's sentiment score. + * + * Generated from protobuf field optional float average_client_sentiment_score = 6; + */ + protected $average_client_sentiment_score = null; + /** + * The average customer satisfaction rating. + * + * Generated from protobuf field optional double average_customer_satisfaction_rating = 8; + */ + protected $average_customer_satisfaction_rating = null; + /** + * Average QA normalized score. + * Will exclude 0's in average calculation. + * + * Generated from protobuf field optional double average_qa_normalized_score = 7; + */ + protected $average_qa_normalized_score = null; + /** + * Average QA normalized score for all the tags. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice.DataPoint.ConversationMeasure.QaTagScore qa_tag_scores = 9; + */ + private $qa_tag_scores; + /** + * Average QA normalized score averaged for questions averaged across + * all revisions of the parent scorecard. + * Will be only populated if the request specifies a dimension of + * QA_QUESTION_ID. + * + * Generated from protobuf field optional double average_qa_question_normalized_score = 10; + */ + protected $average_qa_question_normalized_score = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $conversation_count + * The conversation count. + * @type float $average_silence_percentage + * The average silence percentage. + * @type \Google\Protobuf\Duration $average_duration + * The average duration. + * @type float $average_turn_count + * The average turn count. + * @type float $average_agent_sentiment_score + * The average agent's sentiment score. + * @type float $average_client_sentiment_score + * The average client's sentiment score. + * @type float $average_customer_satisfaction_rating + * The average customer satisfaction rating. + * @type float $average_qa_normalized_score + * Average QA normalized score. + * Will exclude 0's in average calculation. + * @type array<\Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice\DataPoint\ConversationMeasure\QaTagScore>|\Google\Protobuf\Internal\RepeatedField $qa_tag_scores + * Average QA normalized score for all the tags. + * @type float $average_qa_question_normalized_score + * Average QA normalized score averaged for questions averaged across + * all revisions of the parent scorecard. + * Will be only populated if the request specifies a dimension of + * QA_QUESTION_ID. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * The conversation count. + * + * Generated from protobuf field optional int32 conversation_count = 1; + * @return int + */ + public function getConversationCount() + { + return isset($this->conversation_count) ? $this->conversation_count : 0; + } + + public function hasConversationCount() + { + return isset($this->conversation_count); + } + + public function clearConversationCount() + { + unset($this->conversation_count); + } + + /** + * The conversation count. + * + * Generated from protobuf field optional int32 conversation_count = 1; + * @param int $var + * @return $this + */ + public function setConversationCount($var) + { + GPBUtil::checkInt32($var); + $this->conversation_count = $var; + + return $this; + } + + /** + * The average silence percentage. + * + * Generated from protobuf field optional float average_silence_percentage = 2; + * @return float + */ + public function getAverageSilencePercentage() + { + return isset($this->average_silence_percentage) ? $this->average_silence_percentage : 0.0; + } + + public function hasAverageSilencePercentage() + { + return isset($this->average_silence_percentage); + } + + public function clearAverageSilencePercentage() + { + unset($this->average_silence_percentage); + } + + /** + * The average silence percentage. + * + * Generated from protobuf field optional float average_silence_percentage = 2; + * @param float $var + * @return $this + */ + public function setAverageSilencePercentage($var) + { + GPBUtil::checkFloat($var); + $this->average_silence_percentage = $var; + + return $this; + } + + /** + * The average duration. + * + * Generated from protobuf field optional .google.protobuf.Duration average_duration = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getAverageDuration() + { + return $this->average_duration; + } + + public function hasAverageDuration() + { + return isset($this->average_duration); + } + + public function clearAverageDuration() + { + unset($this->average_duration); + } + + /** + * The average duration. + * + * Generated from protobuf field optional .google.protobuf.Duration average_duration = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setAverageDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->average_duration = $var; + + return $this; + } + + /** + * The average turn count. + * + * Generated from protobuf field optional float average_turn_count = 4; + * @return float + */ + public function getAverageTurnCount() + { + return isset($this->average_turn_count) ? $this->average_turn_count : 0.0; + } + + public function hasAverageTurnCount() + { + return isset($this->average_turn_count); + } + + public function clearAverageTurnCount() + { + unset($this->average_turn_count); + } + + /** + * The average turn count. + * + * Generated from protobuf field optional float average_turn_count = 4; + * @param float $var + * @return $this + */ + public function setAverageTurnCount($var) + { + GPBUtil::checkFloat($var); + $this->average_turn_count = $var; + + return $this; + } + + /** + * The average agent's sentiment score. + * + * Generated from protobuf field optional float average_agent_sentiment_score = 5; + * @return float + */ + public function getAverageAgentSentimentScore() + { + return isset($this->average_agent_sentiment_score) ? $this->average_agent_sentiment_score : 0.0; + } + + public function hasAverageAgentSentimentScore() + { + return isset($this->average_agent_sentiment_score); + } + + public function clearAverageAgentSentimentScore() + { + unset($this->average_agent_sentiment_score); + } + + /** + * The average agent's sentiment score. + * + * Generated from protobuf field optional float average_agent_sentiment_score = 5; + * @param float $var + * @return $this + */ + public function setAverageAgentSentimentScore($var) + { + GPBUtil::checkFloat($var); + $this->average_agent_sentiment_score = $var; + + return $this; + } + + /** + * The average client's sentiment score. + * + * Generated from protobuf field optional float average_client_sentiment_score = 6; + * @return float + */ + public function getAverageClientSentimentScore() + { + return isset($this->average_client_sentiment_score) ? $this->average_client_sentiment_score : 0.0; + } + + public function hasAverageClientSentimentScore() + { + return isset($this->average_client_sentiment_score); + } + + public function clearAverageClientSentimentScore() + { + unset($this->average_client_sentiment_score); + } + + /** + * The average client's sentiment score. + * + * Generated from protobuf field optional float average_client_sentiment_score = 6; + * @param float $var + * @return $this + */ + public function setAverageClientSentimentScore($var) + { + GPBUtil::checkFloat($var); + $this->average_client_sentiment_score = $var; + + return $this; + } + + /** + * The average customer satisfaction rating. + * + * Generated from protobuf field optional double average_customer_satisfaction_rating = 8; + * @return float + */ + public function getAverageCustomerSatisfactionRating() + { + return isset($this->average_customer_satisfaction_rating) ? $this->average_customer_satisfaction_rating : 0.0; + } + + public function hasAverageCustomerSatisfactionRating() + { + return isset($this->average_customer_satisfaction_rating); + } + + public function clearAverageCustomerSatisfactionRating() + { + unset($this->average_customer_satisfaction_rating); + } + + /** + * The average customer satisfaction rating. + * + * Generated from protobuf field optional double average_customer_satisfaction_rating = 8; + * @param float $var + * @return $this + */ + public function setAverageCustomerSatisfactionRating($var) + { + GPBUtil::checkDouble($var); + $this->average_customer_satisfaction_rating = $var; + + return $this; + } + + /** + * Average QA normalized score. + * Will exclude 0's in average calculation. + * + * Generated from protobuf field optional double average_qa_normalized_score = 7; + * @return float + */ + public function getAverageQaNormalizedScore() + { + return isset($this->average_qa_normalized_score) ? $this->average_qa_normalized_score : 0.0; + } + + public function hasAverageQaNormalizedScore() + { + return isset($this->average_qa_normalized_score); + } + + public function clearAverageQaNormalizedScore() + { + unset($this->average_qa_normalized_score); + } + + /** + * Average QA normalized score. + * Will exclude 0's in average calculation. + * + * Generated from protobuf field optional double average_qa_normalized_score = 7; + * @param float $var + * @return $this + */ + public function setAverageQaNormalizedScore($var) + { + GPBUtil::checkDouble($var); + $this->average_qa_normalized_score = $var; + + return $this; + } + + /** + * Average QA normalized score for all the tags. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice.DataPoint.ConversationMeasure.QaTagScore qa_tag_scores = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQaTagScores() + { + return $this->qa_tag_scores; + } + + /** + * Average QA normalized score for all the tags. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice.DataPoint.ConversationMeasure.QaTagScore qa_tag_scores = 9; + * @param array<\Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice\DataPoint\ConversationMeasure\QaTagScore>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQaTagScores($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice\DataPoint\ConversationMeasure\QaTagScore::class); + $this->qa_tag_scores = $arr; + + return $this; + } + + /** + * Average QA normalized score averaged for questions averaged across + * all revisions of the parent scorecard. + * Will be only populated if the request specifies a dimension of + * QA_QUESTION_ID. + * + * Generated from protobuf field optional double average_qa_question_normalized_score = 10; + * @return float + */ + public function getAverageQaQuestionNormalizedScore() + { + return isset($this->average_qa_question_normalized_score) ? $this->average_qa_question_normalized_score : 0.0; + } + + public function hasAverageQaQuestionNormalizedScore() + { + return isset($this->average_qa_question_normalized_score); + } + + public function clearAverageQaQuestionNormalizedScore() + { + unset($this->average_qa_question_normalized_score); + } + + /** + * Average QA normalized score averaged for questions averaged across + * all revisions of the parent scorecard. + * Will be only populated if the request specifies a dimension of + * QA_QUESTION_ID. + * + * Generated from protobuf field optional double average_qa_question_normalized_score = 10; + * @param float $var + * @return $this + */ + public function setAverageQaQuestionNormalizedScore($var) + { + GPBUtil::checkDouble($var); + $this->average_qa_question_normalized_score = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/QueryMetricsResponse/Slice/DataPoint/ConversationMeasure/QaTagScore.php b/ContactCenterInsights/src/V1/QueryMetricsResponse/Slice/DataPoint/ConversationMeasure/QaTagScore.php new file mode 100644 index 000000000000..dc7ad35de0f9 --- /dev/null +++ b/ContactCenterInsights/src/V1/QueryMetricsResponse/Slice/DataPoint/ConversationMeasure/QaTagScore.php @@ -0,0 +1,102 @@ +google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice.DataPoint.ConversationMeasure.QaTagScore + */ +class QaTagScore extends \Google\Protobuf\Internal\Message +{ + /** + * Tag name. + * + * Generated from protobuf field string tag = 1; + */ + protected $tag = ''; + /** + * Average tag normalized score per tag. + * + * Generated from protobuf field double average_tag_normalized_score = 2; + */ + protected $average_tag_normalized_score = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $tag + * Tag name. + * @type float $average_tag_normalized_score + * Average tag normalized score per tag. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Tag name. + * + * Generated from protobuf field string tag = 1; + * @return string + */ + public function getTag() + { + return $this->tag; + } + + /** + * Tag name. + * + * Generated from protobuf field string tag = 1; + * @param string $var + * @return $this + */ + public function setTag($var) + { + GPBUtil::checkString($var, True); + $this->tag = $var; + + return $this; + } + + /** + * Average tag normalized score per tag. + * + * Generated from protobuf field double average_tag_normalized_score = 2; + * @return float + */ + public function getAverageTagNormalizedScore() + { + return $this->average_tag_normalized_score; + } + + /** + * Average tag normalized score per tag. + * + * Generated from protobuf field double average_tag_normalized_score = 2; + * @param float $var + * @return $this + */ + public function setAverageTagNormalizedScore($var) + { + GPBUtil::checkDouble($var); + $this->average_tag_normalized_score = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/QueryMetricsResponse/Slice/TimeSeries.php b/ContactCenterInsights/src/V1/QueryMetricsResponse/Slice/TimeSeries.php new file mode 100644 index 000000000000..4c4f91787af6 --- /dev/null +++ b/ContactCenterInsights/src/V1/QueryMetricsResponse/Slice/TimeSeries.php @@ -0,0 +1,68 @@ +google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice.TimeSeries + */ +class TimeSeries extends \Google\Protobuf\Internal\Message +{ + /** + * The data points that make up the time series . + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice.DataPoint data_points = 4; + */ + private $data_points; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice\DataPoint>|\Google\Protobuf\Internal\RepeatedField $data_points + * The data points that make up the time series . + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * The data points that make up the time series . + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice.DataPoint data_points = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataPoints() + { + return $this->data_points; + } + + /** + * The data points that make up the time series . + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.QueryMetricsResponse.Slice.DataPoint data_points = 4; + * @param array<\Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice\DataPoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse\Slice\DataPoint::class); + $this->data_points = $arr; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/TuneQaScorecardRevisionMetadata.php b/ContactCenterInsights/src/V1/TuneQaScorecardRevisionMetadata.php new file mode 100644 index 000000000000..3e686987788d --- /dev/null +++ b/ContactCenterInsights/src/V1/TuneQaScorecardRevisionMetadata.php @@ -0,0 +1,279 @@ +google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionMetadata + */ +class TuneQaScorecardRevisionMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. The original request. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionRequest request = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $request = null; + /** + * Output only. The results of data validation per question in the request. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionMetadata.QaQuestionDatasetValidationResult qa_question_dataset_validation_results = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $qa_question_dataset_validation_results; + /** + * Output only. The metrics for each QaQuestion in the TuneScorecardRevision + * request. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionMetadata.QaQuestionDatasetTuningMetrics qa_question_dataset_tuning_metrics = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $qa_question_dataset_tuning_metrics; + /** + * Output only. The percentage of the tuning job that has completed. Always + * between 0 and 1 where 0 indicates the job has not started i.e. 0% and 1 + * indicates the job has completed i.e. 100%. + * + * Generated from protobuf field double tuning_completion_ratio = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $tuning_completion_ratio = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type \Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionRequest $request + * Output only. The original request. + * @type array<\Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionMetadata\QaQuestionDatasetValidationResult>|\Google\Protobuf\Internal\RepeatedField $qa_question_dataset_validation_results + * Output only. The results of data validation per question in the request. + * @type array<\Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionMetadata\QaQuestionDatasetTuningMetrics>|\Google\Protobuf\Internal\RepeatedField $qa_question_dataset_tuning_metrics + * Output only. The metrics for each QaQuestion in the TuneScorecardRevision + * request. + * @type float $tuning_completion_ratio + * Output only. The percentage of the tuning job that has completed. Always + * between 0 and 1 where 0 indicates the job has not started i.e. 0% and 1 + * indicates the job has completed i.e. 100%. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. The original request. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionRequest request = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionRequest|null + */ + public function getRequest() + { + return $this->request; + } + + public function hasRequest() + { + return isset($this->request); + } + + public function clearRequest() + { + unset($this->request); + } + + /** + * Output only. The original request. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionRequest request = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionRequest $var + * @return $this + */ + public function setRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionRequest::class); + $this->request = $var; + + return $this; + } + + /** + * Output only. The results of data validation per question in the request. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionMetadata.QaQuestionDatasetValidationResult qa_question_dataset_validation_results = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQaQuestionDatasetValidationResults() + { + return $this->qa_question_dataset_validation_results; + } + + /** + * Output only. The results of data validation per question in the request. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionMetadata.QaQuestionDatasetValidationResult qa_question_dataset_validation_results = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionMetadata\QaQuestionDatasetValidationResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQaQuestionDatasetValidationResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionMetadata\QaQuestionDatasetValidationResult::class); + $this->qa_question_dataset_validation_results = $arr; + + return $this; + } + + /** + * Output only. The metrics for each QaQuestion in the TuneScorecardRevision + * request. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionMetadata.QaQuestionDatasetTuningMetrics qa_question_dataset_tuning_metrics = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQaQuestionDatasetTuningMetrics() + { + return $this->qa_question_dataset_tuning_metrics; + } + + /** + * Output only. The metrics for each QaQuestion in the TuneScorecardRevision + * request. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionMetadata.QaQuestionDatasetTuningMetrics qa_question_dataset_tuning_metrics = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionMetadata\QaQuestionDatasetTuningMetrics>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQaQuestionDatasetTuningMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionMetadata\QaQuestionDatasetTuningMetrics::class); + $this->qa_question_dataset_tuning_metrics = $arr; + + return $this; + } + + /** + * Output only. The percentage of the tuning job that has completed. Always + * between 0 and 1 where 0 indicates the job has not started i.e. 0% and 1 + * indicates the job has completed i.e. 100%. + * + * Generated from protobuf field double tuning_completion_ratio = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getTuningCompletionRatio() + { + return $this->tuning_completion_ratio; + } + + /** + * Output only. The percentage of the tuning job that has completed. Always + * between 0 and 1 where 0 indicates the job has not started i.e. 0% and 1 + * indicates the job has completed i.e. 100%. + * + * Generated from protobuf field double tuning_completion_ratio = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setTuningCompletionRatio($var) + { + GPBUtil::checkDouble($var); + $this->tuning_completion_ratio = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/TuneQaScorecardRevisionMetadata/QaQuestionDatasetTuningMetrics.php b/ContactCenterInsights/src/V1/TuneQaScorecardRevisionMetadata/QaQuestionDatasetTuningMetrics.php new file mode 100644 index 000000000000..67835ea517fa --- /dev/null +++ b/ContactCenterInsights/src/V1/TuneQaScorecardRevisionMetadata/QaQuestionDatasetTuningMetrics.php @@ -0,0 +1,117 @@ +google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionMetadata.QaQuestionDatasetTuningMetrics + */ +class QaQuestionDatasetTuningMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource path of the question whose dataset was + * evaluated for tuning. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $question = ''; + /** + * Output only. The metrics for the question's dataset. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionMetadata.QaQuestionDatasetTuningMetrics.Metrics metrics = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $metrics = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $question + * Output only. The resource path of the question whose dataset was + * evaluated for tuning. + * @type \Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionMetadata\QaQuestionDatasetTuningMetrics\Metrics $metrics + * Output only. The metrics for the question's dataset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource path of the question whose dataset was + * evaluated for tuning. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getQuestion() + { + return $this->question; + } + + /** + * Output only. The resource path of the question whose dataset was + * evaluated for tuning. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setQuestion($var) + { + GPBUtil::checkString($var, True); + $this->question = $var; + + return $this; + } + + /** + * Output only. The metrics for the question's dataset. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionMetadata.QaQuestionDatasetTuningMetrics.Metrics metrics = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionMetadata\QaQuestionDatasetTuningMetrics\Metrics|null + */ + public function getMetrics() + { + return $this->metrics; + } + + public function hasMetrics() + { + return isset($this->metrics); + } + + public function clearMetrics() + { + unset($this->metrics); + } + + /** + * Output only. The metrics for the question's dataset. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionMetadata.QaQuestionDatasetTuningMetrics.Metrics metrics = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionMetadata\QaQuestionDatasetTuningMetrics\Metrics $var + * @return $this + */ + public function setMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionMetadata\QaQuestionDatasetTuningMetrics\Metrics::class); + $this->metrics = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/TuneQaScorecardRevisionMetadata/QaQuestionDatasetTuningMetrics/Metrics.php b/ContactCenterInsights/src/V1/TuneQaScorecardRevisionMetadata/QaQuestionDatasetTuningMetrics/Metrics.php new file mode 100644 index 000000000000..7bd214242899 --- /dev/null +++ b/ContactCenterInsights/src/V1/TuneQaScorecardRevisionMetadata/QaQuestionDatasetTuningMetrics/Metrics.php @@ -0,0 +1,69 @@ +google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionMetadata.QaQuestionDatasetTuningMetrics.Metrics + */ +class Metrics extends \Google\Protobuf\Internal\Message +{ + /** + * Accuracy of the question's dataset. + * + * Generated from protobuf field double accuracy = 1; + */ + protected $accuracy = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $accuracy + * Accuracy of the question's dataset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Accuracy of the question's dataset. + * + * Generated from protobuf field double accuracy = 1; + * @return float + */ + public function getAccuracy() + { + return $this->accuracy; + } + + /** + * Accuracy of the question's dataset. + * + * Generated from protobuf field double accuracy = 1; + * @param float $var + * @return $this + */ + public function setAccuracy($var) + { + GPBUtil::checkDouble($var); + $this->accuracy = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/TuneQaScorecardRevisionMetadata/QaQuestionDatasetValidationResult.php b/ContactCenterInsights/src/V1/TuneQaScorecardRevisionMetadata/QaQuestionDatasetValidationResult.php new file mode 100644 index 000000000000..89c7422be481 --- /dev/null +++ b/ContactCenterInsights/src/V1/TuneQaScorecardRevisionMetadata/QaQuestionDatasetValidationResult.php @@ -0,0 +1,144 @@ +google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionMetadata.QaQuestionDatasetValidationResult + */ +class QaQuestionDatasetValidationResult extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource path of the question whose dataset was + * evaluated for tuning. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $question = ''; + /** + * A list of any applicable data validation warnings about the question's + * feedback labels. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.DatasetValidationWarning dataset_validation_warnings = 2; + */ + private $dataset_validation_warnings; + /** + * The number of valid feedback labels in the question's dataset. + * + * Generated from protobuf field int32 valid_feedback_labels_count = 3; + */ + protected $valid_feedback_labels_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $question + * Output only. The resource path of the question whose dataset was + * evaluated for tuning. + * @type array|\Google\Protobuf\Internal\RepeatedField $dataset_validation_warnings + * A list of any applicable data validation warnings about the question's + * feedback labels. + * @type int $valid_feedback_labels_count + * The number of valid feedback labels in the question's dataset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource path of the question whose dataset was + * evaluated for tuning. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getQuestion() + { + return $this->question; + } + + /** + * Output only. The resource path of the question whose dataset was + * evaluated for tuning. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setQuestion($var) + { + GPBUtil::checkString($var, True); + $this->question = $var; + + return $this; + } + + /** + * A list of any applicable data validation warnings about the question's + * feedback labels. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.DatasetValidationWarning dataset_validation_warnings = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDatasetValidationWarnings() + { + return $this->dataset_validation_warnings; + } + + /** + * A list of any applicable data validation warnings about the question's + * feedback labels. + * + * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.DatasetValidationWarning dataset_validation_warnings = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDatasetValidationWarnings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\ContactCenterInsights\V1\DatasetValidationWarning::class); + $this->dataset_validation_warnings = $arr; + + return $this; + } + + /** + * The number of valid feedback labels in the question's dataset. + * + * Generated from protobuf field int32 valid_feedback_labels_count = 3; + * @return int + */ + public function getValidFeedbackLabelsCount() + { + return $this->valid_feedback_labels_count; + } + + /** + * The number of valid feedback labels in the question's dataset. + * + * Generated from protobuf field int32 valid_feedback_labels_count = 3; + * @param int $var + * @return $this + */ + public function setValidFeedbackLabelsCount($var) + { + GPBUtil::checkInt32($var); + $this->valid_feedback_labels_count = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/TuneQaScorecardRevisionRequest.php b/ContactCenterInsights/src/V1/TuneQaScorecardRevisionRequest.php new file mode 100644 index 000000000000..74d28d6c0c64 --- /dev/null +++ b/ContactCenterInsights/src/V1/TuneQaScorecardRevisionRequest.php @@ -0,0 +1,188 @@ +google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionRequest + */ +class TuneQaScorecardRevisionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource for new fine tuning job instance. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Filter for selecting the feedback labels that needs to be + * used for training. + * This filter can be used to limit the feedback labels used for tuning to a + * feedback labels created or updated for a specific time-window etc. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filter = ''; + /** + * Optional. Run in validate only mode, no fine tuning will actually run. + * Data quality validations like training data distributions will run. + * Even when set to false, the data quality validations will still run but + * once the validations complete we will proceed with the fine tune, if + * applicable. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. The parent resource for new fine tuning job instance. Please see + * {@see ContactCenterInsightsClient::qaScorecardRevisionName()} for help formatting this field. + * @param string $filter Required. Filter for selecting the feedback labels that needs to be + * used for training. + * This filter can be used to limit the feedback labels used for tuning to a + * feedback labels created or updated for a specific time-window etc. + * @param bool $validateOnly Optional. Run in validate only mode, no fine tuning will actually run. + * Data quality validations like training data distributions will run. + * Even when set to false, the data quality validations will still run but + * once the validations complete we will proceed with the fine tune, if + * applicable. + * + * @return \Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionRequest + * + * @experimental + */ + public static function build(string $parent, string $filter, bool $validateOnly): self + { + return (new self()) + ->setParent($parent) + ->setFilter($filter) + ->setValidateOnly($validateOnly); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource for new fine tuning job instance. + * @type string $filter + * Required. Filter for selecting the feedback labels that needs to be + * used for training. + * This filter can be used to limit the feedback labels used for tuning to a + * feedback labels created or updated for a specific time-window etc. + * @type bool $validate_only + * Optional. Run in validate only mode, no fine tuning will actually run. + * Data quality validations like training data distributions will run. + * Even when set to false, the data quality validations will still run but + * once the validations complete we will proceed with the fine tune, if + * applicable. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource for new fine tuning job instance. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource for new fine tuning job instance. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Filter for selecting the feedback labels that needs to be + * used for training. + * This filter can be used to limit the feedback labels used for tuning to a + * feedback labels created or updated for a specific time-window etc. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Required. Filter for selecting the feedback labels that needs to be + * used for training. + * This filter can be used to limit the feedback labels used for tuning to a + * feedback labels created or updated for a specific time-window etc. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Run in validate only mode, no fine tuning will actually run. + * Data quality validations like training data distributions will run. + * Even when set to false, the data quality validations will still run but + * once the validations complete we will proceed with the fine tune, if + * applicable. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Run in validate only mode, no fine tuning will actually run. + * Data quality validations like training data distributions will run. + * Even when set to false, the data quality validations will still run but + * once the validations complete we will proceed with the fine tune, if + * applicable. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/TuneQaScorecardRevisionResponse.php b/ContactCenterInsights/src/V1/TuneQaScorecardRevisionResponse.php new file mode 100644 index 000000000000..67b9f528d50f --- /dev/null +++ b/ContactCenterInsights/src/V1/TuneQaScorecardRevisionResponse.php @@ -0,0 +1,33 @@ +google.cloud.contactcenterinsights.v1.TuneQaScorecardRevisionResponse + */ +class TuneQaScorecardRevisionResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + +} + diff --git a/ContactCenterInsights/src/V1/UndeployQaScorecardRevisionRequest.php b/ContactCenterInsights/src/V1/UndeployQaScorecardRevisionRequest.php new file mode 100644 index 000000000000..dd06aac0d71f --- /dev/null +++ b/ContactCenterInsights/src/V1/UndeployQaScorecardRevisionRequest.php @@ -0,0 +1,67 @@ +google.cloud.contactcenterinsights.v1.UndeployQaScorecardRevisionRequest + */ +class UndeployQaScorecardRevisionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the QaScorecardRevision to undeploy. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the QaScorecardRevision to undeploy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the QaScorecardRevision to undeploy. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the QaScorecardRevision to undeploy. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/UpdateAnalysisRuleRequest.php b/ContactCenterInsights/src/V1/UpdateAnalysisRuleRequest.php new file mode 100644 index 000000000000..92b1b723ce4e --- /dev/null +++ b/ContactCenterInsights/src/V1/UpdateAnalysisRuleRequest.php @@ -0,0 +1,146 @@ +google.cloud.contactcenterinsights.v1.UpdateAnalysisRuleRequest + */ +class UpdateAnalysisRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The new analysis rule. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.AnalysisRule analysis_rule = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $analysis_rule = null; + /** + * Optional. The list of fields to be updated. + * If the update_mask is not provided, the update will be applied to all + * fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\ContactCenterInsights\V1\AnalysisRule $analysisRule Required. The new analysis rule. + * @param \Google\Protobuf\FieldMask $updateMask Optional. The list of fields to be updated. + * If the update_mask is not provided, the update will be applied to all + * fields. + * + * @return \Google\Cloud\ContactCenterInsights\V1\UpdateAnalysisRuleRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ContactCenterInsights\V1\AnalysisRule $analysisRule, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setAnalysisRule($analysisRule) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ContactCenterInsights\V1\AnalysisRule $analysis_rule + * Required. The new analysis rule. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The list of fields to be updated. + * If the update_mask is not provided, the update will be applied to all + * fields. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The new analysis rule. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.AnalysisRule analysis_rule = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ContactCenterInsights\V1\AnalysisRule|null + */ + public function getAnalysisRule() + { + return $this->analysis_rule; + } + + public function hasAnalysisRule() + { + return isset($this->analysis_rule); + } + + public function clearAnalysisRule() + { + unset($this->analysis_rule); + } + + /** + * Required. The new analysis rule. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.AnalysisRule analysis_rule = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ContactCenterInsights\V1\AnalysisRule $var + * @return $this + */ + public function setAnalysisRule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\AnalysisRule::class); + $this->analysis_rule = $var; + + return $this; + } + + /** + * Optional. The list of fields to be updated. + * If the update_mask is not provided, the update will be applied to all + * fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The list of fields to be updated. + * If the update_mask is not provided, the update will be applied to all + * fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/UpdateFeedbackLabelRequest.php b/ContactCenterInsights/src/V1/UpdateFeedbackLabelRequest.php new file mode 100644 index 000000000000..b34648aeea65 --- /dev/null +++ b/ContactCenterInsights/src/V1/UpdateFeedbackLabelRequest.php @@ -0,0 +1,136 @@ +google.cloud.contactcenterinsights.v1.UpdateFeedbackLabelRequest + */ +class UpdateFeedbackLabelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The feedback label to update. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.FeedbackLabel feedback_label = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $feedback_label = null; + /** + * Required. The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\ContactCenterInsights\V1\FeedbackLabel $feedbackLabel Required. The feedback label to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The list of fields to be updated. + * + * @return \Google\Cloud\ContactCenterInsights\V1\UpdateFeedbackLabelRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ContactCenterInsights\V1\FeedbackLabel $feedbackLabel, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setFeedbackLabel($feedbackLabel) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ContactCenterInsights\V1\FeedbackLabel $feedback_label + * Required. The feedback label to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The list of fields to be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The feedback label to update. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.FeedbackLabel feedback_label = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ContactCenterInsights\V1\FeedbackLabel|null + */ + public function getFeedbackLabel() + { + return $this->feedback_label; + } + + public function hasFeedbackLabel() + { + return isset($this->feedback_label); + } + + public function clearFeedbackLabel() + { + unset($this->feedback_label); + } + + /** + * Required. The feedback label to update. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.FeedbackLabel feedback_label = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ContactCenterInsights\V1\FeedbackLabel $var + * @return $this + */ + public function setFeedbackLabel($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\FeedbackLabel::class); + $this->feedback_label = $var; + + return $this; + } + + /** + * Required. The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/UpdateQaQuestionRequest.php b/ContactCenterInsights/src/V1/UpdateQaQuestionRequest.php new file mode 100644 index 000000000000..1638d1eace40 --- /dev/null +++ b/ContactCenterInsights/src/V1/UpdateQaQuestionRequest.php @@ -0,0 +1,177 @@ +google.cloud.contactcenterinsights.v1.UpdateQaQuestionRequest + */ +class UpdateQaQuestionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The QaQuestion to update. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaQuestion qa_question = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $qa_question = null; + /** + * Required. The list of fields to be updated. All possible fields can be + * updated by passing `*`, or a subset of the following updateable fields can + * be provided: + * * `abbreviation` + * * `answer_choices` + * * `answer_instructions` + * * `order` + * * `question_body` + * * `tags` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\ContactCenterInsights\V1\QaQuestion $qaQuestion Required. The QaQuestion to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The list of fields to be updated. All possible fields can be + * updated by passing `*`, or a subset of the following updateable fields can + * be provided: + * + * * `abbreviation` + * * `answer_choices` + * * `answer_instructions` + * * `order` + * * `question_body` + * * `tags` + * + * @return \Google\Cloud\ContactCenterInsights\V1\UpdateQaQuestionRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ContactCenterInsights\V1\QaQuestion $qaQuestion, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setQaQuestion($qaQuestion) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ContactCenterInsights\V1\QaQuestion $qa_question + * Required. The QaQuestion to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The list of fields to be updated. All possible fields can be + * updated by passing `*`, or a subset of the following updateable fields can + * be provided: + * * `abbreviation` + * * `answer_choices` + * * `answer_instructions` + * * `order` + * * `question_body` + * * `tags` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The QaQuestion to update. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaQuestion qa_question = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ContactCenterInsights\V1\QaQuestion|null + */ + public function getQaQuestion() + { + return $this->qa_question; + } + + public function hasQaQuestion() + { + return isset($this->qa_question); + } + + public function clearQaQuestion() + { + unset($this->qa_question); + } + + /** + * Required. The QaQuestion to update. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaQuestion qa_question = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ContactCenterInsights\V1\QaQuestion $var + * @return $this + */ + public function setQaQuestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\QaQuestion::class); + $this->qa_question = $var; + + return $this; + } + + /** + * Required. The list of fields to be updated. All possible fields can be + * updated by passing `*`, or a subset of the following updateable fields can + * be provided: + * * `abbreviation` + * * `answer_choices` + * * `answer_instructions` + * * `order` + * * `question_body` + * * `tags` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The list of fields to be updated. All possible fields can be + * updated by passing `*`, or a subset of the following updateable fields can + * be provided: + * * `abbreviation` + * * `answer_choices` + * * `answer_instructions` + * * `order` + * * `question_body` + * * `tags` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/UpdateQaScorecardRequest.php b/ContactCenterInsights/src/V1/UpdateQaScorecardRequest.php new file mode 100644 index 000000000000..414b1cad6c0b --- /dev/null +++ b/ContactCenterInsights/src/V1/UpdateQaScorecardRequest.php @@ -0,0 +1,157 @@ +google.cloud.contactcenterinsights.v1.UpdateQaScorecardRequest + */ +class UpdateQaScorecardRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The QaScorecard to update. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaScorecard qa_scorecard = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $qa_scorecard = null; + /** + * Required. The list of fields to be updated. All possible fields can be + * updated by passing `*`, or a subset of the following updateable fields can + * be provided: + * * `description` + * * `display_name` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\ContactCenterInsights\V1\QaScorecard $qaScorecard Required. The QaScorecard to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The list of fields to be updated. All possible fields can be + * updated by passing `*`, or a subset of the following updateable fields can + * be provided: + * + * * `description` + * * `display_name` + * + * @return \Google\Cloud\ContactCenterInsights\V1\UpdateQaScorecardRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ContactCenterInsights\V1\QaScorecard $qaScorecard, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setQaScorecard($qaScorecard) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ContactCenterInsights\V1\QaScorecard $qa_scorecard + * Required. The QaScorecard to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The list of fields to be updated. All possible fields can be + * updated by passing `*`, or a subset of the following updateable fields can + * be provided: + * * `description` + * * `display_name` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The QaScorecard to update. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaScorecard qa_scorecard = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ContactCenterInsights\V1\QaScorecard|null + */ + public function getQaScorecard() + { + return $this->qa_scorecard; + } + + public function hasQaScorecard() + { + return isset($this->qa_scorecard); + } + + public function clearQaScorecard() + { + unset($this->qa_scorecard); + } + + /** + * Required. The QaScorecard to update. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.QaScorecard qa_scorecard = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ContactCenterInsights\V1\QaScorecard $var + * @return $this + */ + public function setQaScorecard($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\QaScorecard::class); + $this->qa_scorecard = $var; + + return $this; + } + + /** + * Required. The list of fields to be updated. All possible fields can be + * updated by passing `*`, or a subset of the following updateable fields can + * be provided: + * * `description` + * * `display_name` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The list of fields to be updated. All possible fields can be + * updated by passing `*`, or a subset of the following updateable fields can + * be provided: + * * `description` + * * `display_name` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/gapic_metadata.json b/ContactCenterInsights/src/V1/gapic_metadata.json index a1bab090cfad..3892cf265ef4 100644 --- a/ContactCenterInsights/src/V1/gapic_metadata.json +++ b/ContactCenterInsights/src/V1/gapic_metadata.json @@ -20,6 +20,16 @@ "bulkDeleteConversations" ] }, + "BulkDownloadFeedbackLabels": { + "methods": [ + "bulkDownloadFeedbackLabels" + ] + }, + "BulkUploadFeedbackLabels": { + "methods": [ + "bulkUploadFeedbackLabels" + ] + }, "CalculateIssueModelStats": { "methods": [ "calculateIssueModelStats" @@ -35,11 +45,21 @@ "createAnalysis" ] }, + "CreateAnalysisRule": { + "methods": [ + "createAnalysisRule" + ] + }, "CreateConversation": { "methods": [ "createConversation" ] }, + "CreateFeedbackLabel": { + "methods": [ + "createFeedbackLabel" + ] + }, "CreateIssueModel": { "methods": [ "createIssueModel" @@ -50,6 +70,21 @@ "createPhraseMatcher" ] }, + "CreateQaQuestion": { + "methods": [ + "createQaQuestion" + ] + }, + "CreateQaScorecard": { + "methods": [ + "createQaScorecard" + ] + }, + "CreateQaScorecardRevision": { + "methods": [ + "createQaScorecardRevision" + ] + }, "CreateView": { "methods": [ "createView" @@ -60,11 +95,21 @@ "deleteAnalysis" ] }, + "DeleteAnalysisRule": { + "methods": [ + "deleteAnalysisRule" + ] + }, "DeleteConversation": { "methods": [ "deleteConversation" ] }, + "DeleteFeedbackLabel": { + "methods": [ + "deleteFeedbackLabel" + ] + }, "DeleteIssue": { "methods": [ "deleteIssue" @@ -80,6 +125,21 @@ "deletePhraseMatcher" ] }, + "DeleteQaQuestion": { + "methods": [ + "deleteQaQuestion" + ] + }, + "DeleteQaScorecard": { + "methods": [ + "deleteQaScorecard" + ] + }, + "DeleteQaScorecardRevision": { + "methods": [ + "deleteQaScorecardRevision" + ] + }, "DeleteView": { "methods": [ "deleteView" @@ -90,6 +150,11 @@ "deployIssueModel" ] }, + "DeployQaScorecardRevision": { + "methods": [ + "deployQaScorecardRevision" + ] + }, "ExportInsightsData": { "methods": [ "exportInsightsData" @@ -105,6 +170,11 @@ "getAnalysis" ] }, + "GetAnalysisRule": { + "methods": [ + "getAnalysisRule" + ] + }, "GetConversation": { "methods": [ "getConversation" @@ -115,6 +185,11 @@ "getEncryptionSpec" ] }, + "GetFeedbackLabel": { + "methods": [ + "getFeedbackLabel" + ] + }, "GetIssue": { "methods": [ "getIssue" @@ -130,6 +205,21 @@ "getPhraseMatcher" ] }, + "GetQaQuestion": { + "methods": [ + "getQaQuestion" + ] + }, + "GetQaScorecard": { + "methods": [ + "getQaScorecard" + ] + }, + "GetQaScorecardRevision": { + "methods": [ + "getQaScorecardRevision" + ] + }, "GetSettings": { "methods": [ "getSettings" @@ -155,16 +245,31 @@ "initializeEncryptionSpec" ] }, + "ListAllFeedbackLabels": { + "methods": [ + "listAllFeedbackLabels" + ] + }, "ListAnalyses": { "methods": [ "listAnalyses" ] }, + "ListAnalysisRules": { + "methods": [ + "listAnalysisRules" + ] + }, "ListConversations": { "methods": [ "listConversations" ] }, + "ListFeedbackLabels": { + "methods": [ + "listFeedbackLabels" + ] + }, "ListIssueModels": { "methods": [ "listIssueModels" @@ -180,21 +285,61 @@ "listPhraseMatchers" ] }, + "ListQaQuestions": { + "methods": [ + "listQaQuestions" + ] + }, + "ListQaScorecardRevisions": { + "methods": [ + "listQaScorecardRevisions" + ] + }, + "ListQaScorecards": { + "methods": [ + "listQaScorecards" + ] + }, "ListViews": { "methods": [ "listViews" ] }, + "QueryMetrics": { + "methods": [ + "queryMetrics" + ] + }, + "TuneQaScorecardRevision": { + "methods": [ + "tuneQaScorecardRevision" + ] + }, "UndeployIssueModel": { "methods": [ "undeployIssueModel" ] }, + "UndeployQaScorecardRevision": { + "methods": [ + "undeployQaScorecardRevision" + ] + }, + "UpdateAnalysisRule": { + "methods": [ + "updateAnalysisRule" + ] + }, "UpdateConversation": { "methods": [ "updateConversation" ] }, + "UpdateFeedbackLabel": { + "methods": [ + "updateFeedbackLabel" + ] + }, "UpdateIssue": { "methods": [ "updateIssue" @@ -210,6 +355,16 @@ "updatePhraseMatcher" ] }, + "UpdateQaQuestion": { + "methods": [ + "updateQaQuestion" + ] + }, + "UpdateQaScorecard": { + "methods": [ + "updateQaScorecard" + ] + }, "UpdateSettings": { "methods": [ "updateSettings" diff --git a/ContactCenterInsights/src/V1/resources/contact_center_insights_client_config.json b/ContactCenterInsights/src/V1/resources/contact_center_insights_client_config.json index 4f2e84193db6..4c5586a76072 100644 --- a/ContactCenterInsights/src/V1/resources/contact_center_insights_client_config.json +++ b/ContactCenterInsights/src/V1/resources/contact_center_insights_client_config.json @@ -38,6 +38,16 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "BulkDownloadFeedbackLabels": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BulkUploadFeedbackLabels": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "CalculateIssueModelStats": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -53,11 +63,21 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "CreateAnalysisRule": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "CreateConversation": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "CreateFeedbackLabel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "CreateIssueModel": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -68,6 +88,21 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "CreateQaQuestion": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateQaScorecard": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateQaScorecardRevision": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "CreateView": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -78,11 +113,21 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "DeleteAnalysisRule": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "DeleteConversation": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "DeleteFeedbackLabel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "DeleteIssue": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -98,6 +143,21 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "DeleteQaQuestion": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteQaScorecard": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteQaScorecardRevision": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "DeleteView": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -108,6 +168,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "DeployQaScorecardRevision": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "ExportInsightsData": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -123,6 +188,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "GetAnalysisRule": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "GetConversation": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -133,6 +203,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "GetFeedbackLabel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "GetIssue": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -148,6 +223,21 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "GetQaQuestion": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetQaScorecard": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetQaScorecardRevision": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "GetSettings": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -173,16 +263,31 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ListAllFeedbackLabels": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "ListAnalyses": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ListAnalysisRules": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "ListConversations": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ListFeedbackLabels": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "ListIssueModels": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -198,21 +303,61 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ListQaQuestions": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListQaScorecardRevisions": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListQaScorecards": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "ListViews": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "QueryMetrics": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "TuneQaScorecardRevision": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "UndeployIssueModel": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "UndeployQaScorecardRevision": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateAnalysisRule": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "UpdateConversation": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "UpdateFeedbackLabel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "UpdateIssue": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -228,6 +373,16 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "UpdateQaQuestion": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateQaScorecard": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "UpdateSettings": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", diff --git a/ContactCenterInsights/src/V1/resources/contact_center_insights_descriptor_config.php b/ContactCenterInsights/src/V1/resources/contact_center_insights_descriptor_config.php index b529d00be28f..482951657a19 100644 --- a/ContactCenterInsights/src/V1/resources/contact_center_insights_descriptor_config.php +++ b/ContactCenterInsights/src/V1/resources/contact_center_insights_descriptor_config.php @@ -61,6 +61,44 @@ ], ], ], + 'BulkDownloadFeedbackLabels' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsResponse', + 'metadataReturnType' => '\Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'BulkUploadFeedbackLabels' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsResponse', + 'metadataReturnType' => '\Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'CreateAnalysis' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\ContactCenterInsights\V1\Analysis', @@ -233,6 +271,44 @@ ], ], ], + 'QueryMetrics' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse', + 'metadataReturnType' => '\Google\Cloud\ContactCenterInsights\V1\QueryMetricsMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getLocation', + ], + ], + ], + ], + 'TuneQaScorecardRevision' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionResponse', + 'metadataReturnType' => '\Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'UndeployIssueModel' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\ContactCenterInsights\V1\UndeployIssueModelResponse', @@ -295,6 +371,18 @@ ], ], ], + 'CreateAnalysisRule' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\AnalysisRule', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'CreateConversation' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\Conversation', @@ -307,6 +395,18 @@ ], ], ], + 'CreateFeedbackLabel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\FeedbackLabel', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'CreatePhraseMatcher' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\PhraseMatcher', @@ -319,6 +419,42 @@ ], ], ], + 'CreateQaQuestion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\QaQuestion', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateQaScorecard' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\QaScorecard', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateQaScorecardRevision' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\QaScorecardRevision', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'CreateView' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\View', @@ -343,6 +479,18 @@ ], ], ], + 'DeleteAnalysisRule' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'DeleteConversation' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Protobuf\GPBEmpty', @@ -355,6 +503,18 @@ ], ], ], + 'DeleteFeedbackLabel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'DeleteIssue' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Protobuf\GPBEmpty', @@ -379,6 +539,42 @@ ], ], ], + 'DeleteQaQuestion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteQaScorecard' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteQaScorecardRevision' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'DeleteView' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Protobuf\GPBEmpty', @@ -391,6 +587,18 @@ ], ], ], + 'DeployQaScorecardRevision' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\QaScorecardRevision', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetAnalysis' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\Analysis', @@ -403,6 +611,18 @@ ], ], ], + 'GetAnalysisRule' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\AnalysisRule', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetConversation' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\Conversation', @@ -427,6 +647,18 @@ ], ], ], + 'GetFeedbackLabel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\FeedbackLabel', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetIssue' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\Issue', @@ -463,6 +695,42 @@ ], ], ], + 'GetQaQuestion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\QaQuestion', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetQaScorecard' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\QaScorecard', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetQaScorecardRevision' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\QaScorecardRevision', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetSettings' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\Settings', @@ -487,6 +755,26 @@ ], ], ], + 'ListAllFeedbackLabels' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getFeedbackLabels', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\ListAllFeedbackLabelsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'ListAnalyses' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -507,6 +795,26 @@ ], ], ], + 'ListAnalysisRules' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAnalysisRules', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\ListAnalysisRulesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'ListConversations' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -527,6 +835,26 @@ ], ], ], + 'ListFeedbackLabels' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getFeedbackLabels', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\ListFeedbackLabelsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'ListIssueModels' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\ListIssueModelsResponse', @@ -571,6 +899,66 @@ ], ], ], + 'ListQaQuestions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getQaQuestions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\ListQaQuestionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListQaScorecardRevisions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getQaScorecardRevisions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\ListQaScorecardRevisionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListQaScorecards' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getQaScorecards', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\ListQaScorecardsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'ListViews' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -591,6 +979,31 @@ ], ], ], + 'UndeployQaScorecardRevision' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\QaScorecardRevision', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateAnalysisRule' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\AnalysisRule', + 'headerParams' => [ + [ + 'keyName' => 'analysis_rule.name', + 'fieldAccessors' => [ + 'getAnalysisRule', + 'getName', + ], + ], + ], + ], 'UpdateConversation' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\Conversation', @@ -604,6 +1017,19 @@ ], ], ], + 'UpdateFeedbackLabel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\FeedbackLabel', + 'headerParams' => [ + [ + 'keyName' => 'feedback_label.name', + 'fieldAccessors' => [ + 'getFeedbackLabel', + 'getName', + ], + ], + ], + ], 'UpdateIssue' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\Issue', @@ -643,6 +1069,32 @@ ], ], ], + 'UpdateQaQuestion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\QaQuestion', + 'headerParams' => [ + [ + 'keyName' => 'qa_question.name', + 'fieldAccessors' => [ + 'getQaQuestion', + 'getName', + ], + ], + ], + ], + 'UpdateQaScorecard' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\QaScorecard', + 'headerParams' => [ + [ + 'keyName' => 'qa_scorecard.name', + 'fieldAccessors' => [ + 'getQaScorecard', + 'getName', + ], + ], + ], + ], 'UpdateSettings' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\Settings', @@ -671,9 +1123,11 @@ ], 'templateMap' => [ 'analysis' => 'projects/{project}/locations/{location}/conversations/{conversation}/analyses/{analysis}', + 'analysisRule' => 'projects/{project}/locations/{location}/analysisRules/{analysis_rule}', 'conversation' => 'projects/{project}/locations/{location}/conversations/{conversation}', 'conversationProfile' => 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}', 'encryptionSpec' => 'projects/{project}/locations/{location}/encryptionSpec', + 'feedbackLabel' => 'projects/{project}/locations/{location}/conversations/{conversation}/feedbackLabels/{feedback_label}', 'issue' => 'projects/{project}/locations/{location}/issueModels/{issue_model}/issues/{issue}', 'issueModel' => 'projects/{project}/locations/{location}/issueModels/{issue_model}', 'location' => 'projects/{project}/locations/{location}', @@ -681,6 +1135,10 @@ 'phraseMatcher' => 'projects/{project}/locations/{location}/phraseMatchers/{phrase_matcher}', 'projectConversationParticipant' => 'projects/{project}/conversations/{conversation}/participants/{participant}', 'projectLocationConversationParticipant' => 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}', + 'qaQuestion' => 'projects/{project}/locations/{location}/qaScorecards/{qa_scorecard}/revisions/{revision}/qaQuestions/{qa_question}', + 'qaScorecard' => 'projects/{project}/locations/{location}/qaScorecards/{qa_scorecard}', + 'qaScorecardResult' => 'projects/{project}/locations/{location}/qaScorecardResults/{qa_scorecard_result}', + 'qaScorecardRevision' => 'projects/{project}/locations/{location}/qaScorecards/{qa_scorecard}/revisions/{revision}', 'recognizer' => 'projects/{project}/locations/{location}/recognizers/{recognizer}', 'settings' => 'projects/{project}/locations/{location}/settings', 'view' => 'projects/{project}/locations/{location}/views/{view}', diff --git a/ContactCenterInsights/src/V1/resources/contact_center_insights_rest_client_config.php b/ContactCenterInsights/src/V1/resources/contact_center_insights_rest_client_config.php index a3735d966ff5..0f0f4be5ef00 100644 --- a/ContactCenterInsights/src/V1/resources/contact_center_insights_rest_client_config.php +++ b/ContactCenterInsights/src/V1/resources/contact_center_insights_rest_client_config.php @@ -47,6 +47,30 @@ ], ], ], + 'BulkDownloadFeedbackLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:bulkDownloadFeedbackLabels', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'BulkUploadFeedbackLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:bulkUploadFeedbackLabels', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'CalculateIssueModelStats' => [ 'method' => 'get', 'uriTemplate' => '/v1/{issue_model=projects/*/locations/*/issueModels/*}:calculateIssueModelStats', @@ -81,6 +105,18 @@ ], ], ], + 'CreateAnalysisRule' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/analysisRules', + 'body' => 'analysis_rule', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'CreateConversation' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/conversations', @@ -93,6 +129,18 @@ ], ], ], + 'CreateFeedbackLabel' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/conversations/*}/feedbackLabels', + 'body' => 'feedback_label', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'CreateIssueModel' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/issueModels', @@ -117,6 +165,42 @@ ], ], ], + 'CreateQaQuestion' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/qaScorecards/*/revisions/*}/qaQuestions', + 'body' => 'qa_question', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateQaScorecard' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/qaScorecards', + 'body' => 'qa_scorecard', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateQaScorecardRevision' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/qaScorecards/*}/revisions', + 'body' => 'qa_scorecard_revision', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'CreateView' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/views', @@ -140,6 +224,17 @@ ], ], ], + 'DeleteAnalysisRule' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/analysisRules/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'DeleteConversation' => [ 'method' => 'delete', 'uriTemplate' => '/v1/{name=projects/*/locations/*/conversations/*}', @@ -151,6 +246,17 @@ ], ], ], + 'DeleteFeedbackLabel' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/conversations/*/feedbackLabels/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'DeleteIssue' => [ 'method' => 'delete', 'uriTemplate' => '/v1/{name=projects/*/locations/*/issueModels/*/issues/*}', @@ -184,6 +290,39 @@ ], ], ], + 'DeleteQaQuestion' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/qaScorecards/*/revisions/*/qaQuestions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteQaScorecard' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/qaScorecards/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteQaScorecardRevision' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/qaScorecards/*/revisions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'DeleteView' => [ 'method' => 'delete', 'uriTemplate' => '/v1/{name=projects/*/locations/*/views/*}', @@ -207,6 +346,18 @@ ], ], ], + 'DeployQaScorecardRevision' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/qaScorecards/*/revisions/*}:deploy', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'ExportInsightsData' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/insightsdata:export', @@ -242,6 +393,17 @@ ], ], ], + 'GetAnalysisRule' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/analysisRules/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetConversation' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/conversations/*}', @@ -264,6 +426,17 @@ ], ], ], + 'GetFeedbackLabel' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/conversations/*/feedbackLabels/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetIssue' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/issueModels/*/issues/*}', @@ -297,6 +470,39 @@ ], ], ], + 'GetQaQuestion' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/qaScorecards/*/revisions/*/qaQuestions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetQaScorecard' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/qaScorecards/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetQaScorecardRevision' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/qaScorecards/*/revisions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetSettings' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/settings}', @@ -356,6 +562,17 @@ ], ], ], + 'ListAllFeedbackLabels' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:listAllFeedbackLabels', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListAnalyses' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*/conversations/*}/analyses', @@ -367,6 +584,17 @@ ], ], ], + 'ListAnalysisRules' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/analysisRules', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListConversations' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/conversations', @@ -378,6 +606,17 @@ ], ], ], + 'ListFeedbackLabels' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/conversations/*}/feedbackLabels', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListIssueModels' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/issueModels', @@ -411,6 +650,39 @@ ], ], ], + 'ListQaQuestions' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/qaScorecards/*/revisions/*}/qaQuestions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListQaScorecardRevisions' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/qaScorecards/*}/revisions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListQaScorecards' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/qaScorecards', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListViews' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/views', @@ -422,6 +694,30 @@ ], ], ], + 'QueryMetrics' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{location=projects/*/locations/*}:queryMetrics', + 'body' => '*', + 'placeholders' => [ + 'location' => [ + 'getters' => [ + 'getLocation', + ], + ], + ], + ], + 'TuneQaScorecardRevision' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/qaScorecards/*/revisions/*}:tuneQaScorecardRevision', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'UndeployIssueModel' => [ 'method' => 'post', 'uriTemplate' => '/v1/{name=projects/*/locations/*/issueModels/*}:undeploy', @@ -434,6 +730,31 @@ ], ], ], + 'UndeployQaScorecardRevision' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/qaScorecards/*/revisions/*}:undeploy', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateAnalysisRule' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{analysis_rule.name=projects/*/locations/*/analysisRules/*}', + 'body' => 'analysis_rule', + 'placeholders' => [ + 'analysis_rule.name' => [ + 'getters' => [ + 'getAnalysisRule', + 'getName', + ], + ], + ], + ], 'UpdateConversation' => [ 'method' => 'patch', 'uriTemplate' => '/v1/{conversation.name=projects/*/locations/*/conversations/*}', @@ -447,6 +768,22 @@ ], ], ], + 'UpdateFeedbackLabel' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{feedback_label.name=projects/*/locations/*/conversations/*/feedbackLabels/*}', + 'body' => 'feedback_label', + 'placeholders' => [ + 'feedback_label.name' => [ + 'getters' => [ + 'getFeedbackLabel', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], 'UpdateIssue' => [ 'method' => 'patch', 'uriTemplate' => '/v1/{issue.name=projects/*/locations/*/issueModels/*/issues/*}', @@ -486,6 +823,38 @@ ], ], ], + 'UpdateQaQuestion' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{qa_question.name=projects/*/locations/*/qaScorecards/*/revisions/*/qaQuestions/*}', + 'body' => 'qa_question', + 'placeholders' => [ + 'qa_question.name' => [ + 'getters' => [ + 'getQaQuestion', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateQaScorecard' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{qa_scorecard.name=projects/*/locations/*/qaScorecards/*}', + 'body' => 'qa_scorecard', + 'placeholders' => [ + 'qa_scorecard.name' => [ + 'getters' => [ + 'getQaScorecard', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], 'UpdateSettings' => [ 'method' => 'patch', 'uriTemplate' => '/v1/{settings.name=projects/*/locations/*/settings}', diff --git a/ContactCenterInsights/tests/Unit/V1/Client/ContactCenterInsightsClientTest.php b/ContactCenterInsights/tests/Unit/V1/Client/ContactCenterInsightsClientTest.php index bfce002f77dd..24ccb5c0a77e 100644 --- a/ContactCenterInsights/tests/Unit/V1/Client/ContactCenterInsightsClientTest.php +++ b/ContactCenterInsights/tests/Unit/V1/Client/ContactCenterInsightsClientTest.php @@ -27,10 +27,15 @@ use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\ContactCenterInsights\V1\Analysis; +use Google\Cloud\ContactCenterInsights\V1\AnalysisRule; use Google\Cloud\ContactCenterInsights\V1\BulkAnalyzeConversationsRequest; use Google\Cloud\ContactCenterInsights\V1\BulkAnalyzeConversationsResponse; use Google\Cloud\ContactCenterInsights\V1\BulkDeleteConversationsRequest; use Google\Cloud\ContactCenterInsights\V1\BulkDeleteConversationsResponse; +use Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsRequest; +use Google\Cloud\ContactCenterInsights\V1\BulkDownloadFeedbackLabelsResponse; +use Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsRequest; +use Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsResponse; use Google\Cloud\ContactCenterInsights\V1\CalculateIssueModelStatsRequest; use Google\Cloud\ContactCenterInsights\V1\CalculateIssueModelStatsResponse; use Google\Cloud\ContactCenterInsights\V1\CalculateStatsRequest; @@ -38,29 +43,46 @@ use Google\Cloud\ContactCenterInsights\V1\Client\ContactCenterInsightsClient; use Google\Cloud\ContactCenterInsights\V1\Conversation; use Google\Cloud\ContactCenterInsights\V1\CreateAnalysisRequest; +use Google\Cloud\ContactCenterInsights\V1\CreateAnalysisRuleRequest; use Google\Cloud\ContactCenterInsights\V1\CreateConversationRequest; +use Google\Cloud\ContactCenterInsights\V1\CreateFeedbackLabelRequest; use Google\Cloud\ContactCenterInsights\V1\CreateIssueModelRequest; use Google\Cloud\ContactCenterInsights\V1\CreatePhraseMatcherRequest; +use Google\Cloud\ContactCenterInsights\V1\CreateQaQuestionRequest; +use Google\Cloud\ContactCenterInsights\V1\CreateQaScorecardRequest; +use Google\Cloud\ContactCenterInsights\V1\CreateQaScorecardRevisionRequest; use Google\Cloud\ContactCenterInsights\V1\CreateViewRequest; use Google\Cloud\ContactCenterInsights\V1\DeleteAnalysisRequest; +use Google\Cloud\ContactCenterInsights\V1\DeleteAnalysisRuleRequest; use Google\Cloud\ContactCenterInsights\V1\DeleteConversationRequest; +use Google\Cloud\ContactCenterInsights\V1\DeleteFeedbackLabelRequest; use Google\Cloud\ContactCenterInsights\V1\DeleteIssueModelRequest; use Google\Cloud\ContactCenterInsights\V1\DeleteIssueRequest; use Google\Cloud\ContactCenterInsights\V1\DeletePhraseMatcherRequest; +use Google\Cloud\ContactCenterInsights\V1\DeleteQaQuestionRequest; +use Google\Cloud\ContactCenterInsights\V1\DeleteQaScorecardRequest; +use Google\Cloud\ContactCenterInsights\V1\DeleteQaScorecardRevisionRequest; use Google\Cloud\ContactCenterInsights\V1\DeleteViewRequest; use Google\Cloud\ContactCenterInsights\V1\DeployIssueModelRequest; use Google\Cloud\ContactCenterInsights\V1\DeployIssueModelResponse; +use Google\Cloud\ContactCenterInsights\V1\DeployQaScorecardRevisionRequest; use Google\Cloud\ContactCenterInsights\V1\EncryptionSpec; use Google\Cloud\ContactCenterInsights\V1\ExportInsightsDataRequest; use Google\Cloud\ContactCenterInsights\V1\ExportInsightsDataResponse; use Google\Cloud\ContactCenterInsights\V1\ExportIssueModelRequest; use Google\Cloud\ContactCenterInsights\V1\ExportIssueModelResponse; +use Google\Cloud\ContactCenterInsights\V1\FeedbackLabel; use Google\Cloud\ContactCenterInsights\V1\GetAnalysisRequest; +use Google\Cloud\ContactCenterInsights\V1\GetAnalysisRuleRequest; use Google\Cloud\ContactCenterInsights\V1\GetConversationRequest; use Google\Cloud\ContactCenterInsights\V1\GetEncryptionSpecRequest; +use Google\Cloud\ContactCenterInsights\V1\GetFeedbackLabelRequest; use Google\Cloud\ContactCenterInsights\V1\GetIssueModelRequest; use Google\Cloud\ContactCenterInsights\V1\GetIssueRequest; use Google\Cloud\ContactCenterInsights\V1\GetPhraseMatcherRequest; +use Google\Cloud\ContactCenterInsights\V1\GetQaQuestionRequest; +use Google\Cloud\ContactCenterInsights\V1\GetQaScorecardRequest; +use Google\Cloud\ContactCenterInsights\V1\GetQaScorecardRevisionRequest; use Google\Cloud\ContactCenterInsights\V1\GetSettingsRequest; use Google\Cloud\ContactCenterInsights\V1\GetViewRequest; use Google\Cloud\ContactCenterInsights\V1\ImportIssueModelRequest; @@ -71,27 +93,51 @@ use Google\Cloud\ContactCenterInsights\V1\InitializeEncryptionSpecResponse; use Google\Cloud\ContactCenterInsights\V1\Issue; use Google\Cloud\ContactCenterInsights\V1\IssueModel; +use Google\Cloud\ContactCenterInsights\V1\ListAllFeedbackLabelsRequest; +use Google\Cloud\ContactCenterInsights\V1\ListAllFeedbackLabelsResponse; use Google\Cloud\ContactCenterInsights\V1\ListAnalysesRequest; use Google\Cloud\ContactCenterInsights\V1\ListAnalysesResponse; +use Google\Cloud\ContactCenterInsights\V1\ListAnalysisRulesRequest; +use Google\Cloud\ContactCenterInsights\V1\ListAnalysisRulesResponse; use Google\Cloud\ContactCenterInsights\V1\ListConversationsRequest; use Google\Cloud\ContactCenterInsights\V1\ListConversationsResponse; +use Google\Cloud\ContactCenterInsights\V1\ListFeedbackLabelsRequest; +use Google\Cloud\ContactCenterInsights\V1\ListFeedbackLabelsResponse; use Google\Cloud\ContactCenterInsights\V1\ListIssueModelsRequest; use Google\Cloud\ContactCenterInsights\V1\ListIssueModelsResponse; use Google\Cloud\ContactCenterInsights\V1\ListIssuesRequest; use Google\Cloud\ContactCenterInsights\V1\ListIssuesResponse; use Google\Cloud\ContactCenterInsights\V1\ListPhraseMatchersRequest; use Google\Cloud\ContactCenterInsights\V1\ListPhraseMatchersResponse; +use Google\Cloud\ContactCenterInsights\V1\ListQaQuestionsRequest; +use Google\Cloud\ContactCenterInsights\V1\ListQaQuestionsResponse; +use Google\Cloud\ContactCenterInsights\V1\ListQaScorecardRevisionsRequest; +use Google\Cloud\ContactCenterInsights\V1\ListQaScorecardRevisionsResponse; +use Google\Cloud\ContactCenterInsights\V1\ListQaScorecardsRequest; +use Google\Cloud\ContactCenterInsights\V1\ListQaScorecardsResponse; use Google\Cloud\ContactCenterInsights\V1\ListViewsRequest; use Google\Cloud\ContactCenterInsights\V1\ListViewsResponse; use Google\Cloud\ContactCenterInsights\V1\PhraseMatcher; use Google\Cloud\ContactCenterInsights\V1\PhraseMatcher\PhraseMatcherType; +use Google\Cloud\ContactCenterInsights\V1\QaQuestion; +use Google\Cloud\ContactCenterInsights\V1\QaScorecard; +use Google\Cloud\ContactCenterInsights\V1\QaScorecardRevision; +use Google\Cloud\ContactCenterInsights\V1\QueryMetricsRequest; +use Google\Cloud\ContactCenterInsights\V1\QueryMetricsResponse; use Google\Cloud\ContactCenterInsights\V1\Settings; +use Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionRequest; +use Google\Cloud\ContactCenterInsights\V1\TuneQaScorecardRevisionResponse; use Google\Cloud\ContactCenterInsights\V1\UndeployIssueModelRequest; use Google\Cloud\ContactCenterInsights\V1\UndeployIssueModelResponse; +use Google\Cloud\ContactCenterInsights\V1\UndeployQaScorecardRevisionRequest; +use Google\Cloud\ContactCenterInsights\V1\UpdateAnalysisRuleRequest; use Google\Cloud\ContactCenterInsights\V1\UpdateConversationRequest; +use Google\Cloud\ContactCenterInsights\V1\UpdateFeedbackLabelRequest; use Google\Cloud\ContactCenterInsights\V1\UpdateIssueModelRequest; use Google\Cloud\ContactCenterInsights\V1\UpdateIssueRequest; use Google\Cloud\ContactCenterInsights\V1\UpdatePhraseMatcherRequest; +use Google\Cloud\ContactCenterInsights\V1\UpdateQaQuestionRequest; +use Google\Cloud\ContactCenterInsights\V1\UpdateQaScorecardRequest; use Google\Cloud\ContactCenterInsights\V1\UpdateSettingsRequest; use Google\Cloud\ContactCenterInsights\V1\UpdateViewRequest; use Google\Cloud\ContactCenterInsights\V1\UploadConversationRequest; @@ -403,6 +449,256 @@ public function bulkDeleteConversationsExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function bulkDownloadFeedbackLabelsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/bulkDownloadFeedbackLabelsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BulkDownloadFeedbackLabelsResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/bulkDownloadFeedbackLabelsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new BulkDownloadFeedbackLabelsRequest())->setParent($formattedParent); + $response = $gapicClient->bulkDownloadFeedbackLabels($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/BulkDownloadFeedbackLabels', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/bulkDownloadFeedbackLabelsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function bulkDownloadFeedbackLabelsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/bulkDownloadFeedbackLabelsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new BulkDownloadFeedbackLabelsRequest())->setParent($formattedParent); + $response = $gapicClient->bulkDownloadFeedbackLabels($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/bulkDownloadFeedbackLabelsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function bulkUploadFeedbackLabelsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/bulkUploadFeedbackLabelsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BulkUploadFeedbackLabelsResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/bulkUploadFeedbackLabelsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new BulkUploadFeedbackLabelsRequest())->setParent($formattedParent); + $response = $gapicClient->bulkUploadFeedbackLabels($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/BulkUploadFeedbackLabels', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/bulkUploadFeedbackLabelsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function bulkUploadFeedbackLabelsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/bulkUploadFeedbackLabelsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new BulkUploadFeedbackLabelsRequest())->setParent($formattedParent); + $response = $gapicClient->bulkUploadFeedbackLabels($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/bulkUploadFeedbackLabelsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function calculateIssueModelStatsTest() { @@ -671,7 +967,7 @@ public function createAnalysisExceptionTest() } /** @test */ - public function createConversationTest() + public function createAnalysisRuleTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -680,42 +976,40 @@ public function createConversationTest() $this->assertTrue($transport->isExhausted()); // Mock response $name = 'name3373707'; - $languageCode = 'languageCode-412800396'; - $agentId = 'agentId1469158549'; - $metadataJson = 'metadataJson-2002268168'; - $turnCount = 428155597; - $obfuscatedUserId = 'obfuscatedUserId-227848300'; - $expectedResponse = new Conversation(); + $displayName = 'displayName1615086568'; + $conversationFilter = 'conversationFilter1770349236'; + $analysisPercentage = 1.60975766e8; + $active = true; + $expectedResponse = new AnalysisRule(); $expectedResponse->setName($name); - $expectedResponse->setLanguageCode($languageCode); - $expectedResponse->setAgentId($agentId); - $expectedResponse->setMetadataJson($metadataJson); - $expectedResponse->setTurnCount($turnCount); - $expectedResponse->setObfuscatedUserId($obfuscatedUserId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setConversationFilter($conversationFilter); + $expectedResponse->setAnalysisPercentage($analysisPercentage); + $expectedResponse->setActive($active); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $conversation = new Conversation(); - $request = (new CreateConversationRequest())->setParent($formattedParent)->setConversation($conversation); - $response = $gapicClient->createConversation($request); + $analysisRule = new AnalysisRule(); + $request = (new CreateAnalysisRuleRequest())->setParent($formattedParent)->setAnalysisRule($analysisRule); + $response = $gapicClient->createAnalysisRule($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CreateConversation', + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CreateAnalysisRule', $actualFuncCall ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getConversation(); - $this->assertProtobufEquals($conversation, $actualValue); + $actualValue = $actualRequestObject->getAnalysisRule(); + $this->assertProtobufEquals($analysisRule, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function createConversationExceptionTest() + public function createAnalysisRuleExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -737,10 +1031,10 @@ public function createConversationExceptionTest() $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $conversation = new Conversation(); - $request = (new CreateConversationRequest())->setParent($formattedParent)->setConversation($conversation); + $analysisRule = new AnalysisRule(); + $request = (new CreateAnalysisRuleRequest())->setParent($formattedParent)->setAnalysisRule($analysisRule); try { - $gapicClient->createConversation($request); + $gapicClient->createAnalysisRule($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -753,12 +1047,170 @@ public function createConversationExceptionTest() } /** @test */ - public function createIssueModelTest() + public function createConversationTest() { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $languageCode = 'languageCode-412800396'; + $agentId = 'agentId1469158549'; + $metadataJson = 'metadataJson-2002268168'; + $turnCount = 428155597; + $obfuscatedUserId = 'obfuscatedUserId-227848300'; + $expectedResponse = new Conversation(); + $expectedResponse->setName($name); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setAgentId($agentId); + $expectedResponse->setMetadataJson($metadataJson); + $expectedResponse->setTurnCount($turnCount); + $expectedResponse->setObfuscatedUserId($obfuscatedUserId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $conversation = new Conversation(); + $request = (new CreateConversationRequest())->setParent($formattedParent)->setConversation($conversation); + $response = $gapicClient->createConversation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CreateConversation', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getConversation(); + $this->assertProtobufEquals($conversation, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createConversationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $conversation = new Conversation(); + $request = (new CreateConversationRequest())->setParent($formattedParent)->setConversation($conversation); + try { + $gapicClient->createConversation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createFeedbackLabelTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $label = 'label102727412'; + $name = 'name3373707'; + $labeledResource = 'labeledResource556993594'; + $expectedResponse = new FeedbackLabel(); + $expectedResponse->setLabel($label); + $expectedResponse->setName($name); + $expectedResponse->setLabeledResource($labeledResource); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); + $feedbackLabel = new FeedbackLabel(); + $request = (new CreateFeedbackLabelRequest())->setParent($formattedParent)->setFeedbackLabel($feedbackLabel); + $response = $gapicClient->createFeedbackLabel($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CreateFeedbackLabel', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getFeedbackLabel(); + $this->assertProtobufEquals($feedbackLabel, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createFeedbackLabelExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); + $feedbackLabel = new FeedbackLabel(); + $request = (new CreateFeedbackLabelRequest())->setParent($formattedParent)->setFeedbackLabel($feedbackLabel); + try { + $gapicClient->createFeedbackLabel($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createIssueModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, 'credentials' => $this->createCredentials(), ]); $transport = $this->createTransport(); @@ -974,7 +1426,7 @@ public function createPhraseMatcherExceptionTest() } /** @test */ - public function createViewTest() + public function createQaQuestionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -983,33 +1435,45 @@ public function createViewTest() $this->assertTrue($transport->isExhausted()); // Mock response $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $value = 'value111972721'; - $expectedResponse = new View(); + $abbreviation = 'abbreviation-1960645810'; + $questionBody = 'questionBody-1030867365'; + $answerInstructions = 'answerInstructions863229062'; + $order = 106006350; + $expectedResponse = new QaQuestion(); $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setValue($value); + $expectedResponse->setAbbreviation($abbreviation); + $expectedResponse->setQuestionBody($questionBody); + $expectedResponse->setAnswerInstructions($answerInstructions); + $expectedResponse->setOrder($order); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $view = new View(); - $request = (new CreateViewRequest())->setParent($formattedParent)->setView($view); - $response = $gapicClient->createView($request); + $formattedParent = $gapicClient->qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + $qaQuestion = new QaQuestion(); + $request = (new CreateQaQuestionRequest())->setParent($formattedParent)->setQaQuestion($qaQuestion); + $response = $gapicClient->createQaQuestion($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CreateView', $actualFuncCall); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CreateQaQuestion', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getView(); - $this->assertProtobufEquals($view, $actualValue); + $actualValue = $actualRequestObject->getQaQuestion(); + $this->assertProtobufEquals($qaQuestion, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function createViewExceptionTest() + public function createQaQuestionExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1030,11 +1494,16 @@ public function createViewExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $view = new View(); - $request = (new CreateViewRequest())->setParent($formattedParent)->setView($view); + $formattedParent = $gapicClient->qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + $qaQuestion = new QaQuestion(); + $request = (new CreateQaQuestionRequest())->setParent($formattedParent)->setQaQuestion($qaQuestion); try { - $gapicClient->createView($request); + $gapicClient->createQaQuestion($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -1047,7 +1516,7 @@ public function createViewExceptionTest() } /** @test */ - public function deleteAnalysisTest() + public function createQaScorecardTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1055,27 +1524,37 @@ public function deleteAnalysisTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response - $expectedResponse = new GPBEmpty(); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $expectedResponse = new QaScorecard(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->analysisName('[PROJECT]', '[LOCATION]', '[CONVERSATION]', '[ANALYSIS]'); - $request = (new DeleteAnalysisRequest())->setName($formattedName); - $gapicClient->deleteAnalysis($request); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $qaScorecard = new QaScorecard(); + $request = (new CreateQaScorecardRequest())->setParent($formattedParent)->setQaScorecard($qaScorecard); + $response = $gapicClient->createQaScorecard($request); + $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteAnalysis', + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CreateQaScorecard', $actualFuncCall ); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getQaScorecard(); + $this->assertProtobufEquals($qaScorecard, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function deleteAnalysisExceptionTest() + public function createQaScorecardExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1096,10 +1575,11 @@ public function deleteAnalysisExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->analysisName('[PROJECT]', '[LOCATION]', '[CONVERSATION]', '[ANALYSIS]'); - $request = (new DeleteAnalysisRequest())->setName($formattedName); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $qaScorecard = new QaScorecard(); + $request = (new CreateQaScorecardRequest())->setParent($formattedParent)->setQaScorecard($qaScorecard); try { - $gapicClient->deleteAnalysis($request); + $gapicClient->createQaScorecard($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -1112,7 +1592,7 @@ public function deleteAnalysisExceptionTest() } /** @test */ - public function deleteConversationTest() + public function createQaScorecardRevisionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1120,27 +1600,35 @@ public function deleteConversationTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response - $expectedResponse = new GPBEmpty(); + $name = 'name3373707'; + $expectedResponse = new QaScorecardRevision(); + $expectedResponse->setName($name); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); - $request = (new DeleteConversationRequest())->setName($formattedName); - $gapicClient->deleteConversation($request); + $formattedParent = $gapicClient->qaScorecardName('[PROJECT]', '[LOCATION]', '[QA_SCORECARD]'); + $qaScorecardRevision = new QaScorecardRevision(); + $request = (new CreateQaScorecardRevisionRequest()) + ->setParent($formattedParent) + ->setQaScorecardRevision($qaScorecardRevision); + $response = $gapicClient->createQaScorecardRevision($request); + $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteConversation', + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CreateQaScorecardRevision', $actualFuncCall ); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getQaScorecardRevision(); + $this->assertProtobufEquals($qaScorecardRevision, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function deleteConversationExceptionTest() + public function createQaScorecardRevisionExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1161,10 +1649,13 @@ public function deleteConversationExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); - $request = (new DeleteConversationRequest())->setName($formattedName); + $formattedParent = $gapicClient->qaScorecardName('[PROJECT]', '[LOCATION]', '[QA_SCORECARD]'); + $qaScorecardRevision = new QaScorecardRevision(); + $request = (new CreateQaScorecardRevisionRequest()) + ->setParent($formattedParent) + ->setQaScorecardRevision($qaScorecardRevision); try { - $gapicClient->deleteConversation($request); + $gapicClient->createQaScorecardRevision($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -1177,7 +1668,7 @@ public function deleteConversationExceptionTest() } /** @test */ - public function deleteIssueTest() + public function createViewTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1185,24 +1676,34 @@ public function deleteIssueTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response - $expectedResponse = new GPBEmpty(); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $value = 'value111972721'; + $expectedResponse = new View(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setValue($value); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->issueName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]', '[ISSUE]'); - $request = (new DeleteIssueRequest())->setName($formattedName); - $gapicClient->deleteIssue($request); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $view = new View(); + $request = (new CreateViewRequest())->setParent($formattedParent)->setView($view); + $response = $gapicClient->createView($request); + $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteIssue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CreateView', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getView(); + $this->assertProtobufEquals($view, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function deleteIssueExceptionTest() + public function createViewExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1223,10 +1724,11 @@ public function deleteIssueExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->issueName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]', '[ISSUE]'); - $request = (new DeleteIssueRequest())->setName($formattedName); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $view = new View(); + $request = (new CreateViewRequest())->setParent($formattedParent)->setView($view); try { - $gapicClient->deleteIssue($request); + $gapicClient->createView($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -1239,92 +1741,171 @@ public function deleteIssueExceptionTest() } /** @test */ - public function deleteIssueModelTest() + public function deleteAnalysisTest() { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, - 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteIssueModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteIssueModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); + $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); - $request = (new DeleteIssueModelRequest())->setName($formattedName); - $response = $gapicClient->deleteIssueModel($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $formattedName = $gapicClient->analysisName('[PROJECT]', '[LOCATION]', '[CONVERSATION]', '[ANALYSIS]'); + $request = (new DeleteAnalysisRequest())->setName($formattedName); + $gapicClient->deleteAnalysis($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteIssueModel', - $actualApiFuncCall + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteAnalysis', + $actualFuncCall ); - $actualValue = $actualApiRequestObject->getName(); + $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteIssueModelTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAnalysisExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->analysisName('[PROJECT]', '[LOCATION]', '[CONVERSATION]', '[ANALYSIS]'); + $request = (new DeleteAnalysisRequest())->setName($formattedName); + try { + $gapicClient->deleteAnalysis($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); } /** @test */ - public function deleteIssueModelExceptionTest() + public function deleteAnalysisRuleTest() { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->analysisRuleName('[PROJECT]', '[LOCATION]', '[ANALYSIS_RULE]'); + $request = (new DeleteAnalysisRuleRequest())->setName($formattedName); + $gapicClient->deleteAnalysisRule($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteAnalysisRule', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAnalysisRuleExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->analysisRuleName('[PROJECT]', '[LOCATION]', '[ANALYSIS_RULE]'); + $request = (new DeleteAnalysisRuleRequest())->setName($formattedName); + try { + $gapicClient->deleteAnalysisRule($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteConversationTest() + { $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, - 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteIssueModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); + $request = (new DeleteConversationRequest())->setName($formattedName); + $gapicClient->deleteConversation($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteConversation', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteConversationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -1337,34 +1918,25 @@ public function deleteIssueModelExceptionTest() ], JSON_PRETTY_PRINT ); - $operationsTransport->addResponse(null, $status); + $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); - $request = (new DeleteIssueModelRequest())->setName($formattedName); - $response = $gapicClient->deleteIssueModel($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteIssueModelTest'); + $formattedName = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); + $request = (new DeleteConversationRequest())->setName($formattedName); try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test + $gapicClient->deleteConversation($request); + // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stubs are exhausted + // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function deletePhraseMatcherTest() + public function deleteFeedbackLabelTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1375,15 +1947,20 @@ public function deletePhraseMatcherTest() $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->phraseMatcherName('[PROJECT]', '[LOCATION]', '[PHRASE_MATCHER]'); - $request = (new DeletePhraseMatcherRequest())->setName($formattedName); - $gapicClient->deletePhraseMatcher($request); + $formattedName = $gapicClient->feedbackLabelName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION]', + '[FEEDBACK_LABEL]' + ); + $request = (new DeleteFeedbackLabelRequest())->setName($formattedName); + $gapicClient->deleteFeedbackLabel($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeletePhraseMatcher', + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteFeedbackLabel', $actualFuncCall ); $actualValue = $actualRequestObject->getName(); @@ -1392,7 +1969,7 @@ public function deletePhraseMatcherTest() } /** @test */ - public function deletePhraseMatcherExceptionTest() + public function deleteFeedbackLabelExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1413,10 +1990,15 @@ public function deletePhraseMatcherExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->phraseMatcherName('[PROJECT]', '[LOCATION]', '[PHRASE_MATCHER]'); - $request = (new DeletePhraseMatcherRequest())->setName($formattedName); + $formattedName = $gapicClient->feedbackLabelName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION]', + '[FEEDBACK_LABEL]' + ); + $request = (new DeleteFeedbackLabelRequest())->setName($formattedName); try { - $gapicClient->deletePhraseMatcher($request); + $gapicClient->deleteFeedbackLabel($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -1429,7 +2011,7 @@ public function deletePhraseMatcherExceptionTest() } /** @test */ - public function deleteViewTest() + public function deleteIssueTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1440,21 +2022,21 @@ public function deleteViewTest() $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->viewName('[PROJECT]', '[LOCATION]', '[VIEW]'); - $request = (new DeleteViewRequest())->setName($formattedName); - $gapicClient->deleteView($request); + $formattedName = $gapicClient->issueName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]', '[ISSUE]'); + $request = (new DeleteIssueRequest())->setName($formattedName); + $gapicClient->deleteIssue($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteView', $actualFuncCall); + $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteIssue', $actualFuncCall); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function deleteViewExceptionTest() + public function deleteIssueExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1475,10 +2057,10 @@ public function deleteViewExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->viewName('[PROJECT]', '[LOCATION]', '[VIEW]'); - $request = (new DeleteViewRequest())->setName($formattedName); + $formattedName = $gapicClient->issueName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]', '[ISSUE]'); + $request = (new DeleteIssueRequest())->setName($formattedName); try { - $gapicClient->deleteView($request); + $gapicClient->deleteIssue($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -1491,7 +2073,7 @@ public function deleteViewExceptionTest() } /** @test */ - public function deployIssueModelTest() + public function deleteIssueModelTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -1508,21 +2090,21 @@ public function deployIssueModelTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deployIssueModelTest'); + $incompleteOperation->setName('operations/deleteIssueModelTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); - $expectedResponse = new DeployIssueModelResponse(); + $expectedResponse = new GPBEmpty(); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/deployIssueModelTest'); + $completeOperation->setName('operations/deleteIssueModelTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); - $request = (new DeployIssueModelRequest())->setName($formattedName); - $response = $gapicClient->deployIssueModel($request); + $request = (new DeleteIssueModelRequest())->setName($formattedName); + $response = $gapicClient->deleteIssueModel($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -1532,13 +2114,13 @@ public function deployIssueModelTest() $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeployIssueModel', + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteIssueModel', $actualApiFuncCall ); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deployIssueModelTest'); + $expectedOperationsRequestObject->setName('operations/deleteIssueModelTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -1557,7 +2139,7 @@ public function deployIssueModelTest() } /** @test */ - public function deployIssueModelExceptionTest() + public function deleteIssueModelExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -1574,7 +2156,7 @@ public function deployIssueModelExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deployIssueModelTest'); + $incompleteOperation->setName('operations/deleteIssueModelTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -1592,12 +2174,12 @@ public function deployIssueModelExceptionTest() $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); - $request = (new DeployIssueModelRequest())->setName($formattedName); - $response = $gapicClient->deployIssueModel($request); + $request = (new DeleteIssueModelRequest())->setName($formattedName); + $response = $gapicClient->deleteIssueModel($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deployIssueModelTest'); + $expectedOperationsRequestObject->setName('operations/deleteIssueModelTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -1616,92 +2198,41 @@ public function deployIssueModelExceptionTest() } /** @test */ - public function exportInsightsDataTest() + public function deletePhraseMatcherTest() { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, - 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportInsightsDataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ExportInsightsDataResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportInsightsDataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ExportInsightsDataRequest())->setParent($formattedParent); - $response = $gapicClient->exportInsightsData($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $formattedName = $gapicClient->phraseMatcherName('[PROJECT]', '[LOCATION]', '[PHRASE_MATCHER]'); + $request = (new DeletePhraseMatcherRequest())->setName($formattedName); + $gapicClient->deletePhraseMatcher($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ExportInsightsData', - $actualApiFuncCall + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeletePhraseMatcher', + $actualFuncCall ); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportInsightsDataTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function exportInsightsDataExceptionTest() + public function deletePhraseMatcherExceptionTest() { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, - 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportInsightsDataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -1714,119 +2245,65 @@ public function exportInsightsDataExceptionTest() ], JSON_PRETTY_PRINT ); - $operationsTransport->addResponse(null, $status); + $transport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ExportInsightsDataRequest())->setParent($formattedParent); - $response = $gapicClient->exportInsightsData($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportInsightsDataTest'); + $formattedName = $gapicClient->phraseMatcherName('[PROJECT]', '[LOCATION]', '[PHRASE_MATCHER]'); + $request = (new DeletePhraseMatcherRequest())->setName($formattedName); try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test + $gapicClient->deletePhraseMatcher($request); + // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stubs are exhausted + // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function exportIssueModelTest() + public function deleteQaQuestionTest() { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, - 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportIssueModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ExportIssueModelResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportIssueModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); - $request = (new ExportIssueModelRequest())->setName($formattedName); - $response = $gapicClient->exportIssueModel($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $formattedName = $gapicClient->qaQuestionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]', + '[QA_QUESTION]' + ); + $request = (new DeleteQaQuestionRequest())->setName($formattedName); + $gapicClient->deleteQaQuestion($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ExportIssueModel', - $actualApiFuncCall + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteQaQuestion', + $actualFuncCall ); - $actualValue = $actualApiRequestObject->getName(); + $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportIssueModelTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function exportIssueModelExceptionTest() + public function deleteQaQuestionExceptionTest() { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, - 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportIssueModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -1839,34 +2316,31 @@ public function exportIssueModelExceptionTest() ], JSON_PRETTY_PRINT ); - $operationsTransport->addResponse(null, $status); + $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); - $request = (new ExportIssueModelRequest())->setName($formattedName); - $response = $gapicClient->exportIssueModel($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportIssueModelTest'); + $formattedName = $gapicClient->qaQuestionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]', + '[QA_QUESTION]' + ); + $request = (new DeleteQaQuestionRequest())->setName($formattedName); try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test + $gapicClient->deleteQaQuestion($request); + // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stubs are exhausted + // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function getAnalysisTest() + public function deleteQaScorecardTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1874,27 +2348,27 @@ public function getAnalysisTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Analysis(); - $expectedResponse->setName($name2); + $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->analysisName('[PROJECT]', '[LOCATION]', '[CONVERSATION]', '[ANALYSIS]'); - $request = (new GetAnalysisRequest())->setName($formattedName); - $response = $gapicClient->getAnalysis($request); - $this->assertEquals($expectedResponse, $response); + $formattedName = $gapicClient->qaScorecardName('[PROJECT]', '[LOCATION]', '[QA_SCORECARD]'); + $request = (new DeleteQaScorecardRequest())->setName($formattedName); + $gapicClient->deleteQaScorecard($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetAnalysis', $actualFuncCall); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteQaScorecard', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function getAnalysisExceptionTest() + public function deleteQaScorecardExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1915,10 +2389,10 @@ public function getAnalysisExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->analysisName('[PROJECT]', '[LOCATION]', '[CONVERSATION]', '[ANALYSIS]'); - $request = (new GetAnalysisRequest())->setName($formattedName); + $formattedName = $gapicClient->qaScorecardName('[PROJECT]', '[LOCATION]', '[QA_SCORECARD]'); + $request = (new DeleteQaScorecardRequest())->setName($formattedName); try { - $gapicClient->getAnalysis($request); + $gapicClient->deleteQaScorecard($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -1931,7 +2405,7 @@ public function getAnalysisExceptionTest() } /** @test */ - public function getConversationTest() + public function deleteQaScorecardRevisionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1939,31 +2413,23 @@ public function getConversationTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response - $name2 = 'name2-1052831874'; - $languageCode = 'languageCode-412800396'; - $agentId = 'agentId1469158549'; - $metadataJson = 'metadataJson-2002268168'; - $turnCount = 428155597; - $obfuscatedUserId = 'obfuscatedUserId-227848300'; - $expectedResponse = new Conversation(); - $expectedResponse->setName($name2); - $expectedResponse->setLanguageCode($languageCode); - $expectedResponse->setAgentId($agentId); - $expectedResponse->setMetadataJson($metadataJson); - $expectedResponse->setTurnCount($turnCount); - $expectedResponse->setObfuscatedUserId($obfuscatedUserId); + $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); - $request = (new GetConversationRequest())->setName($formattedName); - $response = $gapicClient->getConversation($request); - $this->assertEquals($expectedResponse, $response); + $formattedName = $gapicClient->qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + $request = (new DeleteQaScorecardRevisionRequest())->setName($formattedName); + $gapicClient->deleteQaScorecardRevision($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetConversation', + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteQaScorecardRevision', $actualFuncCall ); $actualValue = $actualRequestObject->getName(); @@ -1972,7 +2438,7 @@ public function getConversationTest() } /** @test */ - public function getConversationExceptionTest() + public function deleteQaScorecardRevisionExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1993,10 +2459,15 @@ public function getConversationExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); - $request = (new GetConversationRequest())->setName($formattedName); + $formattedName = $gapicClient->qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + $request = (new DeleteQaScorecardRevisionRequest())->setName($formattedName); try { - $gapicClient->getConversation($request); + $gapicClient->deleteQaScorecardRevision($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -2009,7 +2480,7 @@ public function getConversationExceptionTest() } /** @test */ - public function getEncryptionSpecTest() + public function deleteViewTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2017,32 +2488,24 @@ public function getEncryptionSpecTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response - $name2 = 'name2-1052831874'; - $kmsKey = 'kmsKey-591635343'; - $expectedResponse = new EncryptionSpec(); - $expectedResponse->setName($name2); - $expectedResponse->setKmsKey($kmsKey); + $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); - $request = (new GetEncryptionSpecRequest())->setName($formattedName); - $response = $gapicClient->getEncryptionSpec($request); - $this->assertEquals($expectedResponse, $response); + $formattedName = $gapicClient->viewName('[PROJECT]', '[LOCATION]', '[VIEW]'); + $request = (new DeleteViewRequest())->setName($formattedName); + $gapicClient->deleteView($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetEncryptionSpec', - $actualFuncCall - ); + $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteView', $actualFuncCall); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function getEncryptionSpecExceptionTest() + public function deleteViewExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2063,10 +2526,10 @@ public function getEncryptionSpecExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); - $request = (new GetEncryptionSpecRequest())->setName($formattedName); + $formattedName = $gapicClient->viewName('[PROJECT]', '[LOCATION]', '[VIEW]'); + $request = (new DeleteViewRequest())->setName($formattedName); try { - $gapicClient->getEncryptionSpec($request); + $gapicClient->deleteView($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -2079,45 +2542,92 @@ public function getEncryptionSpecExceptionTest() } /** @test */ - public function getIssueTest() + public function deployIssueModelTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $displayDescription = 'displayDescription-1876039681'; - $expectedResponse = new Issue(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDisplayDescription($displayDescription); - $transport->addResponse($expectedResponse); + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deployIssueModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new DeployIssueModelResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deployIssueModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->issueName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]', '[ISSUE]'); - $request = (new GetIssueRequest())->setName($formattedName); - $response = $gapicClient->getIssue($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetIssue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); + $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); + $request = (new DeployIssueModelRequest())->setName($formattedName); + $response = $gapicClient->deployIssueModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeployIssueModel', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deployIssueModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function getIssueExceptionTest() + public function deployIssueModelExceptionTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deployIssueModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -2130,25 +2640,34 @@ public function getIssueExceptionTest() ], JSON_PRETTY_PRINT ); - $transport->addResponse(null, $status); + $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->issueName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]', '[ISSUE]'); - $request = (new GetIssueRequest())->setName($formattedName); + $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); + $request = (new DeployIssueModelRequest())->setName($formattedName); + $response = $gapicClient->deployIssueModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deployIssueModelTest'); try { - $gapicClient->getIssue($request); - // If the $gapicClient method call did not throw, fail the test + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted + // Call popReceivedCalls to ensure the stubs are exhausted $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function getIssueModelTest() + public function deployQaScorecardRevisionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2157,26 +2676,25 @@ public function getIssueModelTest() $this->assertTrue($transport->isExhausted()); // Mock response $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $issueCount = 1779144233; - $languageCode = 'languageCode-412800396'; - $expectedResponse = new IssueModel(); + $expectedResponse = new QaScorecardRevision(); $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setIssueCount($issueCount); - $expectedResponse->setLanguageCode($languageCode); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); - $request = (new GetIssueModelRequest())->setName($formattedName); - $response = $gapicClient->getIssueModel($request); + $formattedName = $gapicClient->qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + $request = (new DeployQaScorecardRevisionRequest())->setName($formattedName); + $response = $gapicClient->deployQaScorecardRevision($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetIssueModel', + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeployQaScorecardRevision', $actualFuncCall ); $actualValue = $actualRequestObject->getName(); @@ -2185,7 +2703,7 @@ public function getIssueModelTest() } /** @test */ - public function getIssueModelExceptionTest() + public function deployQaScorecardRevisionExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2206,10 +2724,15 @@ public function getIssueModelExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); - $request = (new GetIssueModelRequest())->setName($formattedName); + $formattedName = $gapicClient->qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + $request = (new DeployQaScorecardRevisionRequest())->setName($formattedName); try { - $gapicClient->getIssueModel($request); + $gapicClient->deployQaScorecardRevision($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -2222,52 +2745,92 @@ public function getIssueModelExceptionTest() } /** @test */ - public function getPhraseMatcherTest() + public function exportInsightsDataTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $name2 = 'name2-1052831874'; - $revisionId = 'revisionId513861631'; - $versionTag = 'versionTag689430451'; - $displayName = 'displayName1615086568'; - $active = true; - $expectedResponse = new PhraseMatcher(); - $expectedResponse->setName($name2); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setVersionTag($versionTag); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setActive($active); - $transport->addResponse($expectedResponse); + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportInsightsDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ExportInsightsDataResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportInsightsDataTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->phraseMatcherName('[PROJECT]', '[LOCATION]', '[PHRASE_MATCHER]'); - $request = (new GetPhraseMatcherRequest())->setName($formattedName); - $response = $gapicClient->getPhraseMatcher($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ExportInsightsDataRequest())->setParent($formattedParent); + $response = $gapicClient->exportInsightsData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetPhraseMatcher', - $actualFuncCall + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ExportInsightsData', + $actualApiFuncCall ); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportInsightsDataTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function getPhraseMatcherExceptionTest() + public function exportInsightsDataExceptionTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportInsightsDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -2280,55 +2843,1898 @@ public function getPhraseMatcherExceptionTest() ], JSON_PRETTY_PRINT ); - $transport->addResponse(null, $status); + $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->phraseMatcherName('[PROJECT]', '[LOCATION]', '[PHRASE_MATCHER]'); - $request = (new GetPhraseMatcherRequest())->setName($formattedName); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ExportInsightsDataRequest())->setParent($formattedParent); + $response = $gapicClient->exportInsightsData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportInsightsDataTest'); try { - $gapicClient->getPhraseMatcher($request); - // If the $gapicClient method call did not throw, fail the test + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted + // Call popReceivedCalls to ensure the stubs are exhausted $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function getSettingsTest() + public function exportIssueModelTest() { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportIssueModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ExportIssueModelResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportIssueModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); + $request = (new ExportIssueModelRequest())->setName($formattedName); + $response = $gapicClient->exportIssueModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ExportIssueModel', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportIssueModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportIssueModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportIssueModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); + $request = (new ExportIssueModelRequest())->setName($formattedName); + $response = $gapicClient->exportIssueModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportIssueModelTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getAnalysisTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Analysis(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->analysisName('[PROJECT]', '[LOCATION]', '[CONVERSATION]', '[ANALYSIS]'); + $request = (new GetAnalysisRequest())->setName($formattedName); + $response = $gapicClient->getAnalysis($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetAnalysis', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAnalysisExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->analysisName('[PROJECT]', '[LOCATION]', '[CONVERSATION]', '[ANALYSIS]'); + $request = (new GetAnalysisRequest())->setName($formattedName); + try { + $gapicClient->getAnalysis($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAnalysisRuleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $conversationFilter = 'conversationFilter1770349236'; + $analysisPercentage = 1.60975766e8; + $active = true; + $expectedResponse = new AnalysisRule(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setConversationFilter($conversationFilter); + $expectedResponse->setAnalysisPercentage($analysisPercentage); + $expectedResponse->setActive($active); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->analysisRuleName('[PROJECT]', '[LOCATION]', '[ANALYSIS_RULE]'); + $request = (new GetAnalysisRuleRequest())->setName($formattedName); + $response = $gapicClient->getAnalysisRule($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetAnalysisRule', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAnalysisRuleExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->analysisRuleName('[PROJECT]', '[LOCATION]', '[ANALYSIS_RULE]'); + $request = (new GetAnalysisRuleRequest())->setName($formattedName); + try { + $gapicClient->getAnalysisRule($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConversationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $languageCode = 'languageCode-412800396'; + $agentId = 'agentId1469158549'; + $metadataJson = 'metadataJson-2002268168'; + $turnCount = 428155597; + $obfuscatedUserId = 'obfuscatedUserId-227848300'; + $expectedResponse = new Conversation(); + $expectedResponse->setName($name2); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setAgentId($agentId); + $expectedResponse->setMetadataJson($metadataJson); + $expectedResponse->setTurnCount($turnCount); + $expectedResponse->setObfuscatedUserId($obfuscatedUserId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); + $request = (new GetConversationRequest())->setName($formattedName); + $response = $gapicClient->getConversation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetConversation', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConversationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); + $request = (new GetConversationRequest())->setName($formattedName); + try { + $gapicClient->getConversation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEncryptionSpecTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $kmsKey = 'kmsKey-591635343'; + $expectedResponse = new EncryptionSpec(); + $expectedResponse->setName($name2); + $expectedResponse->setKmsKey($kmsKey); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); + $request = (new GetEncryptionSpecRequest())->setName($formattedName); + $response = $gapicClient->getEncryptionSpec($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetEncryptionSpec', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEncryptionSpecExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); + $request = (new GetEncryptionSpecRequest())->setName($formattedName); + try { + $gapicClient->getEncryptionSpec($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFeedbackLabelTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $label = 'label102727412'; + $name2 = 'name2-1052831874'; + $labeledResource = 'labeledResource556993594'; + $expectedResponse = new FeedbackLabel(); + $expectedResponse->setLabel($label); + $expectedResponse->setName($name2); + $expectedResponse->setLabeledResource($labeledResource); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->feedbackLabelName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION]', + '[FEEDBACK_LABEL]' + ); + $request = (new GetFeedbackLabelRequest())->setName($formattedName); + $response = $gapicClient->getFeedbackLabel($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetFeedbackLabel', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFeedbackLabelExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->feedbackLabelName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION]', + '[FEEDBACK_LABEL]' + ); + $request = (new GetFeedbackLabelRequest())->setName($formattedName); + try { + $gapicClient->getFeedbackLabel($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIssueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $displayDescription = 'displayDescription-1876039681'; + $expectedResponse = new Issue(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDisplayDescription($displayDescription); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->issueName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]', '[ISSUE]'); + $request = (new GetIssueRequest())->setName($formattedName); + $response = $gapicClient->getIssue($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetIssue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIssueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->issueName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]', '[ISSUE]'); + $request = (new GetIssueRequest())->setName($formattedName); + try { + $gapicClient->getIssue($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIssueModelTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $issueCount = 1779144233; + $languageCode = 'languageCode-412800396'; + $expectedResponse = new IssueModel(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setIssueCount($issueCount); + $expectedResponse->setLanguageCode($languageCode); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); + $request = (new GetIssueModelRequest())->setName($formattedName); + $response = $gapicClient->getIssueModel($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetIssueModel', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIssueModelExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); + $request = (new GetIssueModelRequest())->setName($formattedName); + try { + $gapicClient->getIssueModel($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getPhraseMatcherTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $revisionId = 'revisionId513861631'; + $versionTag = 'versionTag689430451'; + $displayName = 'displayName1615086568'; + $active = true; + $expectedResponse = new PhraseMatcher(); + $expectedResponse->setName($name2); + $expectedResponse->setRevisionId($revisionId); + $expectedResponse->setVersionTag($versionTag); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setActive($active); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->phraseMatcherName('[PROJECT]', '[LOCATION]', '[PHRASE_MATCHER]'); + $request = (new GetPhraseMatcherRequest())->setName($formattedName); + $response = $gapicClient->getPhraseMatcher($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetPhraseMatcher', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getPhraseMatcherExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->phraseMatcherName('[PROJECT]', '[LOCATION]', '[PHRASE_MATCHER]'); + $request = (new GetPhraseMatcherRequest())->setName($formattedName); + try { + $gapicClient->getPhraseMatcher($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getQaQuestionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $abbreviation = 'abbreviation-1960645810'; + $questionBody = 'questionBody-1030867365'; + $answerInstructions = 'answerInstructions863229062'; + $order = 106006350; + $expectedResponse = new QaQuestion(); + $expectedResponse->setName($name2); + $expectedResponse->setAbbreviation($abbreviation); + $expectedResponse->setQuestionBody($questionBody); + $expectedResponse->setAnswerInstructions($answerInstructions); + $expectedResponse->setOrder($order); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->qaQuestionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]', + '[QA_QUESTION]' + ); + $request = (new GetQaQuestionRequest())->setName($formattedName); + $response = $gapicClient->getQaQuestion($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetQaQuestion', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getQaQuestionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->qaQuestionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]', + '[QA_QUESTION]' + ); + $request = (new GetQaQuestionRequest())->setName($formattedName); + try { + $gapicClient->getQaQuestion($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getQaScorecardTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $expectedResponse = new QaScorecard(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->qaScorecardName('[PROJECT]', '[LOCATION]', '[QA_SCORECARD]'); + $request = (new GetQaScorecardRequest())->setName($formattedName); + $response = $gapicClient->getQaScorecard($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetQaScorecard', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getQaScorecardExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->qaScorecardName('[PROJECT]', '[LOCATION]', '[QA_SCORECARD]'); + $request = (new GetQaScorecardRequest())->setName($formattedName); + try { + $gapicClient->getQaScorecard($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getQaScorecardRevisionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new QaScorecardRevision(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + $request = (new GetQaScorecardRevisionRequest())->setName($formattedName); + $response = $gapicClient->getQaScorecardRevision($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetQaScorecardRevision', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getQaScorecardRevisionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + $request = (new GetQaScorecardRevisionRequest())->setName($formattedName); + try { + $gapicClient->getQaScorecardRevision($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSettingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $languageCode = 'languageCode-412800396'; + $expectedResponse = new Settings(); + $expectedResponse->setName($name2); + $expectedResponse->setLanguageCode($languageCode); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->settingsName('[PROJECT]', '[LOCATION]'); + $request = (new GetSettingsRequest())->setName($formattedName); + $response = $gapicClient->getSettings($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetSettings', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSettingsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->settingsName('[PROJECT]', '[LOCATION]'); + $request = (new GetSettingsRequest())->setName($formattedName); + try { + $gapicClient->getSettings($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getViewTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $value = 'value111972721'; + $expectedResponse = new View(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setValue($value); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->viewName('[PROJECT]', '[LOCATION]', '[VIEW]'); + $request = (new GetViewRequest())->setName($formattedName); + $response = $gapicClient->getView($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetView', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getViewExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->viewName('[PROJECT]', '[LOCATION]', '[VIEW]'); + $request = (new GetViewRequest())->setName($formattedName); + try { + $gapicClient->getView($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function importIssueModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importIssueModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ImportIssueModelResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importIssueModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ImportIssueModelRequest())->setParent($formattedParent); + $response = $gapicClient->importIssueModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ImportIssueModel', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importIssueModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function importIssueModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importIssueModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ImportIssueModelRequest())->setParent($formattedParent); + $response = $gapicClient->importIssueModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importIssueModelTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function ingestConversationsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/ingestConversationsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new IngestConversationsResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/ingestConversationsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new IngestConversationsRequest())->setParent($formattedParent); + $response = $gapicClient->ingestConversations($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/IngestConversations', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/ingestConversationsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function ingestConversationsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/ingestConversationsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new IngestConversationsRequest())->setParent($formattedParent); + $response = $gapicClient->ingestConversations($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/ingestConversationsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function initializeEncryptionSpecTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/initializeEncryptionSpecTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new InitializeEncryptionSpecResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/initializeEncryptionSpecTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $encryptionSpec = new EncryptionSpec(); + $encryptionSpecKmsKey = 'encryptionSpecKmsKey627607756'; + $encryptionSpec->setKmsKey($encryptionSpecKmsKey); + $request = (new InitializeEncryptionSpecRequest())->setEncryptionSpec($encryptionSpec); + $response = $gapicClient->initializeEncryptionSpec($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/InitializeEncryptionSpec', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getEncryptionSpec(); + $this->assertProtobufEquals($encryptionSpec, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/initializeEncryptionSpecTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function initializeEncryptionSpecExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/initializeEncryptionSpecTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $encryptionSpec = new EncryptionSpec(); + $encryptionSpecKmsKey = 'encryptionSpecKmsKey627607756'; + $encryptionSpec->setKmsKey($encryptionSpecKmsKey); + $request = (new InitializeEncryptionSpecRequest())->setEncryptionSpec($encryptionSpec); + $response = $gapicClient->initializeEncryptionSpec($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/initializeEncryptionSpecTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function listAllFeedbackLabelsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $feedbackLabelsElement = new FeedbackLabel(); + $feedbackLabels = [$feedbackLabelsElement]; + $expectedResponse = new ListAllFeedbackLabelsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setFeedbackLabels($feedbackLabels); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListAllFeedbackLabelsRequest())->setParent($formattedParent); + $response = $gapicClient->listAllFeedbackLabels($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getFeedbackLabels()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListAllFeedbackLabels', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAllFeedbackLabelsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListAllFeedbackLabelsRequest())->setParent($formattedParent); + try { + $gapicClient->listAllFeedbackLabels($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAnalysesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $analysesElement = new Analysis(); + $analyses = [$analysesElement]; + $expectedResponse = new ListAnalysesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAnalyses($analyses); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); + $request = (new ListAnalysesRequest())->setParent($formattedParent); + $response = $gapicClient->listAnalyses($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAnalyses()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListAnalyses', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAnalysesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); + $request = (new ListAnalysesRequest())->setParent($formattedParent); + try { + $gapicClient->listAnalyses($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAnalysisRulesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $analysisRulesElement = new AnalysisRule(); + $analysisRules = [$analysisRulesElement]; + $expectedResponse = new ListAnalysisRulesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAnalysisRules($analysisRules); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListAnalysisRulesRequest())->setParent($formattedParent); + $response = $gapicClient->listAnalysisRules($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAnalysisRules()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListAnalysisRules', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAnalysisRulesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListAnalysisRulesRequest())->setParent($formattedParent); + try { + $gapicClient->listAnalysisRules($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConversationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $conversationsElement = new Conversation(); + $conversations = [$conversationsElement]; + $expectedResponse = new ListConversationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConversations($conversations); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListConversationsRequest())->setParent($formattedParent); + $response = $gapicClient->listConversations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getConversations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListConversations', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConversationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListConversationsRequest())->setParent($formattedParent); + try { + $gapicClient->listConversations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listFeedbackLabelsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $feedbackLabelsElement = new FeedbackLabel(); + $feedbackLabels = [$feedbackLabelsElement]; + $expectedResponse = new ListFeedbackLabelsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setFeedbackLabels($feedbackLabels); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); + $request = (new ListFeedbackLabelsRequest())->setParent($formattedParent); + $response = $gapicClient->listFeedbackLabels($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getFeedbackLabels()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListFeedbackLabels', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listFeedbackLabelsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); + $request = (new ListFeedbackLabelsRequest())->setParent($formattedParent); + try { + $gapicClient->listFeedbackLabels($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listIssueModelsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); // Mock response - $name2 = 'name2-1052831874'; - $languageCode = 'languageCode-412800396'; - $expectedResponse = new Settings(); - $expectedResponse->setName($name2); - $expectedResponse->setLanguageCode($languageCode); + $expectedResponse = new ListIssueModelsResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->settingsName('[PROJECT]', '[LOCATION]'); - $request = (new GetSettingsRequest())->setName($formattedName); - $response = $gapicClient->getSettings($request); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListIssueModelsRequest())->setParent($formattedParent); + $response = $gapicClient->listIssueModels($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetSettings', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListIssueModels', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function getSettingsExceptionTest() + public function listIssueModelsExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2349,10 +4755,10 @@ public function getSettingsExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->settingsName('[PROJECT]', '[LOCATION]'); - $request = (new GetSettingsRequest())->setName($formattedName); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListIssueModelsRequest())->setParent($formattedParent); try { - $gapicClient->getSettings($request); + $gapicClient->listIssueModels($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -2365,7 +4771,7 @@ public function getSettingsExceptionTest() } /** @test */ - public function getViewTest() + public function listIssuesTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2373,31 +4779,25 @@ public function getViewTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $value = 'value111972721'; - $expectedResponse = new View(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setValue($value); + $expectedResponse = new ListIssuesResponse(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->viewName('[PROJECT]', '[LOCATION]', '[VIEW]'); - $request = (new GetViewRequest())->setName($formattedName); - $response = $gapicClient->getView($request); + $formattedParent = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); + $request = (new ListIssuesRequest())->setParent($formattedParent); + $response = $gapicClient->listIssues($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetView', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListIssues', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function getViewExceptionTest() + public function listIssuesExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2418,10 +4818,10 @@ public function getViewExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->viewName('[PROJECT]', '[LOCATION]', '[VIEW]'); - $request = (new GetViewRequest())->setName($formattedName); + $formattedParent = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); + $request = (new ListIssuesRequest())->setParent($formattedParent); try { - $gapicClient->getView($request); + $gapicClient->listIssues($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -2434,92 +4834,50 @@ public function getViewExceptionTest() } /** @test */ - public function importIssueModelTest() + public function listPhraseMatchersTest() { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, - 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importIssueModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ImportIssueModelResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importIssueModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); + $nextPageToken = ''; + $phraseMatchersElement = new PhraseMatcher(); + $phraseMatchers = [$phraseMatchersElement]; + $expectedResponse = new ListPhraseMatchersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setPhraseMatchers($phraseMatchers); + $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ImportIssueModelRequest())->setParent($formattedParent); - $response = $gapicClient->importIssueModel($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $request = (new ListPhraseMatchersRequest())->setParent($formattedParent); + $response = $gapicClient->listPhraseMatchers($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getPhraseMatchers()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ImportIssueModel', - $actualApiFuncCall + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListPhraseMatchers', + $actualFuncCall ); - $actualValue = $actualApiRequestObject->getParent(); + $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importIssueModelTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function importIssueModelExceptionTest() + public function listPhraseMatchersExceptionTest() { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, - 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importIssueModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -2532,119 +4890,73 @@ public function importIssueModelExceptionTest() ], JSON_PRETTY_PRINT ); - $operationsTransport->addResponse(null, $status); + $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ImportIssueModelRequest())->setParent($formattedParent); - $response = $gapicClient->importIssueModel($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importIssueModelTest'); + $request = (new ListPhraseMatchersRequest())->setParent($formattedParent); try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test + $gapicClient->listPhraseMatchers($request); + // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stubs are exhausted + // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function ingestConversationsTest() + public function listQaQuestionsTest() { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, - 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/ingestConversationsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new IngestConversationsResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/ingestConversationsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); + $nextPageToken = ''; + $qaQuestionsElement = new QaQuestion(); + $qaQuestions = [$qaQuestionsElement]; + $expectedResponse = new ListQaQuestionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setQaQuestions($qaQuestions); + $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new IngestConversationsRequest())->setParent($formattedParent); - $response = $gapicClient->ingestConversations($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $formattedParent = $gapicClient->qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + $request = (new ListQaQuestionsRequest())->setParent($formattedParent); + $response = $gapicClient->listQaQuestions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getQaQuestions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/IngestConversations', - $actualApiFuncCall + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListQaQuestions', + $actualFuncCall ); - $actualValue = $actualApiRequestObject->getParent(); + $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/ingestConversationsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function ingestConversationsExceptionTest() + public function listQaQuestionsExceptionTest() { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, - 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/ingestConversationsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -2655,123 +4967,75 @@ public function ingestConversationsExceptionTest() 'status' => 'DATA_LOSS', 'details' => [], ], - JSON_PRETTY_PRINT - ); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new IngestConversationsRequest())->setParent($formattedParent); - $response = $gapicClient->ingestConversations($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/ingestConversationsTest'); + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + $request = (new ListQaQuestionsRequest())->setParent($formattedParent); try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test + $gapicClient->listQaQuestions($request); + // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stubs are exhausted + // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function initializeEncryptionSpecTest() + public function listQaScorecardRevisionsTest() { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, - 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/initializeEncryptionSpecTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new InitializeEncryptionSpecResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/initializeEncryptionSpecTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); + $nextPageToken = ''; + $qaScorecardRevisionsElement = new QaScorecardRevision(); + $qaScorecardRevisions = [$qaScorecardRevisionsElement]; + $expectedResponse = new ListQaScorecardRevisionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setQaScorecardRevisions($qaScorecardRevisions); + $transport->addResponse($expectedResponse); // Mock request - $encryptionSpec = new EncryptionSpec(); - $encryptionSpecKmsKey = 'encryptionSpecKmsKey627607756'; - $encryptionSpec->setKmsKey($encryptionSpecKmsKey); - $request = (new InitializeEncryptionSpecRequest())->setEncryptionSpec($encryptionSpec); - $response = $gapicClient->initializeEncryptionSpec($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $formattedParent = $gapicClient->qaScorecardName('[PROJECT]', '[LOCATION]', '[QA_SCORECARD]'); + $request = (new ListQaScorecardRevisionsRequest())->setParent($formattedParent); + $response = $gapicClient->listQaScorecardRevisions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getQaScorecardRevisions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/InitializeEncryptionSpec', - $actualApiFuncCall + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListQaScorecardRevisions', + $actualFuncCall ); - $actualValue = $actualApiRequestObject->getEncryptionSpec(); - $this->assertProtobufEquals($encryptionSpec, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/initializeEncryptionSpecTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function initializeEncryptionSpecExceptionTest() + public function listQaScorecardRevisionsExceptionTest() { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, - 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/initializeEncryptionSpecTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -2784,36 +5048,25 @@ public function initializeEncryptionSpecExceptionTest() ], JSON_PRETTY_PRINT ); - $operationsTransport->addResponse(null, $status); + $transport->addResponse(null, $status); // Mock request - $encryptionSpec = new EncryptionSpec(); - $encryptionSpecKmsKey = 'encryptionSpecKmsKey627607756'; - $encryptionSpec->setKmsKey($encryptionSpecKmsKey); - $request = (new InitializeEncryptionSpecRequest())->setEncryptionSpec($encryptionSpec); - $response = $gapicClient->initializeEncryptionSpec($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/initializeEncryptionSpecTest'); + $formattedParent = $gapicClient->qaScorecardName('[PROJECT]', '[LOCATION]', '[QA_SCORECARD]'); + $request = (new ListQaScorecardRevisionsRequest())->setParent($formattedParent); try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test + $gapicClient->listQaScorecardRevisions($request); + // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stubs are exhausted + // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function listAnalysesTest() + public function listQaScorecardsTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2822,32 +5075,35 @@ public function listAnalysesTest() $this->assertTrue($transport->isExhausted()); // Mock response $nextPageToken = ''; - $analysesElement = new Analysis(); - $analyses = [$analysesElement]; - $expectedResponse = new ListAnalysesResponse(); + $qaScorecardsElement = new QaScorecard(); + $qaScorecards = [$qaScorecardsElement]; + $expectedResponse = new ListQaScorecardsResponse(); $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setAnalyses($analyses); + $expectedResponse->setQaScorecards($qaScorecards); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); - $request = (new ListAnalysesRequest())->setParent($formattedParent); - $response = $gapicClient->listAnalyses($request); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListQaScorecardsRequest())->setParent($formattedParent); + $response = $gapicClient->listQaScorecards($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getAnalyses()[0], $resources[0]); + $this->assertEquals($expectedResponse->getQaScorecards()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListAnalyses', $actualFuncCall); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListQaScorecards', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function listAnalysesExceptionTest() + public function listQaScorecardsExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2868,10 +5124,10 @@ public function listAnalysesExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); - $request = (new ListAnalysesRequest())->setParent($formattedParent); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListQaScorecardsRequest())->setParent($formattedParent); try { - $gapicClient->listAnalyses($request); + $gapicClient->listQaScorecards($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -2884,7 +5140,7 @@ public function listAnalysesExceptionTest() } /** @test */ - public function listConversationsTest() + public function listViewsTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2893,35 +5149,32 @@ public function listConversationsTest() $this->assertTrue($transport->isExhausted()); // Mock response $nextPageToken = ''; - $conversationsElement = new Conversation(); - $conversations = [$conversationsElement]; - $expectedResponse = new ListConversationsResponse(); + $viewsElement = new View(); + $views = [$viewsElement]; + $expectedResponse = new ListViewsResponse(); $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setConversations($conversations); + $expectedResponse->setViews($views); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListConversationsRequest())->setParent($formattedParent); - $response = $gapicClient->listConversations($request); + $request = (new ListViewsRequest())->setParent($formattedParent); + $response = $gapicClient->listViews($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getConversations()[0], $resources[0]); + $this->assertEquals($expectedResponse->getViews()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListConversations', - $actualFuncCall - ); + $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListViews', $actualFuncCall); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function listConversationsExceptionTest() + public function listViewsExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2943,9 +5196,9 @@ public function listConversationsExceptionTest() $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListConversationsRequest())->setParent($formattedParent); + $request = (new ListViewsRequest())->setParent($formattedParent); try { - $gapicClient->listConversations($request); + $gapicClient->listViews($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -2958,42 +5211,97 @@ public function listConversationsExceptionTest() } /** @test */ - public function listIssueModelsTest() + public function queryMetricsTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $expectedResponse = new ListIssueModelsResponse(); - $transport->addResponse($expectedResponse); + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/queryMetricsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $location2 = 'location21541837352'; + $expectedResponse = new QueryMetricsResponse(); + $expectedResponse->setLocation($location2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/queryMetricsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListIssueModelsRequest())->setParent($formattedParent); - $response = $gapicClient->listIssueModels($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); + $formattedLocation = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $filter = 'filter-1274492040'; + $request = (new QueryMetricsRequest())->setLocation($formattedLocation)->setFilter($filter); + $response = $gapicClient->queryMetrics($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListIssueModels', - $actualFuncCall + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/QueryMetrics', + $actualApiFuncCall ); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getLocation(); + $this->assertProtobufEquals($formattedLocation, $actualValue); + $actualValue = $actualApiRequestObject->getFilter(); + $this->assertProtobufEquals($filter, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/queryMetricsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function listIssueModelsExceptionTest() + public function queryMetricsExceptionTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/queryMetricsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -3006,57 +5314,128 @@ public function listIssueModelsExceptionTest() ], JSON_PRETTY_PRINT ); - $transport->addResponse(null, $status); + $operationsTransport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListIssueModelsRequest())->setParent($formattedParent); + $formattedLocation = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $filter = 'filter-1274492040'; + $request = (new QueryMetricsRequest())->setLocation($formattedLocation)->setFilter($filter); + $response = $gapicClient->queryMetrics($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/queryMetricsTest'); try { - $gapicClient->listIssueModels($request); - // If the $gapicClient method call did not throw, fail the test + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted + // Call popReceivedCalls to ensure the stubs are exhausted $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function listIssuesTest() + public function tuneQaScorecardRevisionTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $expectedResponse = new ListIssuesResponse(); - $transport->addResponse($expectedResponse); + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/tuneQaScorecardRevisionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new TuneQaScorecardRevisionResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/tuneQaScorecardRevisionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); // Mock request - $formattedParent = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); - $request = (new ListIssuesRequest())->setParent($formattedParent); - $response = $gapicClient->listIssues($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListIssues', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); + $formattedParent = $gapicClient->qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + $filter = 'filter-1274492040'; + $request = (new TuneQaScorecardRevisionRequest())->setParent($formattedParent)->setFilter($filter); + $response = $gapicClient->tuneQaScorecardRevision($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/TuneQaScorecardRevision', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getFilter(); + $this->assertProtobufEquals($filter, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/tuneQaScorecardRevisionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function listIssuesExceptionTest() + public function tuneQaScorecardRevisionExceptionTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/tuneQaScorecardRevisionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -3069,68 +5448,125 @@ public function listIssuesExceptionTest() ], JSON_PRETTY_PRINT ); - $transport->addResponse(null, $status); + $operationsTransport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); - $request = (new ListIssuesRequest())->setParent($formattedParent); + $formattedParent = $gapicClient->qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + $filter = 'filter-1274492040'; + $request = (new TuneQaScorecardRevisionRequest())->setParent($formattedParent)->setFilter($filter); + $response = $gapicClient->tuneQaScorecardRevision($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/tuneQaScorecardRevisionTest'); try { - $gapicClient->listIssues($request); - // If the $gapicClient method call did not throw, fail the test + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted + // Call popReceivedCalls to ensure the stubs are exhausted $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function listPhraseMatchersTest() + public function undeployIssueModelTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $nextPageToken = ''; - $phraseMatchersElement = new PhraseMatcher(); - $phraseMatchers = [$phraseMatchersElement]; - $expectedResponse = new ListPhraseMatchersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setPhraseMatchers($phraseMatchers); - $transport->addResponse($expectedResponse); + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/undeployIssueModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new UndeployIssueModelResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/undeployIssueModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListPhraseMatchersRequest())->setParent($formattedParent); - $response = $gapicClient->listPhraseMatchers($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getPhraseMatchers()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); + $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); + $request = (new UndeployIssueModelRequest())->setName($formattedName); + $response = $gapicClient->undeployIssueModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListPhraseMatchers', - $actualFuncCall + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UndeployIssueModel', + $actualApiFuncCall ); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeployIssueModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function listPhraseMatchersExceptionTest() + public function undeployIssueModelExceptionTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/undeployIssueModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -3143,25 +5579,34 @@ public function listPhraseMatchersExceptionTest() ], JSON_PRETTY_PRINT ); - $transport->addResponse(null, $status); + $operationsTransport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListPhraseMatchersRequest())->setParent($formattedParent); + $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); + $request = (new UndeployIssueModelRequest())->setName($formattedName); + $response = $gapicClient->undeployIssueModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeployIssueModelTest'); try { - $gapicClient->listPhraseMatchers($request); - // If the $gapicClient method call did not throw, fail the test + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted + // Call popReceivedCalls to ensure the stubs are exhausted $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function listViewsTest() + public function undeployQaScorecardRevisionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -3169,33 +5614,35 @@ public function listViewsTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response - $nextPageToken = ''; - $viewsElement = new View(); - $views = [$viewsElement]; - $expectedResponse = new ListViewsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setViews($views); + $name2 = 'name2-1052831874'; + $expectedResponse = new QaScorecardRevision(); + $expectedResponse->setName($name2); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListViewsRequest())->setParent($formattedParent); - $response = $gapicClient->listViews($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getViews()[0], $resources[0]); + $formattedName = $gapicClient->qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + $request = (new UndeployQaScorecardRevisionRequest())->setName($formattedName); + $response = $gapicClient->undeployQaScorecardRevision($request); + $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListViews', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UndeployQaScorecardRevision', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function listViewsExceptionTest() + public function undeployQaScorecardRevisionExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -3216,10 +5663,15 @@ public function listViewsExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListViewsRequest())->setParent($formattedParent); + $formattedName = $gapicClient->qaScorecardRevisionName( + '[PROJECT]', + '[LOCATION]', + '[QA_SCORECARD]', + '[REVISION]' + ); + $request = (new UndeployQaScorecardRevisionRequest())->setName($formattedName); try { - $gapicClient->listViews($request); + $gapicClient->undeployQaScorecardRevision($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -3232,92 +5684,52 @@ public function listViewsExceptionTest() } /** @test */ - public function undeployIssueModelTest() + public function updateAnalysisRuleTest() { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, - 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/undeployIssueModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new UndeployIssueModelResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/undeployIssueModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $conversationFilter = 'conversationFilter1770349236'; + $analysisPercentage = 1.60975766e8; + $active = true; + $expectedResponse = new AnalysisRule(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setConversationFilter($conversationFilter); + $expectedResponse->setAnalysisPercentage($analysisPercentage); + $expectedResponse->setActive($active); + $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); - $request = (new UndeployIssueModelRequest())->setName($formattedName); - $response = $gapicClient->undeployIssueModel($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $analysisRule = new AnalysisRule(); + $request = (new UpdateAnalysisRuleRequest())->setAnalysisRule($analysisRule); + $response = $gapicClient->updateAnalysisRule($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UndeployIssueModel', - $actualApiFuncCall + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UpdateAnalysisRule', + $actualFuncCall ); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeployIssueModelTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $actualValue = $actualRequestObject->getAnalysisRule(); + $this->assertProtobufEquals($analysisRule, $actualValue); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function undeployIssueModelExceptionTest() + public function updateAnalysisRuleExceptionTest() { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, - 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/undeployIssueModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -3330,30 +5742,21 @@ public function undeployIssueModelExceptionTest() ], JSON_PRETTY_PRINT ); - $operationsTransport->addResponse(null, $status); + $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); - $request = (new UndeployIssueModelRequest())->setName($formattedName); - $response = $gapicClient->undeployIssueModel($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeployIssueModelTest'); + $analysisRule = new AnalysisRule(); + $request = (new UpdateAnalysisRuleRequest())->setAnalysisRule($analysisRule); try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test + $gapicClient->updateAnalysisRule($request); + // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stubs are exhausted + // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ @@ -3434,6 +5837,82 @@ public function updateConversationExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function updateFeedbackLabelTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $label = 'label102727412'; + $name = 'name3373707'; + $labeledResource = 'labeledResource556993594'; + $expectedResponse = new FeedbackLabel(); + $expectedResponse->setLabel($label); + $expectedResponse->setName($name); + $expectedResponse->setLabeledResource($labeledResource); + $transport->addResponse($expectedResponse); + // Mock request + $feedbackLabel = new FeedbackLabel(); + $updateMask = new FieldMask(); + $request = (new UpdateFeedbackLabelRequest())->setFeedbackLabel($feedbackLabel)->setUpdateMask($updateMask); + $response = $gapicClient->updateFeedbackLabel($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UpdateFeedbackLabel', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getFeedbackLabel(); + $this->assertProtobufEquals($feedbackLabel, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateFeedbackLabelExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $feedbackLabel = new FeedbackLabel(); + $updateMask = new FieldMask(); + $request = (new UpdateFeedbackLabelRequest())->setFeedbackLabel($feedbackLabel)->setUpdateMask($updateMask); + try { + $gapicClient->updateFeedbackLabel($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function updateIssueTest() { @@ -3657,6 +6136,162 @@ public function updatePhraseMatcherExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function updateQaQuestionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $abbreviation = 'abbreviation-1960645810'; + $questionBody = 'questionBody-1030867365'; + $answerInstructions = 'answerInstructions863229062'; + $order = 106006350; + $expectedResponse = new QaQuestion(); + $expectedResponse->setName($name); + $expectedResponse->setAbbreviation($abbreviation); + $expectedResponse->setQuestionBody($questionBody); + $expectedResponse->setAnswerInstructions($answerInstructions); + $expectedResponse->setOrder($order); + $transport->addResponse($expectedResponse); + // Mock request + $qaQuestion = new QaQuestion(); + $updateMask = new FieldMask(); + $request = (new UpdateQaQuestionRequest())->setQaQuestion($qaQuestion)->setUpdateMask($updateMask); + $response = $gapicClient->updateQaQuestion($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UpdateQaQuestion', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getQaQuestion(); + $this->assertProtobufEquals($qaQuestion, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateQaQuestionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $qaQuestion = new QaQuestion(); + $updateMask = new FieldMask(); + $request = (new UpdateQaQuestionRequest())->setQaQuestion($qaQuestion)->setUpdateMask($updateMask); + try { + $gapicClient->updateQaQuestion($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateQaScorecardTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $expectedResponse = new QaScorecard(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $qaScorecard = new QaScorecard(); + $updateMask = new FieldMask(); + $request = (new UpdateQaScorecardRequest())->setQaScorecard($qaScorecard)->setUpdateMask($updateMask); + $response = $gapicClient->updateQaScorecard($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UpdateQaScorecard', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getQaScorecard(); + $this->assertProtobufEquals($qaScorecard, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateQaScorecardExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $qaScorecard = new QaScorecard(); + $updateMask = new FieldMask(); + $request = (new UpdateQaScorecardRequest())->setQaScorecard($qaScorecard)->setUpdateMask($updateMask); + try { + $gapicClient->updateQaScorecard($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function updateSettingsTest() {