Reference documentation and code samples for the Google Cloud Ces V1 Client class AgentServiceClient.
Service Description: The service that manages agent-related resources in Gemini Enterprise for Customer Engagement (CES).
This class provides the ability to make remote calls to the backing service through method calls that map to API methods.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.
Namespace
Google \ Cloud \ Ces \ V1 \ ClientMethods
__construct
Constructor.
options
array| Google\ApiCore\Options\ClientOptions
Optional. Options for configuring the service API wrapper.
↳ apiEndpoint
string
The address of the API remote host. May optionally include the port, formatted as "
↳ credentials
FetchAuthTokenInterface|CredentialsWrapper
This option should only be used with a pre-constructed Google\Auth\FetchAuthTokenInterface
or Google\ApiCore\CredentialsWrapper
object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. Important: If you are providing a path to a credentials file, or a decoded credentials file as a PHP array, this usage is now DEPRECATED. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. It is recommended to create the credentials explicitly use Google\Auth\Credentials\ServiceAccountCredentials; use Google\Cloud\Ces\V1\AgentServiceClient; $creds = new ServiceAccountCredentials($scopes, $json); $options = new AgentServiceClient(['credentials' => $creds]);
https://cloud.google.com/docs/authentication/external/externally-sourced-credentials
↳ credentialsConfig
array
Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() .
↳ disableRetries
bool
Determines whether or not retries defined by the client configuration should be disabled. Defaults to false
.
↳ clientConfig
string|array
Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder.
↳ transport
string|TransportInterface
The transport used for executing network requests. May be either the string rest
or grpc
. Defaults to grpc
if gRPC support is detected on the system. Advanced usage
: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface
object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.
↳ transportConfig
array
Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options.
↳ clientCertSource
callable
A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS.
↳ logger
false|LoggerInterface
A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag
↳ universeDomain
string
The service domain for the client. Defaults to 'googleapis.com'.
batchDeleteConversations
Batch deletes the specified conversations.
The async variant is AgentServiceClient::batchDeleteConversationsAsync() .
request
Google\Cloud\Ces\V1\BatchDeleteConversationsRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Ces\V1\BatchDeleteConversationsRequest;
use Google\Cloud\Ces\V1\BatchDeleteConversationsResponse;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Rpc\Status;
/**
* @param string $formattedParent The resource name of the app to delete conversations from.
* Format:
* `projects/{project}/locations/{location}/apps/{app}`
* Please see {@see AgentServiceClient::appName()} for help formatting this field.
* @param string $formattedConversationsElement The resource names of the conversations to delete. Please see
* {@see AgentServiceClient::conversationName()} for help formatting this field.
*/
function batch_delete_conversations_sample(
string $formattedParent,
string $formattedConversationsElement
): void {
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$formattedConversations = [$formattedConversationsElement,];
$request = (new BatchDeleteConversationsRequest())
->setParent($formattedParent)
->setConversations($formattedConversations);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $agentServiceClient->batchDeleteConversations($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var BatchDeleteConversationsResponse $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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
$formattedConversationsElement = AgentServiceClient::conversationName(
'[PROJECT]',
'[LOCATION]',
'[APP]',
'[CONVERSATION]'
);
batch_delete_conversations_sample($formattedParent, $formattedConversationsElement);
}
createAgent
Creates a new agent in the given app.
The async variant is AgentServiceClient::createAgentAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Agent;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\CreateAgentRequest;
/**
* @param string $formattedParent The resource name of the app to create an agent in. Please see
* {@see AgentServiceClient::appName()} for help formatting this field.
* @param string $agentDisplayName Display name of the agent.
*/
function create_agent_sample(string $formattedParent, string $agentDisplayName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$agent = (new Agent())
->setDisplayName($agentDisplayName);
$request = (new CreateAgentRequest())
->setParent($formattedParent)
->setAgent($agent);
// Call the API and handle any network failures.
try {
/** @var Agent $response */
$response = $agentServiceClient->createAgent($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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
$agentDisplayName = '[DISPLAY_NAME]';
create_agent_sample($formattedParent, $agentDisplayName);
}
createApp
Creates a new app in the given project and location.
The async variant is AgentServiceClient::createAppAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Ces\V1\App;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\CreateAppRequest;
use Google\Rpc\Status;
/**
* @param string $formattedParent The resource name of the location to create an app in. Please see
* {@see AgentServiceClient::locationName()} for help formatting this field.
* @param string $appDisplayName Display name of the app.
*/
function create_app_sample(string $formattedParent, string $appDisplayName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$app = (new App())
->setDisplayName($appDisplayName);
$request = (new CreateAppRequest())
->setParent($formattedParent)
->setApp($app);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $agentServiceClient->createApp($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var App $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 = AgentServiceClient::locationName('[PROJECT]', '[LOCATION]');
$appDisplayName = '[DISPLAY_NAME]';
create_app_sample($formattedParent, $appDisplayName);
}
createAppVersion
Creates a new app version in the given app.
The async variant is AgentServiceClient::createAppVersionAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\AppVersion;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\CreateAppVersionRequest;
/**
* @param string $formattedParent The resource name of the app to create an app version in. Please see
* {@see AgentServiceClient::appName()} for help formatting this field.
*/
function create_app_version_sample(string $formattedParent): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$appVersion = new AppVersion();
$request = (new CreateAppVersionRequest())
->setParent($formattedParent)
->setAppVersion($appVersion);
// Call the API and handle any network failures.
try {
/** @var AppVersion $response */
$response = $agentServiceClient->createAppVersion($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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
create_app_version_sample($formattedParent);
}
createDeployment
Creates a new deployment in the given app.
The async variant is AgentServiceClient::createDeploymentAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\ChannelProfile;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\CreateDeploymentRequest;
use Google\Cloud\Ces\V1\Deployment;
/**
* @param string $formattedParent The parent app.
* Format:
* `projects/{project}/locations/{location}/apps/{app}`
* Please see {@see AgentServiceClient::appName()} for help formatting this field.
* @param string $deploymentDisplayName Display name of the deployment.
* @param string $formattedDeploymentAppVersion The resource name of the app version to deploy.
* Format:
* projects/{project}/locations/{location}/apps/{app}/versions/{version}
* Please see {@see AgentServiceClient::appVersionName()} for help formatting this field.
*/
function create_deployment_sample(
string $formattedParent,
string $deploymentDisplayName,
string $formattedDeploymentAppVersion
): void {
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$deploymentChannelProfile = new ChannelProfile();
$deployment = (new Deployment())
->setDisplayName($deploymentDisplayName)
->setAppVersion($formattedDeploymentAppVersion)
->setChannelProfile($deploymentChannelProfile);
$request = (new CreateDeploymentRequest())
->setParent($formattedParent)
->setDeployment($deployment);
// Call the API and handle any network failures.
try {
/** @var Deployment $response */
$response = $agentServiceClient->createDeployment($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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
$deploymentDisplayName = '[DISPLAY_NAME]';
$formattedDeploymentAppVersion = AgentServiceClient::appVersionName(
'[PROJECT]',
'[LOCATION]',
'[APP]',
'[VERSION]'
);
create_deployment_sample($formattedParent, $deploymentDisplayName, $formattedDeploymentAppVersion);
}
createExample
Creates a new example in the given app.
The async variant is AgentServiceClient::createExampleAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\CreateExampleRequest;
use Google\Cloud\Ces\V1\Example;
/**
* @param string $formattedParent The resource name of the app to create an example in. Please see
* {@see AgentServiceClient::appName()} for help formatting this field.
* @param string $exampleDisplayName Display name of the example.
*/
function create_example_sample(string $formattedParent, string $exampleDisplayName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$example = (new Example())
->setDisplayName($exampleDisplayName);
$request = (new CreateExampleRequest())
->setParent($formattedParent)
->setExample($example);
// Call the API and handle any network failures.
try {
/** @var Example $response */
$response = $agentServiceClient->createExample($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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
$exampleDisplayName = '[DISPLAY_NAME]';
create_example_sample($formattedParent, $exampleDisplayName);
}
createGuardrail
Creates a new guardrail in the given app.
The async variant is AgentServiceClient::createGuardrailAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\CreateGuardrailRequest;
use Google\Cloud\Ces\V1\Guardrail;
/**
* @param string $formattedParent The resource name of the app to create a guardrail in. Please see
* {@see AgentServiceClient::appName()} for help formatting this field.
* @param string $guardrailDisplayName Display name of the guardrail.
*/
function create_guardrail_sample(string $formattedParent, string $guardrailDisplayName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$guardrail = (new Guardrail())
->setDisplayName($guardrailDisplayName);
$request = (new CreateGuardrailRequest())
->setParent($formattedParent)
->setGuardrail($guardrail);
// Call the API and handle any network failures.
try {
/** @var Guardrail $response */
$response = $agentServiceClient->createGuardrail($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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
$guardrailDisplayName = '[DISPLAY_NAME]';
create_guardrail_sample($formattedParent, $guardrailDisplayName);
}
createTool
Creates a new tool in the given app.
The async variant is AgentServiceClient::createToolAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\CreateToolRequest;
use Google\Cloud\Ces\V1\Tool;
/**
* @param string $formattedParent The resource name of the app to create a tool in. Please see
* {@see AgentServiceClient::appName()} for help formatting this field.
*/
function create_tool_sample(string $formattedParent): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$tool = new Tool();
$request = (new CreateToolRequest())
->setParent($formattedParent)
->setTool($tool);
// Call the API and handle any network failures.
try {
/** @var Tool $response */
$response = $agentServiceClient->createTool($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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
create_tool_sample($formattedParent);
}
createToolset
Creates a new toolset in the given app.
The async variant is AgentServiceClient::createToolsetAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\CreateToolsetRequest;
use Google\Cloud\Ces\V1\Toolset;
/**
* @param string $formattedParent The resource name of the app to create a toolset in. Please see
* {@see AgentServiceClient::appName()} for help formatting this field.
*/
function create_toolset_sample(string $formattedParent): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$toolset = new Toolset();
$request = (new CreateToolsetRequest())
->setParent($formattedParent)
->setToolset($toolset);
// Call the API and handle any network failures.
try {
/** @var Toolset $response */
$response = $agentServiceClient->createToolset($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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
create_toolset_sample($formattedParent);
}
deleteAgent
Deletes the specified agent.
The async variant is AgentServiceClient::deleteAgentAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\DeleteAgentRequest;
/**
* @param string $formattedName The resource name of the agent to delete. Please see
* {@see AgentServiceClient::agentName()} for help formatting this field.
*/
function delete_agent_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new DeleteAgentRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$agentServiceClient->deleteAgent($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 = AgentServiceClient::agentName('[PROJECT]', '[LOCATION]', '[APP]', '[AGENT]');
delete_agent_sample($formattedName);
}
deleteApp
Deletes the specified app.
The async variant is AgentServiceClient::deleteAppAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\DeleteAppRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The resource name of the app to delete. Please see
* {@see AgentServiceClient::appName()} for help formatting this field.
*/
function delete_app_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new DeleteAppRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $agentServiceClient->deleteApp($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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
delete_app_sample($formattedName);
}
deleteAppVersion
Deletes the specified app version.
The async variant is AgentServiceClient::deleteAppVersionAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\DeleteAppVersionRequest;
/**
* @param string $formattedName The resource name of the app version to delete. Please see
* {@see AgentServiceClient::appVersionName()} for help formatting this field.
*/
function delete_app_version_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new DeleteAppVersionRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$agentServiceClient->deleteAppVersion($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 = AgentServiceClient::appVersionName(
'[PROJECT]',
'[LOCATION]',
'[APP]',
'[VERSION]'
);
delete_app_version_sample($formattedName);
}
deleteConversation
Deletes the specified conversation.
The async variant is AgentServiceClient::deleteConversationAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\DeleteConversationRequest;
/**
* @param string $formattedName The resource name of the conversation to delete. Please see
* {@see AgentServiceClient::conversationName()} for help formatting this field.
*/
function delete_conversation_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new DeleteConversationRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$agentServiceClient->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 = AgentServiceClient::conversationName(
'[PROJECT]',
'[LOCATION]',
'[APP]',
'[CONVERSATION]'
);
delete_conversation_sample($formattedName);
}
deleteDeployment
Deletes the specified deployment.
The async variant is AgentServiceClient::deleteDeploymentAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\DeleteDeploymentRequest;
/**
* @param string $formattedName The name of the deployment to delete.
* Format:
* `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}`
* Please see {@see AgentServiceClient::deploymentName()} for help formatting this field.
*/
function delete_deployment_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new DeleteDeploymentRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$agentServiceClient->deleteDeployment($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 = AgentServiceClient::deploymentName(
'[PROJECT]',
'[LOCATION]',
'[APP]',
'[DEPLOYMENT]'
);
delete_deployment_sample($formattedName);
}
deleteExample
Deletes the specified example.
The async variant is AgentServiceClient::deleteExampleAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\DeleteExampleRequest;
/**
* @param string $formattedName The resource name of the example to delete. Please see
* {@see AgentServiceClient::exampleName()} for help formatting this field.
*/
function delete_example_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new DeleteExampleRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$agentServiceClient->deleteExample($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 = AgentServiceClient::exampleName('[PROJECT]', '[LOCATION]', '[APP]', '[EXAMPLE]');
delete_example_sample($formattedName);
}
deleteGuardrail
Deletes the specified guardrail.
The async variant is AgentServiceClient::deleteGuardrailAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\DeleteGuardrailRequest;
/**
* @param string $formattedName The resource name of the guardrail to delete. Please see
* {@see AgentServiceClient::guardrailName()} for help formatting this field.
*/
function delete_guardrail_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new DeleteGuardrailRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$agentServiceClient->deleteGuardrail($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 = AgentServiceClient::guardrailName(
'[PROJECT]',
'[LOCATION]',
'[APP]',
'[GUARDRAIL]'
);
delete_guardrail_sample($formattedName);
}
deleteTool
Deletes the specified tool.
The async variant is AgentServiceClient::deleteToolAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\DeleteToolRequest;
/**
* @param string $formattedName The resource name of the tool to delete. Please see
* {@see AgentServiceClient::toolName()} for help formatting this field.
*/
function delete_tool_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new DeleteToolRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$agentServiceClient->deleteTool($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 = AgentServiceClient::toolName('[PROJECT]', '[LOCATION]', '[APP]', '[TOOL]');
delete_tool_sample($formattedName);
}
deleteToolset
Deletes the specified toolset.
The async variant is AgentServiceClient::deleteToolsetAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\DeleteToolsetRequest;
/**
* @param string $formattedName The resource name of the toolset to delete. Please see
* {@see AgentServiceClient::toolsetName()} for help formatting this field.
*/
function delete_toolset_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new DeleteToolsetRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$agentServiceClient->deleteToolset($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 = AgentServiceClient::toolsetName('[PROJECT]', '[LOCATION]', '[APP]', '[TOOLSET]');
delete_toolset_sample($formattedName);
}
exportApp
Exports the specified app.
The async variant is AgentServiceClient::exportAppAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\ExportAppRequest;
use Google\Cloud\Ces\V1\ExportAppRequest\ExportFormat;
use Google\Cloud\Ces\V1\ExportAppResponse;
use Google\Rpc\Status;
/**
* @param string $formattedName The resource name of the app to export. Please see
* {@see AgentServiceClient::appName()} for help formatting this field.
* @param int $exportFormat The format to export the app in.
*/
function export_app_sample(string $formattedName, int $exportFormat): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new ExportAppRequest())
->setName($formattedName)
->setExportFormat($exportFormat);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $agentServiceClient->exportApp($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var ExportAppResponse $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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
$exportFormat = ExportFormat::EXPORT_FORMAT_UNSPECIFIED;
export_app_sample($formattedName, $exportFormat);
}
getAgent
Gets details of the specified agent.
The async variant is AgentServiceClient::getAgentAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Agent;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\GetAgentRequest;
/**
* @param string $formattedName The resource name of the agent to retrieve. Please see
* {@see AgentServiceClient::agentName()} for help formatting this field.
*/
function get_agent_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new GetAgentRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Agent $response */
$response = $agentServiceClient->getAgent($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 = AgentServiceClient::agentName('[PROJECT]', '[LOCATION]', '[APP]', '[AGENT]');
get_agent_sample($formattedName);
}
getApp
Gets details of the specified app.
The async variant is AgentServiceClient::getAppAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\App;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\GetAppRequest;
/**
* @param string $formattedName The resource name of the app to retrieve. Please see
* {@see AgentServiceClient::appName()} for help formatting this field.
*/
function get_app_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new GetAppRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var App $response */
$response = $agentServiceClient->getApp($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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
get_app_sample($formattedName);
}
getAppVersion
Gets details of the specified app version.
The async variant is AgentServiceClient::getAppVersionAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\AppVersion;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\GetAppVersionRequest;
/**
* @param string $formattedName The resource name of the app version to retrieve. Please see
* {@see AgentServiceClient::appVersionName()} for help formatting this field.
*/
function get_app_version_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new GetAppVersionRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var AppVersion $response */
$response = $agentServiceClient->getAppVersion($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 = AgentServiceClient::appVersionName(
'[PROJECT]',
'[LOCATION]',
'[APP]',
'[VERSION]'
);
get_app_version_sample($formattedName);
}
getChangelog
Gets the specified changelog.
The async variant is AgentServiceClient::getChangelogAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Changelog;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\GetChangelogRequest;
/**
* @param string $formattedName The resource name of the changelog to retrieve. Please see
* {@see AgentServiceClient::changelogName()} for help formatting this field.
*/
function get_changelog_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new GetChangelogRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Changelog $response */
$response = $agentServiceClient->getChangelog($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 = AgentServiceClient::changelogName(
'[PROJECT]',
'[LOCATION]',
'[APP]',
'[CHANGELOG]'
);
get_changelog_sample($formattedName);
}
getConversation
Gets details of the specified conversation.
The async variant is AgentServiceClient::getConversationAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\Conversation;
use Google\Cloud\Ces\V1\GetConversationRequest;
/**
* @param string $formattedName The resource name of the conversation to retrieve. Please see
* {@see AgentServiceClient::conversationName()} for help formatting this field.
*/
function get_conversation_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new GetConversationRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Conversation $response */
$response = $agentServiceClient->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 = AgentServiceClient::conversationName(
'[PROJECT]',
'[LOCATION]',
'[APP]',
'[CONVERSATION]'
);
get_conversation_sample($formattedName);
}
getDeployment
Gets details of the specified deployment.
The async variant is AgentServiceClient::getDeploymentAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\Deployment;
use Google\Cloud\Ces\V1\GetDeploymentRequest;
/**
* @param string $formattedName The name of the deployment.
* Format:
* `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}`
* Please see {@see AgentServiceClient::deploymentName()} for help formatting this field.
*/
function get_deployment_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new GetDeploymentRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Deployment $response */
$response = $agentServiceClient->getDeployment($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 = AgentServiceClient::deploymentName(
'[PROJECT]',
'[LOCATION]',
'[APP]',
'[DEPLOYMENT]'
);
get_deployment_sample($formattedName);
}
getExample
Gets details of the specified example.
The async variant is AgentServiceClient::getExampleAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\Example;
use Google\Cloud\Ces\V1\GetExampleRequest;
/**
* @param string $formattedName The resource name of the example to retrieve. Please see
* {@see AgentServiceClient::exampleName()} for help formatting this field.
*/
function get_example_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new GetExampleRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Example $response */
$response = $agentServiceClient->getExample($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 = AgentServiceClient::exampleName('[PROJECT]', '[LOCATION]', '[APP]', '[EXAMPLE]');
get_example_sample($formattedName);
}
getGuardrail
Gets details of the specified guardrail.
The async variant is AgentServiceClient::getGuardrailAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\GetGuardrailRequest;
use Google\Cloud\Ces\V1\Guardrail;
/**
* @param string $formattedName The resource name of the guardrail to retrieve. Please see
* {@see AgentServiceClient::guardrailName()} for help formatting this field.
*/
function get_guardrail_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new GetGuardrailRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Guardrail $response */
$response = $agentServiceClient->getGuardrail($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 = AgentServiceClient::guardrailName(
'[PROJECT]',
'[LOCATION]',
'[APP]',
'[GUARDRAIL]'
);
get_guardrail_sample($formattedName);
}
getTool
Gets details of the specified tool.
The async variant is AgentServiceClient::getToolAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\GetToolRequest;
use Google\Cloud\Ces\V1\Tool;
/**
* @param string $formattedName The resource name of the tool to retrieve. Please see
* {@see AgentServiceClient::toolName()} for help formatting this field.
*/
function get_tool_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new GetToolRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Tool $response */
$response = $agentServiceClient->getTool($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 = AgentServiceClient::toolName('[PROJECT]', '[LOCATION]', '[APP]', '[TOOL]');
get_tool_sample($formattedName);
}
getToolset
Gets details of the specified toolset.
The async variant is AgentServiceClient::getToolsetAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\GetToolsetRequest;
use Google\Cloud\Ces\V1\Toolset;
/**
* @param string $formattedName The resource name of the toolset to retrieve. Please see
* {@see AgentServiceClient::toolsetName()} for help formatting this field.
*/
function get_toolset_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new GetToolsetRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Toolset $response */
$response = $agentServiceClient->getToolset($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 = AgentServiceClient::toolsetName('[PROJECT]', '[LOCATION]', '[APP]', '[TOOLSET]');
get_toolset_sample($formattedName);
}
importApp
Imports the specified app.
The async variant is AgentServiceClient::importAppAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\ImportAppRequest;
use Google\Cloud\Ces\V1\ImportAppResponse;
use Google\Rpc\Status;
/**
* @param string $formattedParent The parent resource name with the location of the app to import. Please see
* {@see AgentServiceClient::locationName()} for help formatting this field.
*/
function import_app_sample(string $formattedParent): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new ImportAppRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $agentServiceClient->importApp($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var ImportAppResponse $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 = AgentServiceClient::locationName('[PROJECT]', '[LOCATION]');
import_app_sample($formattedParent);
}
listAgents
Lists agents in the given app.
The async variant is AgentServiceClient::listAgentsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Ces\V1\Agent;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\ListAgentsRequest;
/**
* @param string $formattedParent The resource name of the app to list agents from. Please see
* {@see AgentServiceClient::appName()} for help formatting this field.
*/
function list_agents_sample(string $formattedParent): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new ListAgentsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $agentServiceClient->listAgents($request);
/** @var Agent $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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
list_agents_sample($formattedParent);
}
listAppVersions
Lists all app versions in the given app.
The async variant is AgentServiceClient::listAppVersionsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Ces\V1\AppVersion;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\ListAppVersionsRequest;
/**
* @param string $formattedParent The resource name of the app to list app versions from. Please see
* {@see AgentServiceClient::appName()} for help formatting this field.
*/
function list_app_versions_sample(string $formattedParent): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new ListAppVersionsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $agentServiceClient->listAppVersions($request);
/** @var AppVersion $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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
list_app_versions_sample($formattedParent);
}
listApps
Lists apps in the given project and location.
The async variant is AgentServiceClient::listAppsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Ces\V1\App;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\ListAppsRequest;
/**
* @param string $formattedParent The resource name of the location to list apps from. Please see
* {@see AgentServiceClient::locationName()} for help formatting this field.
*/
function list_apps_sample(string $formattedParent): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new ListAppsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $agentServiceClient->listApps($request);
/** @var App $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 = AgentServiceClient::locationName('[PROJECT]', '[LOCATION]');
list_apps_sample($formattedParent);
}
listChangelogs
Lists the changelogs of the specified app.
The async variant is AgentServiceClient::listChangelogsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Ces\V1\Changelog;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\ListChangelogsRequest;
/**
* @param string $formattedParent The resource name of the app to list changelogs from. Please see
* {@see AgentServiceClient::appName()} for help formatting this field.
*/
function list_changelogs_sample(string $formattedParent): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new ListChangelogsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $agentServiceClient->listChangelogs($request);
/** @var Changelog $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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
list_changelogs_sample($formattedParent);
}
listConversations
Lists conversations in the given app.
The async variant is AgentServiceClient::listConversationsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\Conversation;
use Google\Cloud\Ces\V1\ListConversationsRequest;
/**
* @param string $formattedParent The resource name of the app to list conversations from. Please see
* {@see AgentServiceClient::appName()} for help formatting this field.
*/
function list_conversations_sample(string $formattedParent): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new ListConversationsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $agentServiceClient->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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
list_conversations_sample($formattedParent);
}
listDeployments
Lists deployments in the given app.
The async variant is AgentServiceClient::listDeploymentsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\Deployment;
use Google\Cloud\Ces\V1\ListDeploymentsRequest;
/**
* @param string $formattedParent The parent app.
* Format:
* `projects/{project}/locations/{location}/apps/{app}`
* Please see {@see AgentServiceClient::appName()} for help formatting this field.
*/
function list_deployments_sample(string $formattedParent): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new ListDeploymentsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $agentServiceClient->listDeployments($request);
/** @var Deployment $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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
list_deployments_sample($formattedParent);
}
listExamples
Lists examples in the given app.
The async variant is AgentServiceClient::listExamplesAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\Example;
use Google\Cloud\Ces\V1\ListExamplesRequest;
/**
* @param string $formattedParent The resource name of the app to list examples from. Please see
* {@see AgentServiceClient::appName()} for help formatting this field.
*/
function list_examples_sample(string $formattedParent): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new ListExamplesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $agentServiceClient->listExamples($request);
/** @var Example $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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
list_examples_sample($formattedParent);
}
listGuardrails
Lists guardrails in the given app.
The async variant is AgentServiceClient::listGuardrailsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\Guardrail;
use Google\Cloud\Ces\V1\ListGuardrailsRequest;
/**
* @param string $formattedParent The resource name of the app to list guardrails from. Please see
* {@see AgentServiceClient::appName()} for help formatting this field.
*/
function list_guardrails_sample(string $formattedParent): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new ListGuardrailsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $agentServiceClient->listGuardrails($request);
/** @var Guardrail $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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
list_guardrails_sample($formattedParent);
}
listTools
Lists tools in the given app.
The async variant is AgentServiceClient::listToolsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\ListToolsRequest;
use Google\Cloud\Ces\V1\Tool;
/**
* @param string $formattedParent The resource name of the app to list tools from. Please see
* {@see AgentServiceClient::appName()} for help formatting this field.
*/
function list_tools_sample(string $formattedParent): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new ListToolsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $agentServiceClient->listTools($request);
/** @var Tool $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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
list_tools_sample($formattedParent);
}
listToolsets
Lists toolsets in the given app.
The async variant is AgentServiceClient::listToolsetsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\ListToolsetsRequest;
use Google\Cloud\Ces\V1\Toolset;
/**
* @param string $formattedParent The resource name of the app to list toolsets from. Please see
* {@see AgentServiceClient::appName()} for help formatting this field.
*/
function list_toolsets_sample(string $formattedParent): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new ListToolsetsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $agentServiceClient->listToolsets($request);
/** @var Toolset $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 = AgentServiceClient::appName('[PROJECT]', '[LOCATION]', '[APP]');
list_toolsets_sample($formattedParent);
}
restoreAppVersion
Restores the specified app version.
This will create a new app version from the current draft app and overwrite the current draft with the specified app version.
The async variant is AgentServiceClient::restoreAppVersionAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\RestoreAppVersionRequest;
use Google\Cloud\Ces\V1\RestoreAppVersionResponse;
use Google\Rpc\Status;
/**
* @param string $formattedName The resource name of the app version to restore. Please see
* {@see AgentServiceClient::appVersionName()} for help formatting this field.
*/
function restore_app_version_sample(string $formattedName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = (new RestoreAppVersionRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $agentServiceClient->restoreAppVersion($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var RestoreAppVersionResponse $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 = AgentServiceClient::appVersionName(
'[PROJECT]',
'[LOCATION]',
'[APP]',
'[VERSION]'
);
restore_app_version_sample($formattedName);
}
updateAgent
Updates the specified agent.
The async variant is AgentServiceClient::updateAgentAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Agent;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\UpdateAgentRequest;
/**
* @param string $agentDisplayName Display name of the agent.
*/
function update_agent_sample(string $agentDisplayName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$agent = (new Agent())
->setDisplayName($agentDisplayName);
$request = (new UpdateAgentRequest())
->setAgent($agent);
// Call the API and handle any network failures.
try {
/** @var Agent $response */
$response = $agentServiceClient->updateAgent($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
{
$agentDisplayName = '[DISPLAY_NAME]';
update_agent_sample($agentDisplayName);
}
updateApp
Updates the specified app.
The async variant is AgentServiceClient::updateAppAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\App;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\UpdateAppRequest;
/**
* @param string $appDisplayName Display name of the app.
*/
function update_app_sample(string $appDisplayName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$app = (new App())
->setDisplayName($appDisplayName);
$request = (new UpdateAppRequest())
->setApp($app);
// Call the API and handle any network failures.
try {
/** @var App $response */
$response = $agentServiceClient->updateApp($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
{
$appDisplayName = '[DISPLAY_NAME]';
update_app_sample($appDisplayName);
}
updateDeployment
Updates the specified deployment.
The async variant is AgentServiceClient::updateDeploymentAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\ChannelProfile;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\Deployment;
use Google\Cloud\Ces\V1\UpdateDeploymentRequest;
/**
* @param string $deploymentDisplayName Display name of the deployment.
* @param string $formattedDeploymentAppVersion The resource name of the app version to deploy.
* Format:
* projects/{project}/locations/{location}/apps/{app}/versions/{version}
* Please see {@see AgentServiceClient::appVersionName()} for help formatting this field.
*/
function update_deployment_sample(
string $deploymentDisplayName,
string $formattedDeploymentAppVersion
): void {
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$deploymentChannelProfile = new ChannelProfile();
$deployment = (new Deployment())
->setDisplayName($deploymentDisplayName)
->setAppVersion($formattedDeploymentAppVersion)
->setChannelProfile($deploymentChannelProfile);
$request = (new UpdateDeploymentRequest())
->setDeployment($deployment);
// Call the API and handle any network failures.
try {
/** @var Deployment $response */
$response = $agentServiceClient->updateDeployment($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
{
$deploymentDisplayName = '[DISPLAY_NAME]';
$formattedDeploymentAppVersion = AgentServiceClient::appVersionName(
'[PROJECT]',
'[LOCATION]',
'[APP]',
'[VERSION]'
);
update_deployment_sample($deploymentDisplayName, $formattedDeploymentAppVersion);
}
updateExample
Updates the specified example.
The async variant is AgentServiceClient::updateExampleAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\Example;
use Google\Cloud\Ces\V1\UpdateExampleRequest;
/**
* @param string $exampleDisplayName Display name of the example.
*/
function update_example_sample(string $exampleDisplayName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$example = (new Example())
->setDisplayName($exampleDisplayName);
$request = (new UpdateExampleRequest())
->setExample($example);
// Call the API and handle any network failures.
try {
/** @var Example $response */
$response = $agentServiceClient->updateExample($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
{
$exampleDisplayName = '[DISPLAY_NAME]';
update_example_sample($exampleDisplayName);
}
updateGuardrail
Updates the specified guardrail.
The async variant is AgentServiceClient::updateGuardrailAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\Guardrail;
use Google\Cloud\Ces\V1\UpdateGuardrailRequest;
/**
* @param string $guardrailDisplayName Display name of the guardrail.
*/
function update_guardrail_sample(string $guardrailDisplayName): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$guardrail = (new Guardrail())
->setDisplayName($guardrailDisplayName);
$request = (new UpdateGuardrailRequest())
->setGuardrail($guardrail);
// Call the API and handle any network failures.
try {
/** @var Guardrail $response */
$response = $agentServiceClient->updateGuardrail($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
{
$guardrailDisplayName = '[DISPLAY_NAME]';
update_guardrail_sample($guardrailDisplayName);
}
updateTool
Updates the specified tool.
The async variant is AgentServiceClient::updateToolAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\Tool;
use Google\Cloud\Ces\V1\UpdateToolRequest;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_tool_sample(): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$tool = new Tool();
$request = (new UpdateToolRequest())
->setTool($tool);
// Call the API and handle any network failures.
try {
/** @var Tool $response */
$response = $agentServiceClient->updateTool($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateToolset
Updates the specified toolset.
The async variant is AgentServiceClient::updateToolsetAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Ces\V1\Toolset;
use Google\Cloud\Ces\V1\UpdateToolsetRequest;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_toolset_sample(): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$toolset = new Toolset();
$request = (new UpdateToolsetRequest())
->setToolset($toolset);
// Call the API and handle any network failures.
try {
/** @var Toolset $response */
$response = $agentServiceClient->updateToolset($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
getLocation
Gets information about a location.
The async variant is AgentServiceClient::getLocationAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Location\GetLocationRequest;
use Google\Cloud\Location\Location;
/**
* 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 get_location_sample(): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = new GetLocationRequest();
// Call the API and handle any network failures.
try {
/** @var Location $response */
$response = $agentServiceClient->getLocation($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
listLocations
Lists information about the supported locations for this service.
This method can be called in two ways:
List all public locations:Use the path GET /v1/locations
. List project-visible locations:Use the path GET /v1/projects/{project_id}/locations
. This may include public
locations as well as private or other locations specifically visible
to the project.
The async variant is AgentServiceClient::listLocationsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Ces\V1\Client\AgentServiceClient;
use Google\Cloud\Location\ListLocationsRequest;
use Google\Cloud\Location\Location;
/**
* 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 list_locations_sample(): void
{
// Create a client.
$agentServiceClient = new AgentServiceClient();
// Prepare the request message.
$request = new ListLocationsRequest();
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $agentServiceClient->listLocations($request);
/** @var Location $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());
}
}
batchDeleteConversationsAsync
optionalArgs
array
createAgentAsync
createAppAsync
createAppVersionAsync
createDeploymentAsync
createExampleAsync
createGuardrailAsync
createToolAsync
createToolsetAsync
deleteAgentAsync
deleteAppAsync
deleteAppVersionAsync
deleteConversationAsync
optionalArgs
array
deleteDeploymentAsync
deleteExampleAsync
deleteGuardrailAsync
deleteToolAsync
deleteToolsetAsync
exportAppAsync
getAgentAsync
getAppAsync
getAppVersionAsync
getChangelogAsync
getConversationAsync
getDeploymentAsync
getExampleAsync
getGuardrailAsync
getToolAsync
getToolsetAsync
importAppAsync
listAgentsAsync
listAppVersionsAsync
listAppsAsync
listChangelogsAsync
listConversationsAsync
listDeploymentsAsync
listExamplesAsync
listGuardrailsAsync
listToolsAsync
listToolsetsAsync
restoreAppVersionAsync
updateAgentAsync
updateAppAsync
updateDeploymentAsync
updateExampleAsync
updateGuardrailAsync
updateToolAsync
updateToolsetAsync
getLocationAsync
listLocationsAsync
getOperationsClient
Return an OperationsClient object with the same endpoint as $this.
Google\LongRunning\Client\OperationsClient
resumeOperation
Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.
operationName
string
The name of the long running operation
methodName
string
The name of the method used to start the operation
static::agentName
Formats a string containing the fully-qualified path to represent a agent resource.
project
string
location
string
app
string
agent
string
string
static::appName
Formats a string containing the fully-qualified path to represent a app resource.
project
string
location
string
app
string
string
static::appVersionName
Formats a string containing the fully-qualified path to represent a app_version resource.
project
string
location
string
app
string
version
string
string
static::changelogName
Formats a string containing the fully-qualified path to represent a changelog resource.
project
string
location
string
app
string
changelog
string
string
static::conversationName
Formats a string containing the fully-qualified path to represent a conversation resource.
project
string
location
string
app
string
conversation
string
string
static::deidentifyTemplateName
Formats a string containing the fully-qualified path to represent a deidentify_template resource.
organization
string
location
string
deidentifyTemplate
string
string
static::deploymentName
Formats a string containing the fully-qualified path to represent a deployment resource.
project
string
location
string
app
string
deployment
string
string
static::dialogflowAgentName
Formats a string containing the fully-qualified path to represent a dialogflow_agent resource.
project
string
location
string
agent
string
string
static::engineName
Formats a string containing the fully-qualified path to represent a engine resource.
project
string
location
string
collection
string
engine
string
string
static::exampleName
Formats a string containing the fully-qualified path to represent a example resource.
project
string
location
string
app
string
example
string
string
static::guardrailName
Formats a string containing the fully-qualified path to represent a guardrail resource.
project
string
location
string
app
string
guardrail
string
string
static::inspectTemplateName
Formats a string containing the fully-qualified path to represent a inspect_template resource.
organization
string
location
string
inspectTemplate
string
string
static::locationName
Formats a string containing the fully-qualified path to represent a location resource.
project
string
location
string
string
static::organizationLocationDeidentifyTemplateName
Formats a string containing the fully-qualified path to represent a organization_location_deidentify_template resource.
organization
string
location
string
deidentifyTemplate
string
string
static::organizationLocationInspectTemplateName
Formats a string containing the fully-qualified path to represent a organization_location_inspect_template resource.
organization
string
location
string
inspectTemplate
string
string
static::projectLocationDeidentifyTemplateName
Formats a string containing the fully-qualified path to represent a project_location_deidentify_template resource.
project
string
location
string
deidentifyTemplate
string
string
static::projectLocationInspectTemplateName
Formats a string containing the fully-qualified path to represent a project_location_inspect_template resource.
project
string
location
string
inspectTemplate
string
string
static::secretVersionName
Formats a string containing the fully-qualified path to represent a secret_version resource.
project
string
secret
string
secretVersion
string
string
static::serviceName
Formats a string containing the fully-qualified path to represent a service resource.
project
string
location
string
namespace
string
service
string
string
static::toolName
Formats a string containing the fully-qualified path to represent a tool resource.
project
string
location
string
app
string
tool
string
string
static::toolsetName
Formats a string containing the fully-qualified path to represent a toolset resource.
project
string
location
string
app
string
toolset
string
string
static::parseName
Parses a formatted name string and returns an associative array of the components in the name.
The following name formats are supported: Template: Pattern
- agent: projects/{project}/locations/{location}/apps/{app}/agents/{agent}
- app: projects/{project}/locations/{location}/apps/{app}
- appVersion: projects/{project}/locations/{location}/apps/{app}/versions/{version}
- changelog: projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}
- conversation: projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}
- deidentifyTemplate: organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}
- deployment: projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}
- dialogflowAgent: projects/{project}/locations/{location}/agents/{agent}
- engine: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}
- example: projects/{project}/locations/{location}/apps/{app}/examples/{example}
- guardrail: projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}
- inspectTemplate: organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}
- location: projects/{project}/locations/{location}
- organizationLocationDeidentifyTemplate: organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}
- organizationLocationInspectTemplate: organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}
- projectLocationDeidentifyTemplate: projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}
- projectLocationInspectTemplate: projects/{project}/locations/{location}/inspectTemplates/{inspect_template}
- secretVersion: projects/{project}/secrets/{secret}/versions/{secret_version}
- service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}
- tool: projects/{project}/locations/{location}/apps/{app}/tools/{tool}
- toolset: projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}
The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.
formattedName
string
The formatted name string
template
?string
Optional name of template to match
array

