From 9843c23e3201d4d6ea15ecbea7a6e87af7919421 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Fri, 21 Aug 2026 20:06:53 +0000 Subject: [PATCH] chore(DiscoveryEngine): remove obsolete files --- .../complete_query.php | 81 ----------- .../import_suggestion_deny_list_entries.php | 90 ------------ .../purge_suggestion_deny_list_entries.php | 90 ------------ .../ControlServiceClient/create_control.php | 105 -------------- .../ControlServiceClient/delete_control.php | 78 ---------- .../ControlServiceClient/get_control.php | 77 ---------- .../ControlServiceClient/list_controls.php | 80 ----------- .../ControlServiceClient/update_control.php | 86 ----------- .../answer_query.php | 84 ----------- .../converse_conversation.php | 84 ----------- .../create_conversation.php | 81 ----------- .../create_session.php | 81 ----------- .../delete_conversation.php | 78 ---------- .../delete_session.php | 78 ---------- .../get_answer.php | 78 ---------- .../get_conversation.php | 77 ---------- .../get_session.php | 77 ---------- .../list_conversations.php | 82 ----------- .../list_sessions.php | 82 ----------- .../update_conversation.php | 64 --------- .../update_session.php | 63 -------- .../create_data_store.php | 115 --------------- .../delete_data_store.php | 89 ------------ .../DataStoreServiceClient/get_data_store.php | 80 ----------- .../list_data_stores.php | 87 ------------ .../update_data_store.php | 75 ---------- .../DocumentServiceClient/create_document.php | 98 ------------- .../DocumentServiceClient/delete_document.php | 84 ----------- .../DocumentServiceClient/get_document.php | 86 ----------- .../import_documents.php | 96 ------------- .../DocumentServiceClient/list_documents.php | 89 ------------ .../DocumentServiceClient/purge_documents.php | 110 -------------- .../DocumentServiceClient/update_document.php | 59 -------- .../EngineServiceClient/create_engine.php | 108 -------------- .../EngineServiceClient/delete_engine.php | 94 ------------ .../V1beta/EngineServiceClient/get_engine.php | 78 ---------- .../EngineServiceClient/list_engines.php | 78 ---------- .../EngineServiceClient/pause_engine.php | 80 ----------- .../EngineServiceClient/resume_engine.php | 80 ----------- .../EngineServiceClient/tune_engine.php | 92 ------------ .../EngineServiceClient/update_engine.php | 77 ---------- .../check_grounding.php | 76 ---------- .../provision_project.php | 105 -------------- .../samples/V1beta/RankServiceClient/rank.php | 79 ----------- .../RecommendationServiceClient/recommend.php | 134 ------------------ .../SchemaServiceClient/create_schema.php | 96 ------------- .../SchemaServiceClient/delete_schema.php | 86 ----------- .../V1beta/SchemaServiceClient/get_schema.php | 77 ---------- .../SchemaServiceClient/list_schemas.php | 77 ---------- .../SchemaServiceClient/update_schema.php | 71 ---------- .../V1beta/SearchServiceClient/search.php | 86 ----------- .../list_custom_models.php | 78 ---------- .../train_custom_model.php | 89 ------------ .../get_serving_config.php | 79 ----------- .../list_serving_configs.php | 81 ----------- .../update_serving_config.php | 85 ----------- .../batch_create_target_sites.php | 119 ---------------- .../batch_verify_target_sites.php | 90 ------------ .../create_target_site.php | 97 ------------- .../delete_target_site.php | 95 ------------- .../disable_advanced_site_search.php | 90 ------------ .../enable_advanced_site_search.php | 90 ------------ .../fetch_domain_verification_status.php | 84 ----------- .../get_site_search_engine.php | 83 ----------- .../get_target_site.php | 86 ----------- .../list_target_sites.php | 87 ------------ .../recrawl_uris.php | 97 ------------- .../update_target_site.php | 85 ----------- .../collect_user_event.php | 80 ----------- .../import_user_events.php | 90 ------------ .../write_user_event.php | 125 ---------------- 71 files changed, 6148 deletions(-) delete mode 100644 DiscoveryEngine/samples/V1beta/CompletionServiceClient/complete_query.php delete mode 100644 DiscoveryEngine/samples/V1beta/CompletionServiceClient/import_suggestion_deny_list_entries.php delete mode 100644 DiscoveryEngine/samples/V1beta/CompletionServiceClient/purge_suggestion_deny_list_entries.php delete mode 100644 DiscoveryEngine/samples/V1beta/ControlServiceClient/create_control.php delete mode 100644 DiscoveryEngine/samples/V1beta/ControlServiceClient/delete_control.php delete mode 100644 DiscoveryEngine/samples/V1beta/ControlServiceClient/get_control.php delete mode 100644 DiscoveryEngine/samples/V1beta/ControlServiceClient/list_controls.php delete mode 100644 DiscoveryEngine/samples/V1beta/ControlServiceClient/update_control.php delete mode 100644 DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/answer_query.php delete mode 100644 DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/converse_conversation.php delete mode 100644 DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/create_conversation.php delete mode 100644 DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/create_session.php delete mode 100644 DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/delete_conversation.php delete mode 100644 DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/delete_session.php delete mode 100644 DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/get_answer.php delete mode 100644 DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/get_conversation.php delete mode 100644 DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/get_session.php delete mode 100644 DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/list_conversations.php delete mode 100644 DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/list_sessions.php delete mode 100644 DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/update_conversation.php delete mode 100644 DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/update_session.php delete mode 100644 DiscoveryEngine/samples/V1beta/DataStoreServiceClient/create_data_store.php delete mode 100644 DiscoveryEngine/samples/V1beta/DataStoreServiceClient/delete_data_store.php delete mode 100644 DiscoveryEngine/samples/V1beta/DataStoreServiceClient/get_data_store.php delete mode 100644 DiscoveryEngine/samples/V1beta/DataStoreServiceClient/list_data_stores.php delete mode 100644 DiscoveryEngine/samples/V1beta/DataStoreServiceClient/update_data_store.php delete mode 100644 DiscoveryEngine/samples/V1beta/DocumentServiceClient/create_document.php delete mode 100644 DiscoveryEngine/samples/V1beta/DocumentServiceClient/delete_document.php delete mode 100644 DiscoveryEngine/samples/V1beta/DocumentServiceClient/get_document.php delete mode 100644 DiscoveryEngine/samples/V1beta/DocumentServiceClient/import_documents.php delete mode 100644 DiscoveryEngine/samples/V1beta/DocumentServiceClient/list_documents.php delete mode 100644 DiscoveryEngine/samples/V1beta/DocumentServiceClient/purge_documents.php delete mode 100644 DiscoveryEngine/samples/V1beta/DocumentServiceClient/update_document.php delete mode 100644 DiscoveryEngine/samples/V1beta/EngineServiceClient/create_engine.php delete mode 100644 DiscoveryEngine/samples/V1beta/EngineServiceClient/delete_engine.php delete mode 100644 DiscoveryEngine/samples/V1beta/EngineServiceClient/get_engine.php delete mode 100644 DiscoveryEngine/samples/V1beta/EngineServiceClient/list_engines.php delete mode 100644 DiscoveryEngine/samples/V1beta/EngineServiceClient/pause_engine.php delete mode 100644 DiscoveryEngine/samples/V1beta/EngineServiceClient/resume_engine.php delete mode 100644 DiscoveryEngine/samples/V1beta/EngineServiceClient/tune_engine.php delete mode 100644 DiscoveryEngine/samples/V1beta/EngineServiceClient/update_engine.php delete mode 100644 DiscoveryEngine/samples/V1beta/GroundedGenerationServiceClient/check_grounding.php delete mode 100644 DiscoveryEngine/samples/V1beta/ProjectServiceClient/provision_project.php delete mode 100644 DiscoveryEngine/samples/V1beta/RankServiceClient/rank.php delete mode 100644 DiscoveryEngine/samples/V1beta/RecommendationServiceClient/recommend.php delete mode 100644 DiscoveryEngine/samples/V1beta/SchemaServiceClient/create_schema.php delete mode 100644 DiscoveryEngine/samples/V1beta/SchemaServiceClient/delete_schema.php delete mode 100644 DiscoveryEngine/samples/V1beta/SchemaServiceClient/get_schema.php delete mode 100644 DiscoveryEngine/samples/V1beta/SchemaServiceClient/list_schemas.php delete mode 100644 DiscoveryEngine/samples/V1beta/SchemaServiceClient/update_schema.php delete mode 100644 DiscoveryEngine/samples/V1beta/SearchServiceClient/search.php delete mode 100644 DiscoveryEngine/samples/V1beta/SearchTuningServiceClient/list_custom_models.php delete mode 100644 DiscoveryEngine/samples/V1beta/SearchTuningServiceClient/train_custom_model.php delete mode 100644 DiscoveryEngine/samples/V1beta/ServingConfigServiceClient/get_serving_config.php delete mode 100644 DiscoveryEngine/samples/V1beta/ServingConfigServiceClient/list_serving_configs.php delete mode 100644 DiscoveryEngine/samples/V1beta/ServingConfigServiceClient/update_serving_config.php delete mode 100644 DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/batch_create_target_sites.php delete mode 100644 DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/batch_verify_target_sites.php delete mode 100644 DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/create_target_site.php delete mode 100644 DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/delete_target_site.php delete mode 100644 DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/disable_advanced_site_search.php delete mode 100644 DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/enable_advanced_site_search.php delete mode 100644 DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/fetch_domain_verification_status.php delete mode 100644 DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/get_site_search_engine.php delete mode 100644 DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/get_target_site.php delete mode 100644 DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/list_target_sites.php delete mode 100644 DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/recrawl_uris.php delete mode 100644 DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/update_target_site.php delete mode 100644 DiscoveryEngine/samples/V1beta/UserEventServiceClient/collect_user_event.php delete mode 100644 DiscoveryEngine/samples/V1beta/UserEventServiceClient/import_user_events.php delete mode 100644 DiscoveryEngine/samples/V1beta/UserEventServiceClient/write_user_event.php diff --git a/DiscoveryEngine/samples/V1beta/CompletionServiceClient/complete_query.php b/DiscoveryEngine/samples/V1beta/CompletionServiceClient/complete_query.php deleted file mode 100644 index 9c189002c471..000000000000 --- a/DiscoveryEngine/samples/V1beta/CompletionServiceClient/complete_query.php +++ /dev/null @@ -1,81 +0,0 @@ -setDataStore($formattedDataStore) - ->setQuery($query); - - // Call the API and handle any network failures. - try { - /** @var CompleteQueryResponse $response */ - $response = $completionServiceClient->completeQuery($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 -{ - $formattedDataStore = CompletionServiceClient::dataStoreName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - $query = '[QUERY]'; - - complete_query_sample($formattedDataStore, $query); -} -// [END discoveryengine_v1beta_generated_CompletionService_CompleteQuery_sync] diff --git a/DiscoveryEngine/samples/V1beta/CompletionServiceClient/import_suggestion_deny_list_entries.php b/DiscoveryEngine/samples/V1beta/CompletionServiceClient/import_suggestion_deny_list_entries.php deleted file mode 100644 index fb36db0d2a23..000000000000 --- a/DiscoveryEngine/samples/V1beta/CompletionServiceClient/import_suggestion_deny_list_entries.php +++ /dev/null @@ -1,90 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $completionServiceClient->importSuggestionDenyListEntries($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ImportSuggestionDenyListEntriesResponse $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 = CompletionServiceClient::dataStoreName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - - import_suggestion_deny_list_entries_sample($formattedParent); -} -// [END discoveryengine_v1beta_generated_CompletionService_ImportSuggestionDenyListEntries_sync] diff --git a/DiscoveryEngine/samples/V1beta/CompletionServiceClient/purge_suggestion_deny_list_entries.php b/DiscoveryEngine/samples/V1beta/CompletionServiceClient/purge_suggestion_deny_list_entries.php deleted file mode 100644 index a81d19c116c6..000000000000 --- a/DiscoveryEngine/samples/V1beta/CompletionServiceClient/purge_suggestion_deny_list_entries.php +++ /dev/null @@ -1,90 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $completionServiceClient->purgeSuggestionDenyListEntries($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var PurgeSuggestionDenyListEntriesResponse $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 = CompletionServiceClient::dataStoreName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - - purge_suggestion_deny_list_entries_sample($formattedParent); -} -// [END discoveryengine_v1beta_generated_CompletionService_PurgeSuggestionDenyListEntries_sync] diff --git a/DiscoveryEngine/samples/V1beta/ControlServiceClient/create_control.php b/DiscoveryEngine/samples/V1beta/ControlServiceClient/create_control.php deleted file mode 100644 index 3fe97bee0d8a..000000000000 --- a/DiscoveryEngine/samples/V1beta/ControlServiceClient/create_control.php +++ /dev/null @@ -1,105 +0,0 @@ -setDisplayName($controlDisplayName) - ->setSolutionType($controlSolutionType); - $request = (new CreateControlRequest()) - ->setParent($formattedParent) - ->setControl($control) - ->setControlId($controlId); - - // Call the API and handle any network failures. - try { - /** @var Control $response */ - $response = $controlServiceClient->createControl($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 = ControlServiceClient::dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); - $controlDisplayName = '[DISPLAY_NAME]'; - $controlSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; - $controlId = '[CONTROL_ID]'; - - create_control_sample($formattedParent, $controlDisplayName, $controlSolutionType, $controlId); -} -// [END discoveryengine_v1beta_generated_ControlService_CreateControl_sync] diff --git a/DiscoveryEngine/samples/V1beta/ControlServiceClient/delete_control.php b/DiscoveryEngine/samples/V1beta/ControlServiceClient/delete_control.php deleted file mode 100644 index 953459e4d83a..000000000000 --- a/DiscoveryEngine/samples/V1beta/ControlServiceClient/delete_control.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $controlServiceClient->deleteControl($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 = ControlServiceClient::controlName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[CONTROL]' - ); - - delete_control_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_ControlService_DeleteControl_sync] diff --git a/DiscoveryEngine/samples/V1beta/ControlServiceClient/get_control.php b/DiscoveryEngine/samples/V1beta/ControlServiceClient/get_control.php deleted file mode 100644 index 5bdc58d7726f..000000000000 --- a/DiscoveryEngine/samples/V1beta/ControlServiceClient/get_control.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Control $response */ - $response = $controlServiceClient->getControl($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 = ControlServiceClient::controlName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[CONTROL]' - ); - - get_control_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_ControlService_GetControl_sync] diff --git a/DiscoveryEngine/samples/V1beta/ControlServiceClient/list_controls.php b/DiscoveryEngine/samples/V1beta/ControlServiceClient/list_controls.php deleted file mode 100644 index ec2817819bc0..000000000000 --- a/DiscoveryEngine/samples/V1beta/ControlServiceClient/list_controls.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $controlServiceClient->listControls($request); - - /** @var Control $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 = ControlServiceClient::dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); - - list_controls_sample($formattedParent); -} -// [END discoveryengine_v1beta_generated_ControlService_ListControls_sync] diff --git a/DiscoveryEngine/samples/V1beta/ControlServiceClient/update_control.php b/DiscoveryEngine/samples/V1beta/ControlServiceClient/update_control.php deleted file mode 100644 index 3d2de009bf3e..000000000000 --- a/DiscoveryEngine/samples/V1beta/ControlServiceClient/update_control.php +++ /dev/null @@ -1,86 +0,0 @@ -setDisplayName($controlDisplayName) - ->setSolutionType($controlSolutionType); - $request = (new UpdateControlRequest()) - ->setControl($control); - - // Call the API and handle any network failures. - try { - /** @var Control $response */ - $response = $controlServiceClient->updateControl($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 -{ - $controlDisplayName = '[DISPLAY_NAME]'; - $controlSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; - - update_control_sample($controlDisplayName, $controlSolutionType); -} -// [END discoveryengine_v1beta_generated_ControlService_UpdateControl_sync] diff --git a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/answer_query.php b/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/answer_query.php deleted file mode 100644 index ce938eeda564..000000000000 --- a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/answer_query.php +++ /dev/null @@ -1,84 +0,0 @@ -setServingConfig($formattedServingConfig) - ->setQuery($query); - - // Call the API and handle any network failures. - try { - /** @var AnswerQueryResponse $response */ - $response = $conversationalSearchServiceClient->answerQuery($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 -{ - $formattedServingConfig = ConversationalSearchServiceClient::servingConfigName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[SERVING_CONFIG]' - ); - - answer_query_sample($formattedServingConfig); -} -// [END discoveryengine_v1beta_generated_ConversationalSearchService_AnswerQuery_sync] diff --git a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/converse_conversation.php b/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/converse_conversation.php deleted file mode 100644 index 7599eca43ce4..000000000000 --- a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/converse_conversation.php +++ /dev/null @@ -1,84 +0,0 @@ -setName($formattedName) - ->setQuery($query); - - // Call the API and handle any network failures. - try { - /** @var ConverseConversationResponse $response */ - $response = $conversationalSearchServiceClient->converseConversation($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 = ConversationalSearchServiceClient::conversationName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[CONVERSATION]' - ); - - converse_conversation_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_ConversationalSearchService_ConverseConversation_sync] diff --git a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/create_conversation.php b/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/create_conversation.php deleted file mode 100644 index c4008f59683c..000000000000 --- a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/create_conversation.php +++ /dev/null @@ -1,81 +0,0 @@ -setParent($formattedParent) - ->setConversation($conversation); - - // Call the API and handle any network failures. - try { - /** @var Conversation $response */ - $response = $conversationalSearchServiceClient->createConversation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ConversationalSearchServiceClient::dataStoreName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - - create_conversation_sample($formattedParent); -} -// [END discoveryengine_v1beta_generated_ConversationalSearchService_CreateConversation_sync] diff --git a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/create_session.php b/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/create_session.php deleted file mode 100644 index 0eb3125239c4..000000000000 --- a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/create_session.php +++ /dev/null @@ -1,81 +0,0 @@ -setParent($formattedParent) - ->setSession($session); - - // Call the API and handle any network failures. - try { - /** @var Session $response */ - $response = $conversationalSearchServiceClient->createSession($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 = ConversationalSearchServiceClient::dataStoreName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - - create_session_sample($formattedParent); -} -// [END discoveryengine_v1beta_generated_ConversationalSearchService_CreateSession_sync] diff --git a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/delete_conversation.php b/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/delete_conversation.php deleted file mode 100644 index e87459e3e344..000000000000 --- a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/delete_conversation.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $conversationalSearchServiceClient->deleteConversation($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ConversationalSearchServiceClient::conversationName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[CONVERSATION]' - ); - - delete_conversation_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_ConversationalSearchService_DeleteConversation_sync] diff --git a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/delete_session.php b/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/delete_session.php deleted file mode 100644 index 38f3969abc7b..000000000000 --- a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/delete_session.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $conversationalSearchServiceClient->deleteSession($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 = ConversationalSearchServiceClient::sessionName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[SESSION]' - ); - - delete_session_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_ConversationalSearchService_DeleteSession_sync] diff --git a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/get_answer.php b/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/get_answer.php deleted file mode 100644 index cf7159effb6d..000000000000 --- a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/get_answer.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Answer $response */ - $response = $conversationalSearchServiceClient->getAnswer($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 = ConversationalSearchServiceClient::answerName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[SESSION]', - '[ANSWER]' - ); - - get_answer_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_ConversationalSearchService_GetAnswer_sync] diff --git a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/get_conversation.php b/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/get_conversation.php deleted file mode 100644 index 2db28964741d..000000000000 --- a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/get_conversation.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Conversation $response */ - $response = $conversationalSearchServiceClient->getConversation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ConversationalSearchServiceClient::conversationName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[CONVERSATION]' - ); - - get_conversation_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_ConversationalSearchService_GetConversation_sync] diff --git a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/get_session.php b/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/get_session.php deleted file mode 100644 index 3f717d581fe2..000000000000 --- a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/get_session.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Session $response */ - $response = $conversationalSearchServiceClient->getSession($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 = ConversationalSearchServiceClient::sessionName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[SESSION]' - ); - - get_session_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_ConversationalSearchService_GetSession_sync] diff --git a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/list_conversations.php b/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/list_conversations.php deleted file mode 100644 index 375ffc916de1..000000000000 --- a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/list_conversations.php +++ /dev/null @@ -1,82 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $conversationalSearchServiceClient->listConversations($request); - - /** @var Conversation $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ConversationalSearchServiceClient::dataStoreName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - - list_conversations_sample($formattedParent); -} -// [END discoveryengine_v1beta_generated_ConversationalSearchService_ListConversations_sync] diff --git a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/list_sessions.php b/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/list_sessions.php deleted file mode 100644 index 8a8e0bb48448..000000000000 --- a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/list_sessions.php +++ /dev/null @@ -1,82 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $conversationalSearchServiceClient->listSessions($request); - - /** @var Session $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 = ConversationalSearchServiceClient::dataStoreName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - - list_sessions_sample($formattedParent); -} -// [END discoveryengine_v1beta_generated_ConversationalSearchService_ListSessions_sync] diff --git a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/update_conversation.php b/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/update_conversation.php deleted file mode 100644 index 80767a71fbc6..000000000000 --- a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/update_conversation.php +++ /dev/null @@ -1,64 +0,0 @@ -setConversation($conversation); - - // Call the API and handle any network failures. - try { - /** @var Conversation $response */ - $response = $conversationalSearchServiceClient->updateConversation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END discoveryengine_v1beta_generated_ConversationalSearchService_UpdateConversation_sync] diff --git a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/update_session.php b/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/update_session.php deleted file mode 100644 index cf96f29b51cb..000000000000 --- a/DiscoveryEngine/samples/V1beta/ConversationalSearchServiceClient/update_session.php +++ /dev/null @@ -1,63 +0,0 @@ -setSession($session); - - // Call the API and handle any network failures. - try { - /** @var Session $response */ - $response = $conversationalSearchServiceClient->updateSession($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END discoveryengine_v1beta_generated_ConversationalSearchService_UpdateSession_sync] diff --git a/DiscoveryEngine/samples/V1beta/DataStoreServiceClient/create_data_store.php b/DiscoveryEngine/samples/V1beta/DataStoreServiceClient/create_data_store.php deleted file mode 100644 index 27c2a373ef3d..000000000000 --- a/DiscoveryEngine/samples/V1beta/DataStoreServiceClient/create_data_store.php +++ /dev/null @@ -1,115 +0,0 @@ -setDisplayName($dataStoreDisplayName); - $request = (new CreateDataStoreRequest()) - ->setParent($formattedParent) - ->setDataStore($dataStore) - ->setDataStoreId($dataStoreId); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $dataStoreServiceClient->createDataStore($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var DataStore $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 = DataStoreServiceClient::collectionName( - '[PROJECT]', - '[LOCATION]', - '[COLLECTION]' - ); - $dataStoreDisplayName = '[DISPLAY_NAME]'; - $dataStoreId = '[DATA_STORE_ID]'; - - create_data_store_sample($formattedParent, $dataStoreDisplayName, $dataStoreId); -} -// [END discoveryengine_v1beta_generated_DataStoreService_CreateDataStore_sync] diff --git a/DiscoveryEngine/samples/V1beta/DataStoreServiceClient/delete_data_store.php b/DiscoveryEngine/samples/V1beta/DataStoreServiceClient/delete_data_store.php deleted file mode 100644 index 63408ce3ba4e..000000000000 --- a/DiscoveryEngine/samples/V1beta/DataStoreServiceClient/delete_data_store.php +++ /dev/null @@ -1,89 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $dataStoreServiceClient->deleteDataStore($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = DataStoreServiceClient::dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); - - delete_data_store_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_DataStoreService_DeleteDataStore_sync] diff --git a/DiscoveryEngine/samples/V1beta/DataStoreServiceClient/get_data_store.php b/DiscoveryEngine/samples/V1beta/DataStoreServiceClient/get_data_store.php deleted file mode 100644 index e59b2fd08876..000000000000 --- a/DiscoveryEngine/samples/V1beta/DataStoreServiceClient/get_data_store.php +++ /dev/null @@ -1,80 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var DataStore $response */ - $response = $dataStoreServiceClient->getDataStore($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 = DataStoreServiceClient::dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); - - get_data_store_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_DataStoreService_GetDataStore_sync] diff --git a/DiscoveryEngine/samples/V1beta/DataStoreServiceClient/list_data_stores.php b/DiscoveryEngine/samples/V1beta/DataStoreServiceClient/list_data_stores.php deleted file mode 100644 index 398e3249d10c..000000000000 --- a/DiscoveryEngine/samples/V1beta/DataStoreServiceClient/list_data_stores.php +++ /dev/null @@ -1,87 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $dataStoreServiceClient->listDataStores($request); - - /** @var DataStore $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 = DataStoreServiceClient::collectionName( - '[PROJECT]', - '[LOCATION]', - '[COLLECTION]' - ); - - list_data_stores_sample($formattedParent); -} -// [END discoveryengine_v1beta_generated_DataStoreService_ListDataStores_sync] diff --git a/DiscoveryEngine/samples/V1beta/DataStoreServiceClient/update_data_store.php b/DiscoveryEngine/samples/V1beta/DataStoreServiceClient/update_data_store.php deleted file mode 100644 index c2d3c65a98ad..000000000000 --- a/DiscoveryEngine/samples/V1beta/DataStoreServiceClient/update_data_store.php +++ /dev/null @@ -1,75 +0,0 @@ -setDisplayName($dataStoreDisplayName); - $request = (new UpdateDataStoreRequest()) - ->setDataStore($dataStore); - - // Call the API and handle any network failures. - try { - /** @var DataStore $response */ - $response = $dataStoreServiceClient->updateDataStore($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 -{ - $dataStoreDisplayName = '[DISPLAY_NAME]'; - - update_data_store_sample($dataStoreDisplayName); -} -// [END discoveryengine_v1beta_generated_DataStoreService_UpdateDataStore_sync] diff --git a/DiscoveryEngine/samples/V1beta/DocumentServiceClient/create_document.php b/DiscoveryEngine/samples/V1beta/DocumentServiceClient/create_document.php deleted file mode 100644 index 58d799a693af..000000000000 --- a/DiscoveryEngine/samples/V1beta/DocumentServiceClient/create_document.php +++ /dev/null @@ -1,98 +0,0 @@ -setParent($formattedParent) - ->setDocument($document) - ->setDocumentId($documentId); - - // Call the API and handle any network failures. - try { - /** @var Document $response */ - $response = $documentServiceClient->createDocument($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 = DocumentServiceClient::branchName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[BRANCH]' - ); - $documentId = '[DOCUMENT_ID]'; - - create_document_sample($formattedParent, $documentId); -} -// [END discoveryengine_v1beta_generated_DocumentService_CreateDocument_sync] diff --git a/DiscoveryEngine/samples/V1beta/DocumentServiceClient/delete_document.php b/DiscoveryEngine/samples/V1beta/DocumentServiceClient/delete_document.php deleted file mode 100644 index 7e1f97e9fd13..000000000000 --- a/DiscoveryEngine/samples/V1beta/DocumentServiceClient/delete_document.php +++ /dev/null @@ -1,84 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $documentServiceClient->deleteDocument($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 = DocumentServiceClient::documentName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[BRANCH]', - '[DOCUMENT]' - ); - - delete_document_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_DocumentService_DeleteDocument_sync] diff --git a/DiscoveryEngine/samples/V1beta/DocumentServiceClient/get_document.php b/DiscoveryEngine/samples/V1beta/DocumentServiceClient/get_document.php deleted file mode 100644 index f0244698e8d9..000000000000 --- a/DiscoveryEngine/samples/V1beta/DocumentServiceClient/get_document.php +++ /dev/null @@ -1,86 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Document $response */ - $response = $documentServiceClient->getDocument($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 = DocumentServiceClient::documentName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[BRANCH]', - '[DOCUMENT]' - ); - - get_document_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_DocumentService_GetDocument_sync] diff --git a/DiscoveryEngine/samples/V1beta/DocumentServiceClient/import_documents.php b/DiscoveryEngine/samples/V1beta/DocumentServiceClient/import_documents.php deleted file mode 100644 index b21f21799c1c..000000000000 --- a/DiscoveryEngine/samples/V1beta/DocumentServiceClient/import_documents.php +++ /dev/null @@ -1,96 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentServiceClient->importDocuments($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ImportDocumentsResponse $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 = DocumentServiceClient::branchName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[BRANCH]' - ); - - import_documents_sample($formattedParent); -} -// [END discoveryengine_v1beta_generated_DocumentService_ImportDocuments_sync] diff --git a/DiscoveryEngine/samples/V1beta/DocumentServiceClient/list_documents.php b/DiscoveryEngine/samples/V1beta/DocumentServiceClient/list_documents.php deleted file mode 100644 index e988fa91ef9b..000000000000 --- a/DiscoveryEngine/samples/V1beta/DocumentServiceClient/list_documents.php +++ /dev/null @@ -1,89 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $documentServiceClient->listDocuments($request); - - /** @var Document $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 = DocumentServiceClient::branchName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[BRANCH]' - ); - - list_documents_sample($formattedParent); -} -// [END discoveryengine_v1beta_generated_DocumentService_ListDocuments_sync] diff --git a/DiscoveryEngine/samples/V1beta/DocumentServiceClient/purge_documents.php b/DiscoveryEngine/samples/V1beta/DocumentServiceClient/purge_documents.php deleted file mode 100644 index 106df6d1c0ec..000000000000 --- a/DiscoveryEngine/samples/V1beta/DocumentServiceClient/purge_documents.php +++ /dev/null @@ -1,110 +0,0 @@ -setParent($formattedParent) - ->setFilter($filter); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentServiceClient->purgeDocuments($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var PurgeDocumentsResponse $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 = DocumentServiceClient::branchName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[BRANCH]' - ); - $filter = '[FILTER]'; - - purge_documents_sample($formattedParent, $filter); -} -// [END discoveryengine_v1beta_generated_DocumentService_PurgeDocuments_sync] diff --git a/DiscoveryEngine/samples/V1beta/DocumentServiceClient/update_document.php b/DiscoveryEngine/samples/V1beta/DocumentServiceClient/update_document.php deleted file mode 100644 index 9ff84c5aa563..000000000000 --- a/DiscoveryEngine/samples/V1beta/DocumentServiceClient/update_document.php +++ /dev/null @@ -1,59 +0,0 @@ -setDocument($document); - - // Call the API and handle any network failures. - try { - /** @var Document $response */ - $response = $documentServiceClient->updateDocument($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END discoveryengine_v1beta_generated_DocumentService_UpdateDocument_sync] diff --git a/DiscoveryEngine/samples/V1beta/EngineServiceClient/create_engine.php b/DiscoveryEngine/samples/V1beta/EngineServiceClient/create_engine.php deleted file mode 100644 index 16398b46b89a..000000000000 --- a/DiscoveryEngine/samples/V1beta/EngineServiceClient/create_engine.php +++ /dev/null @@ -1,108 +0,0 @@ -setDisplayName($engineDisplayName) - ->setSolutionType($engineSolutionType); - $request = (new CreateEngineRequest()) - ->setParent($formattedParent) - ->setEngine($engine) - ->setEngineId($engineId); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $engineServiceClient->createEngine($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Engine $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 = EngineServiceClient::collectionName('[PROJECT]', '[LOCATION]', '[COLLECTION]'); - $engineDisplayName = '[DISPLAY_NAME]'; - $engineSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; - $engineId = '[ENGINE_ID]'; - - create_engine_sample($formattedParent, $engineDisplayName, $engineSolutionType, $engineId); -} -// [END discoveryengine_v1beta_generated_EngineService_CreateEngine_sync] diff --git a/DiscoveryEngine/samples/V1beta/EngineServiceClient/delete_engine.php b/DiscoveryEngine/samples/V1beta/EngineServiceClient/delete_engine.php deleted file mode 100644 index 3d965c715c58..000000000000 --- a/DiscoveryEngine/samples/V1beta/EngineServiceClient/delete_engine.php +++ /dev/null @@ -1,94 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $engineServiceClient->deleteEngine($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = EngineServiceClient::engineName( - '[PROJECT]', - '[LOCATION]', - '[COLLECTION]', - '[ENGINE]' - ); - - delete_engine_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_EngineService_DeleteEngine_sync] diff --git a/DiscoveryEngine/samples/V1beta/EngineServiceClient/get_engine.php b/DiscoveryEngine/samples/V1beta/EngineServiceClient/get_engine.php deleted file mode 100644 index 77396290577b..000000000000 --- a/DiscoveryEngine/samples/V1beta/EngineServiceClient/get_engine.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Engine $response */ - $response = $engineServiceClient->getEngine($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 = EngineServiceClient::engineName( - '[PROJECT]', - '[LOCATION]', - '[COLLECTION]', - '[ENGINE]' - ); - - get_engine_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_EngineService_GetEngine_sync] diff --git a/DiscoveryEngine/samples/V1beta/EngineServiceClient/list_engines.php b/DiscoveryEngine/samples/V1beta/EngineServiceClient/list_engines.php deleted file mode 100644 index 5a435814077f..000000000000 --- a/DiscoveryEngine/samples/V1beta/EngineServiceClient/list_engines.php +++ /dev/null @@ -1,78 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $engineServiceClient->listEngines($request); - - /** @var Engine $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 = EngineServiceClient::collectionName('[PROJECT]', '[LOCATION]', '[COLLECTION]'); - - list_engines_sample($formattedParent); -} -// [END discoveryengine_v1beta_generated_EngineService_ListEngines_sync] diff --git a/DiscoveryEngine/samples/V1beta/EngineServiceClient/pause_engine.php b/DiscoveryEngine/samples/V1beta/EngineServiceClient/pause_engine.php deleted file mode 100644 index 6ea78a9f33dc..000000000000 --- a/DiscoveryEngine/samples/V1beta/EngineServiceClient/pause_engine.php +++ /dev/null @@ -1,80 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Engine $response */ - $response = $engineServiceClient->pauseEngine($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 = EngineServiceClient::engineName( - '[PROJECT]', - '[LOCATION]', - '[COLLECTION]', - '[ENGINE]' - ); - - pause_engine_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_EngineService_PauseEngine_sync] diff --git a/DiscoveryEngine/samples/V1beta/EngineServiceClient/resume_engine.php b/DiscoveryEngine/samples/V1beta/EngineServiceClient/resume_engine.php deleted file mode 100644 index aa239b170ca9..000000000000 --- a/DiscoveryEngine/samples/V1beta/EngineServiceClient/resume_engine.php +++ /dev/null @@ -1,80 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Engine $response */ - $response = $engineServiceClient->resumeEngine($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 = EngineServiceClient::engineName( - '[PROJECT]', - '[LOCATION]', - '[COLLECTION]', - '[ENGINE]' - ); - - resume_engine_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_EngineService_ResumeEngine_sync] diff --git a/DiscoveryEngine/samples/V1beta/EngineServiceClient/tune_engine.php b/DiscoveryEngine/samples/V1beta/EngineServiceClient/tune_engine.php deleted file mode 100644 index ade8159cd5b0..000000000000 --- a/DiscoveryEngine/samples/V1beta/EngineServiceClient/tune_engine.php +++ /dev/null @@ -1,92 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $engineServiceClient->tuneEngine($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TuneEngineResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = EngineServiceClient::engineName( - '[PROJECT]', - '[LOCATION]', - '[COLLECTION]', - '[ENGINE]' - ); - - tune_engine_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_EngineService_TuneEngine_sync] diff --git a/DiscoveryEngine/samples/V1beta/EngineServiceClient/update_engine.php b/DiscoveryEngine/samples/V1beta/EngineServiceClient/update_engine.php deleted file mode 100644 index 548f9803de63..000000000000 --- a/DiscoveryEngine/samples/V1beta/EngineServiceClient/update_engine.php +++ /dev/null @@ -1,77 +0,0 @@ -setDisplayName($engineDisplayName) - ->setSolutionType($engineSolutionType); - $request = (new UpdateEngineRequest()) - ->setEngine($engine); - - // Call the API and handle any network failures. - try { - /** @var Engine $response */ - $response = $engineServiceClient->updateEngine($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 -{ - $engineDisplayName = '[DISPLAY_NAME]'; - $engineSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; - - update_engine_sample($engineDisplayName, $engineSolutionType); -} -// [END discoveryengine_v1beta_generated_EngineService_UpdateEngine_sync] diff --git a/DiscoveryEngine/samples/V1beta/GroundedGenerationServiceClient/check_grounding.php b/DiscoveryEngine/samples/V1beta/GroundedGenerationServiceClient/check_grounding.php deleted file mode 100644 index e23166454ab4..000000000000 --- a/DiscoveryEngine/samples/V1beta/GroundedGenerationServiceClient/check_grounding.php +++ /dev/null @@ -1,76 +0,0 @@ -setGroundingConfig($formattedGroundingConfig); - - // Call the API and handle any network failures. - try { - /** @var CheckGroundingResponse $response */ - $response = $groundedGenerationServiceClient->checkGrounding($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 -{ - $formattedGroundingConfig = GroundedGenerationServiceClient::groundingConfigName( - '[PROJECT]', - '[LOCATION]', - '[GROUNDING_CONFIG]' - ); - - check_grounding_sample($formattedGroundingConfig); -} -// [END discoveryengine_v1beta_generated_GroundedGenerationService_CheckGrounding_sync] diff --git a/DiscoveryEngine/samples/V1beta/ProjectServiceClient/provision_project.php b/DiscoveryEngine/samples/V1beta/ProjectServiceClient/provision_project.php deleted file mode 100644 index 39a6d52bb9d0..000000000000 --- a/DiscoveryEngine/samples/V1beta/ProjectServiceClient/provision_project.php +++ /dev/null @@ -1,105 +0,0 @@ -setName($formattedName) - ->setAcceptDataUseTerms($acceptDataUseTerms) - ->setDataUseTermsVersion($dataUseTermsVersion); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $projectServiceClient->provisionProject($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Project $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ProjectServiceClient::projectName('[PROJECT]'); - $acceptDataUseTerms = false; - $dataUseTermsVersion = '[DATA_USE_TERMS_VERSION]'; - - provision_project_sample($formattedName, $acceptDataUseTerms, $dataUseTermsVersion); -} -// [END discoveryengine_v1beta_generated_ProjectService_ProvisionProject_sync] diff --git a/DiscoveryEngine/samples/V1beta/RankServiceClient/rank.php b/DiscoveryEngine/samples/V1beta/RankServiceClient/rank.php deleted file mode 100644 index 93541e70b6b8..000000000000 --- a/DiscoveryEngine/samples/V1beta/RankServiceClient/rank.php +++ /dev/null @@ -1,79 +0,0 @@ -setRankingConfig($formattedRankingConfig) - ->setRecords($records); - - // Call the API and handle any network failures. - try { - /** @var RankResponse $response */ - $response = $rankServiceClient->rank($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 -{ - $formattedRankingConfig = RankServiceClient::rankingConfigName( - '[PROJECT]', - '[LOCATION]', - '[RANKING_CONFIG]' - ); - - rank_sample($formattedRankingConfig); -} -// [END discoveryengine_v1beta_generated_RankService_Rank_sync] diff --git a/DiscoveryEngine/samples/V1beta/RecommendationServiceClient/recommend.php b/DiscoveryEngine/samples/V1beta/RecommendationServiceClient/recommend.php deleted file mode 100644 index cfa16acd342a..000000000000 --- a/DiscoveryEngine/samples/V1beta/RecommendationServiceClient/recommend.php +++ /dev/null @@ -1,134 +0,0 @@ - Men > Jeans - * - * Retail-related values: - * - * * `add-to-cart`: Add an item(s) to cart, e.g. in Retail online shopping - * * `purchase`: Purchase an item(s) - * - * Media-related values: - * - * * `media-play`: Start/resume watching a video, playing a song, etc. - * * `media-complete`: Finished or stopped midway through a video, song, etc. - * @param string $userEventUserPseudoId A unique identifier for tracking visitors. - * - * For example, this could be implemented with an HTTP cookie, which should be - * able to uniquely identify a visitor on a single device. This unique - * identifier should not change if the visitor log in/out of the website. - * - * Do not set the field to the same fixed ID for different users. This mixes - * the event history of those users together, which results in degraded model - * quality. - * - * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. - * - * The field should not contain PII or user-data. We recommend to use Google - * Analytics [Client - * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) - * for this field. - */ -function recommend_sample( - string $formattedServingConfig, - string $userEventEventType, - string $userEventUserPseudoId -): void { - // Create a client. - $recommendationServiceClient = new RecommendationServiceClient(); - - // Prepare the request message. - $userEvent = (new UserEvent()) - ->setEventType($userEventEventType) - ->setUserPseudoId($userEventUserPseudoId); - $request = (new RecommendRequest()) - ->setServingConfig($formattedServingConfig) - ->setUserEvent($userEvent); - - // Call the API and handle any network failures. - try { - /** @var RecommendResponse $response */ - $response = $recommendationServiceClient->recommend($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 -{ - $formattedServingConfig = RecommendationServiceClient::servingConfigName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[SERVING_CONFIG]' - ); - $userEventEventType = '[EVENT_TYPE]'; - $userEventUserPseudoId = '[USER_PSEUDO_ID]'; - - recommend_sample($formattedServingConfig, $userEventEventType, $userEventUserPseudoId); -} -// [END discoveryengine_v1beta_generated_RecommendationService_Recommend_sync] diff --git a/DiscoveryEngine/samples/V1beta/SchemaServiceClient/create_schema.php b/DiscoveryEngine/samples/V1beta/SchemaServiceClient/create_schema.php deleted file mode 100644 index 05e7e5bc25c7..000000000000 --- a/DiscoveryEngine/samples/V1beta/SchemaServiceClient/create_schema.php +++ /dev/null @@ -1,96 +0,0 @@ -setParent($formattedParent) - ->setSchema($schema) - ->setSchemaId($schemaId); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $schemaServiceClient->createSchema($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Schema $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 = SchemaServiceClient::dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); - $schemaId = '[SCHEMA_ID]'; - - create_schema_sample($formattedParent, $schemaId); -} -// [END discoveryengine_v1beta_generated_SchemaService_CreateSchema_sync] diff --git a/DiscoveryEngine/samples/V1beta/SchemaServiceClient/delete_schema.php b/DiscoveryEngine/samples/V1beta/SchemaServiceClient/delete_schema.php deleted file mode 100644 index 88465c02b0c4..000000000000 --- a/DiscoveryEngine/samples/V1beta/SchemaServiceClient/delete_schema.php +++ /dev/null @@ -1,86 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $schemaServiceClient->deleteSchema($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = SchemaServiceClient::schemaName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[SCHEMA]' - ); - - delete_schema_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_SchemaService_DeleteSchema_sync] diff --git a/DiscoveryEngine/samples/V1beta/SchemaServiceClient/get_schema.php b/DiscoveryEngine/samples/V1beta/SchemaServiceClient/get_schema.php deleted file mode 100644 index fe9bad536488..000000000000 --- a/DiscoveryEngine/samples/V1beta/SchemaServiceClient/get_schema.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Schema $response */ - $response = $schemaServiceClient->getSchema($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 = SchemaServiceClient::schemaName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[SCHEMA]' - ); - - get_schema_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_SchemaService_GetSchema_sync] diff --git a/DiscoveryEngine/samples/V1beta/SchemaServiceClient/list_schemas.php b/DiscoveryEngine/samples/V1beta/SchemaServiceClient/list_schemas.php deleted file mode 100644 index 6cc72cd99c30..000000000000 --- a/DiscoveryEngine/samples/V1beta/SchemaServiceClient/list_schemas.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $schemaServiceClient->listSchemas($request); - - /** @var Schema $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 = SchemaServiceClient::dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); - - list_schemas_sample($formattedParent); -} -// [END discoveryengine_v1beta_generated_SchemaService_ListSchemas_sync] diff --git a/DiscoveryEngine/samples/V1beta/SchemaServiceClient/update_schema.php b/DiscoveryEngine/samples/V1beta/SchemaServiceClient/update_schema.php deleted file mode 100644 index 4634c84a3008..000000000000 --- a/DiscoveryEngine/samples/V1beta/SchemaServiceClient/update_schema.php +++ /dev/null @@ -1,71 +0,0 @@ -setSchema($schema); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $schemaServiceClient->updateSchema($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Schema $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()); - } -} -// [END discoveryengine_v1beta_generated_SchemaService_UpdateSchema_sync] diff --git a/DiscoveryEngine/samples/V1beta/SearchServiceClient/search.php b/DiscoveryEngine/samples/V1beta/SearchServiceClient/search.php deleted file mode 100644 index 24259f5cea08..000000000000 --- a/DiscoveryEngine/samples/V1beta/SearchServiceClient/search.php +++ /dev/null @@ -1,86 +0,0 @@ -setServingConfig($formattedServingConfig); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $searchServiceClient->search($request); - - /** @var SearchResult $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 -{ - $formattedServingConfig = SearchServiceClient::servingConfigName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[SERVING_CONFIG]' - ); - - search_sample($formattedServingConfig); -} -// [END discoveryengine_v1beta_generated_SearchService_Search_sync] diff --git a/DiscoveryEngine/samples/V1beta/SearchTuningServiceClient/list_custom_models.php b/DiscoveryEngine/samples/V1beta/SearchTuningServiceClient/list_custom_models.php deleted file mode 100644 index b9d1061cf6aa..000000000000 --- a/DiscoveryEngine/samples/V1beta/SearchTuningServiceClient/list_custom_models.php +++ /dev/null @@ -1,78 +0,0 @@ -setDataStore($formattedDataStore); - - // Call the API and handle any network failures. - try { - /** @var ListCustomModelsResponse $response */ - $response = $searchTuningServiceClient->listCustomModels($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 -{ - $formattedDataStore = SearchTuningServiceClient::dataStoreName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - - list_custom_models_sample($formattedDataStore); -} -// [END discoveryengine_v1beta_generated_SearchTuningService_ListCustomModels_sync] diff --git a/DiscoveryEngine/samples/V1beta/SearchTuningServiceClient/train_custom_model.php b/DiscoveryEngine/samples/V1beta/SearchTuningServiceClient/train_custom_model.php deleted file mode 100644 index 9d52ff2995dc..000000000000 --- a/DiscoveryEngine/samples/V1beta/SearchTuningServiceClient/train_custom_model.php +++ /dev/null @@ -1,89 +0,0 @@ -setDataStore($formattedDataStore); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $searchTuningServiceClient->trainCustomModel($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TrainCustomModelResponse $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 -{ - $formattedDataStore = SearchTuningServiceClient::dataStoreName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - - train_custom_model_sample($formattedDataStore); -} -// [END discoveryengine_v1beta_generated_SearchTuningService_TrainCustomModel_sync] diff --git a/DiscoveryEngine/samples/V1beta/ServingConfigServiceClient/get_serving_config.php b/DiscoveryEngine/samples/V1beta/ServingConfigServiceClient/get_serving_config.php deleted file mode 100644 index 637e5e9e3dfc..000000000000 --- a/DiscoveryEngine/samples/V1beta/ServingConfigServiceClient/get_serving_config.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var ServingConfig $response */ - $response = $servingConfigServiceClient->getServingConfig($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 = ServingConfigServiceClient::servingConfigName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[SERVING_CONFIG]' - ); - - get_serving_config_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_ServingConfigService_GetServingConfig_sync] diff --git a/DiscoveryEngine/samples/V1beta/ServingConfigServiceClient/list_serving_configs.php b/DiscoveryEngine/samples/V1beta/ServingConfigServiceClient/list_serving_configs.php deleted file mode 100644 index 453dab5869a0..000000000000 --- a/DiscoveryEngine/samples/V1beta/ServingConfigServiceClient/list_serving_configs.php +++ /dev/null @@ -1,81 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $servingConfigServiceClient->listServingConfigs($request); - - /** @var ServingConfig $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 = ServingConfigServiceClient::dataStoreName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - - list_serving_configs_sample($formattedParent); -} -// [END discoveryengine_v1beta_generated_ServingConfigService_ListServingConfigs_sync] diff --git a/DiscoveryEngine/samples/V1beta/ServingConfigServiceClient/update_serving_config.php b/DiscoveryEngine/samples/V1beta/ServingConfigServiceClient/update_serving_config.php deleted file mode 100644 index 63ccbc590280..000000000000 --- a/DiscoveryEngine/samples/V1beta/ServingConfigServiceClient/update_serving_config.php +++ /dev/null @@ -1,85 +0,0 @@ -setDisplayName($servingConfigDisplayName) - ->setSolutionType($servingConfigSolutionType); - $request = (new UpdateServingConfigRequest()) - ->setServingConfig($servingConfig); - - // Call the API and handle any network failures. - try { - /** @var ServingConfig $response */ - $response = $servingConfigServiceClient->updateServingConfig($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 -{ - $servingConfigDisplayName = '[DISPLAY_NAME]'; - $servingConfigSolutionType = SolutionType::SOLUTION_TYPE_UNSPECIFIED; - - update_serving_config_sample($servingConfigDisplayName, $servingConfigSolutionType); -} -// [END discoveryengine_v1beta_generated_ServingConfigService_UpdateServingConfig_sync] diff --git a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/batch_create_target_sites.php b/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/batch_create_target_sites.php deleted file mode 100644 index 9e3a139159ee..000000000000 --- a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/batch_create_target_sites.php +++ /dev/null @@ -1,119 +0,0 @@ -setProvidedUriPattern($requestsTargetSiteProvidedUriPattern); - $createTargetSiteRequest = (new CreateTargetSiteRequest()) - ->setParent($formattedRequestsParent) - ->setTargetSite($requestsTargetSite); - $requests = [$createTargetSiteRequest,]; - $request = (new BatchCreateTargetSitesRequest()) - ->setParent($formattedParent) - ->setRequests($requests); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $siteSearchEngineServiceClient->batchCreateTargetSites($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var BatchCreateTargetSitesResponse $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 = SiteSearchEngineServiceClient::siteSearchEngineName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - $formattedRequestsParent = SiteSearchEngineServiceClient::siteSearchEngineName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - $requestsTargetSiteProvidedUriPattern = '[PROVIDED_URI_PATTERN]'; - - batch_create_target_sites_sample( - $formattedParent, - $formattedRequestsParent, - $requestsTargetSiteProvidedUriPattern - ); -} -// [END discoveryengine_v1beta_generated_SiteSearchEngineService_BatchCreateTargetSites_sync] diff --git a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/batch_verify_target_sites.php b/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/batch_verify_target_sites.php deleted file mode 100644 index 469f33ba114b..000000000000 --- a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/batch_verify_target_sites.php +++ /dev/null @@ -1,90 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $siteSearchEngineServiceClient->batchVerifyTargetSites($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var BatchVerifyTargetSitesResponse $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 = SiteSearchEngineServiceClient::siteSearchEngineName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - - batch_verify_target_sites_sample($formattedParent); -} -// [END discoveryengine_v1beta_generated_SiteSearchEngineService_BatchVerifyTargetSites_sync] diff --git a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/create_target_site.php b/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/create_target_site.php deleted file mode 100644 index 0f1a252e5e67..000000000000 --- a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/create_target_site.php +++ /dev/null @@ -1,97 +0,0 @@ -setProvidedUriPattern($targetSiteProvidedUriPattern); - $request = (new CreateTargetSiteRequest()) - ->setParent($formattedParent) - ->setTargetSite($targetSite); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $siteSearchEngineServiceClient->createTargetSite($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TargetSite $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 = SiteSearchEngineServiceClient::siteSearchEngineName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - $targetSiteProvidedUriPattern = '[PROVIDED_URI_PATTERN]'; - - create_target_site_sample($formattedParent, $targetSiteProvidedUriPattern); -} -// [END discoveryengine_v1beta_generated_SiteSearchEngineService_CreateTargetSite_sync] diff --git a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/delete_target_site.php b/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/delete_target_site.php deleted file mode 100644 index 189a54d3da6f..000000000000 --- a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/delete_target_site.php +++ /dev/null @@ -1,95 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $siteSearchEngineServiceClient->deleteTargetSite($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = SiteSearchEngineServiceClient::targetSiteName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[TARGET_SITE]' - ); - - delete_target_site_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_SiteSearchEngineService_DeleteTargetSite_sync] diff --git a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/disable_advanced_site_search.php b/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/disable_advanced_site_search.php deleted file mode 100644 index d19761cebd12..000000000000 --- a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/disable_advanced_site_search.php +++ /dev/null @@ -1,90 +0,0 @@ -setSiteSearchEngine($formattedSiteSearchEngine); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $siteSearchEngineServiceClient->disableAdvancedSiteSearch($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var DisableAdvancedSiteSearchResponse $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 -{ - $formattedSiteSearchEngine = SiteSearchEngineServiceClient::siteSearchEngineName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - - disable_advanced_site_search_sample($formattedSiteSearchEngine); -} -// [END discoveryengine_v1beta_generated_SiteSearchEngineService_DisableAdvancedSiteSearch_sync] diff --git a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/enable_advanced_site_search.php b/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/enable_advanced_site_search.php deleted file mode 100644 index c3899394e8a8..000000000000 --- a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/enable_advanced_site_search.php +++ /dev/null @@ -1,90 +0,0 @@ -setSiteSearchEngine($formattedSiteSearchEngine); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $siteSearchEngineServiceClient->enableAdvancedSiteSearch($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var EnableAdvancedSiteSearchResponse $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 -{ - $formattedSiteSearchEngine = SiteSearchEngineServiceClient::siteSearchEngineName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - - enable_advanced_site_search_sample($formattedSiteSearchEngine); -} -// [END discoveryengine_v1beta_generated_SiteSearchEngineService_EnableAdvancedSiteSearch_sync] diff --git a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/fetch_domain_verification_status.php b/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/fetch_domain_verification_status.php deleted file mode 100644 index f655652f8392..000000000000 --- a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/fetch_domain_verification_status.php +++ /dev/null @@ -1,84 +0,0 @@ -setSiteSearchEngine($formattedSiteSearchEngine); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $siteSearchEngineServiceClient->fetchDomainVerificationStatus($request); - - /** @var TargetSite $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 -{ - $formattedSiteSearchEngine = SiteSearchEngineServiceClient::siteSearchEngineName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - - fetch_domain_verification_status_sample($formattedSiteSearchEngine); -} -// [END discoveryengine_v1beta_generated_SiteSearchEngineService_FetchDomainVerificationStatus_sync] diff --git a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/get_site_search_engine.php b/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/get_site_search_engine.php deleted file mode 100644 index 633ac70246b7..000000000000 --- a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/get_site_search_engine.php +++ /dev/null @@ -1,83 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var SiteSearchEngine $response */ - $response = $siteSearchEngineServiceClient->getSiteSearchEngine($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 = SiteSearchEngineServiceClient::siteSearchEngineName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - - get_site_search_engine_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_SiteSearchEngineService_GetSiteSearchEngine_sync] diff --git a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/get_target_site.php b/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/get_target_site.php deleted file mode 100644 index 4b3463dec5d5..000000000000 --- a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/get_target_site.php +++ /dev/null @@ -1,86 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var TargetSite $response */ - $response = $siteSearchEngineServiceClient->getTargetSite($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 = SiteSearchEngineServiceClient::targetSiteName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]', - '[TARGET_SITE]' - ); - - get_target_site_sample($formattedName); -} -// [END discoveryengine_v1beta_generated_SiteSearchEngineService_GetTargetSite_sync] diff --git a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/list_target_sites.php b/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/list_target_sites.php deleted file mode 100644 index e1548c7f2ef9..000000000000 --- a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/list_target_sites.php +++ /dev/null @@ -1,87 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $siteSearchEngineServiceClient->listTargetSites($request); - - /** @var TargetSite $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 = SiteSearchEngineServiceClient::siteSearchEngineName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - - list_target_sites_sample($formattedParent); -} -// [END discoveryengine_v1beta_generated_SiteSearchEngineService_ListTargetSites_sync] diff --git a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/recrawl_uris.php b/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/recrawl_uris.php deleted file mode 100644 index 7c07abfbf806..000000000000 --- a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/recrawl_uris.php +++ /dev/null @@ -1,97 +0,0 @@ -setSiteSearchEngine($formattedSiteSearchEngine) - ->setUris($uris); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $siteSearchEngineServiceClient->recrawlUris($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var RecrawlUrisResponse $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 -{ - $formattedSiteSearchEngine = SiteSearchEngineServiceClient::siteSearchEngineName( - '[PROJECT]', - '[LOCATION]', - '[DATA_STORE]' - ); - $urisElement = '[URIS]'; - - recrawl_uris_sample($formattedSiteSearchEngine, $urisElement); -} -// [END discoveryengine_v1beta_generated_SiteSearchEngineService_RecrawlUris_sync] diff --git a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/update_target_site.php b/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/update_target_site.php deleted file mode 100644 index 5ebe2f8c00c9..000000000000 --- a/DiscoveryEngine/samples/V1beta/SiteSearchEngineServiceClient/update_target_site.php +++ /dev/null @@ -1,85 +0,0 @@ -setProvidedUriPattern($targetSiteProvidedUriPattern); - $request = (new UpdateTargetSiteRequest()) - ->setTargetSite($targetSite); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $siteSearchEngineServiceClient->updateTargetSite($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TargetSite $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 -{ - $targetSiteProvidedUriPattern = '[PROVIDED_URI_PATTERN]'; - - update_target_site_sample($targetSiteProvidedUriPattern); -} -// [END discoveryengine_v1beta_generated_SiteSearchEngineService_UpdateTargetSite_sync] diff --git a/DiscoveryEngine/samples/V1beta/UserEventServiceClient/collect_user_event.php b/DiscoveryEngine/samples/V1beta/UserEventServiceClient/collect_user_event.php deleted file mode 100644 index 84f50ea1967d..000000000000 --- a/DiscoveryEngine/samples/V1beta/UserEventServiceClient/collect_user_event.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($formattedParent) - ->setUserEvent($userEvent); - - // Call the API and handle any network failures. - try { - /** @var HttpBody $response */ - $response = $userEventServiceClient->collectUserEvent($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 = UserEventServiceClient::dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); - $userEvent = '[USER_EVENT]'; - - collect_user_event_sample($formattedParent, $userEvent); -} -// [END discoveryengine_v1beta_generated_UserEventService_CollectUserEvent_sync] diff --git a/DiscoveryEngine/samples/V1beta/UserEventServiceClient/import_user_events.php b/DiscoveryEngine/samples/V1beta/UserEventServiceClient/import_user_events.php deleted file mode 100644 index d12089a8d5ac..000000000000 --- a/DiscoveryEngine/samples/V1beta/UserEventServiceClient/import_user_events.php +++ /dev/null @@ -1,90 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $userEventServiceClient->importUserEvents($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ImportUserEventsResponse $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 = UserEventServiceClient::dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); - - import_user_events_sample($formattedParent); -} -// [END discoveryengine_v1beta_generated_UserEventService_ImportUserEvents_sync] diff --git a/DiscoveryEngine/samples/V1beta/UserEventServiceClient/write_user_event.php b/DiscoveryEngine/samples/V1beta/UserEventServiceClient/write_user_event.php deleted file mode 100644 index a055f58cbc69..000000000000 --- a/DiscoveryEngine/samples/V1beta/UserEventServiceClient/write_user_event.php +++ /dev/null @@ -1,125 +0,0 @@ - Men > Jeans - * - * Retail-related values: - * - * * `add-to-cart`: Add an item(s) to cart, e.g. in Retail online shopping - * * `purchase`: Purchase an item(s) - * - * Media-related values: - * - * * `media-play`: Start/resume watching a video, playing a song, etc. - * * `media-complete`: Finished or stopped midway through a video, song, etc. - * @param string $userEventUserPseudoId A unique identifier for tracking visitors. - * - * For example, this could be implemented with an HTTP cookie, which should be - * able to uniquely identify a visitor on a single device. This unique - * identifier should not change if the visitor log in/out of the website. - * - * Do not set the field to the same fixed ID for different users. This mixes - * the event history of those users together, which results in degraded model - * quality. - * - * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. - * - * The field should not contain PII or user-data. We recommend to use Google - * Analytics [Client - * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) - * for this field. - */ -function write_user_event_sample( - string $formattedParent, - string $userEventEventType, - string $userEventUserPseudoId -): void { - // Create a client. - $userEventServiceClient = new UserEventServiceClient(); - - // Prepare the request message. - $userEvent = (new UserEvent()) - ->setEventType($userEventEventType) - ->setUserPseudoId($userEventUserPseudoId); - $request = (new WriteUserEventRequest()) - ->setParent($formattedParent) - ->setUserEvent($userEvent); - - // Call the API and handle any network failures. - try { - /** @var UserEvent $response */ - $response = $userEventServiceClient->writeUserEvent($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 = UserEventServiceClient::dataStoreName('[PROJECT]', '[LOCATION]', '[DATA_STORE]'); - $userEventEventType = '[EVENT_TYPE]'; - $userEventUserPseudoId = '[USER_PSEUDO_ID]'; - - write_user_event_sample($formattedParent, $userEventEventType, $userEventUserPseudoId); -} -// [END discoveryengine_v1beta_generated_UserEventService_WriteUserEvent_sync]