Google Cloud Ces V1 Client - Class AgentServiceClient (0.1.0)

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 \ Client

Methods

__construct

Constructor.

Parameters
Name Description
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() .

Parameters
Name Description
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.

Returns
Type Description
Google\ApiCore\OperationResponse<Google\Cloud\Ces\V1\BatchDeleteConversationsResponse>
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\CreateAgentRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Agent
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\CreateAppRequest

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.

Returns
Type Description
Google\ApiCore\OperationResponse<Google\Cloud\Ces\V1\App>
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\CreateAppVersionRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\AppVersion
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\CreateDeploymentRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Deployment
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\CreateExampleRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Example
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\CreateGuardrailRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Guardrail
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\CreateToolRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Tool
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\CreateToolsetRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Toolset
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\DeleteAgentRequest

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.

Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\DeleteAppRequest

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.

Returns
Type Description
Google\ApiCore\OperationResponse<null>
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\DeleteAppVersionRequest

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.

Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\DeleteConversationRequest

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.

Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\DeleteDeploymentRequest

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.

Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\DeleteExampleRequest

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.

Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\DeleteGuardrailRequest

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.

Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\DeleteToolRequest

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.

Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\DeleteToolsetRequest

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.

Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\ExportAppRequest

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.

Returns
Type Description
Google\ApiCore\OperationResponse<Google\Cloud\Ces\V1\ExportAppResponse>
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\GetAgentRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Agent
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\GetAppRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\App
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\GetAppVersionRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\AppVersion
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\GetChangelogRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Changelog
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\GetConversationRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Conversation
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\GetDeploymentRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Deployment
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\GetExampleRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Example
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\GetGuardrailRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Guardrail
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\GetToolRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Tool
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\GetToolsetRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Toolset
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\ImportAppRequest

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.

Returns
Type Description
Google\ApiCore\OperationResponse<Google\Cloud\Ces\V1\ImportAppResponse>
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\ListAgentsRequest

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.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\ListAppVersionsRequest

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.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\ListAppsRequest

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.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\ListChangelogsRequest

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.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\ListConversationsRequest

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.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\ListDeploymentsRequest

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.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\ListExamplesRequest

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.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\ListGuardrailsRequest

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.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\ListToolsRequest

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.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\ListToolsetsRequest

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.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\RestoreAppVersionRequest

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.

Returns
Type Description
Google\ApiCore\OperationResponse<Google\Cloud\Ces\V1\RestoreAppVersionResponse>
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\UpdateAgentRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Agent
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\UpdateAppRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\App
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\UpdateDeploymentRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Deployment
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\UpdateExampleRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Example
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\UpdateGuardrailRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Guardrail
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\UpdateToolRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Tool
Example
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() .

Parameters
Name Description
request Google\Cloud\Ces\V1\UpdateToolsetRequest

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.

Returns
Type Description
Google\Cloud\Ces\V1\Toolset
Example
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() .

Parameters
Name Description
request Google\Cloud\Location\GetLocationRequest

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.

Returns
Type Description
Google\Cloud\Location\Location
Example
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() .

Parameters
Name Description
request Google\Cloud\Location\ListLocationsRequest

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.

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
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

Parameters
Name Description
request Google\Cloud\Ces\V1\BatchDeleteConversationsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

createAgentAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\CreateAgentRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Agent>

createAppAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\CreateAppRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

createAppVersionAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\CreateAppVersionRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\AppVersion>

createDeploymentAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\CreateDeploymentRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Deployment>

createExampleAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\CreateExampleRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Example>

createGuardrailAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\CreateGuardrailRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Guardrail>

createToolAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\CreateToolRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Tool>

createToolsetAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\CreateToolsetRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Toolset>

deleteAgentAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\DeleteAgentRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<void>

deleteAppAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\DeleteAppRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

deleteAppVersionAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\DeleteAppVersionRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<void>

deleteConversationAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\DeleteConversationRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<void>

deleteDeploymentAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\DeleteDeploymentRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<void>

deleteExampleAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\DeleteExampleRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<void>

deleteGuardrailAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\DeleteGuardrailRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<void>

deleteToolAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\DeleteToolRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<void>

deleteToolsetAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\DeleteToolsetRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<void>

exportAppAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\ExportAppRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

getAgentAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\GetAgentRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Agent>

getAppAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\GetAppRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\App>

getAppVersionAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\GetAppVersionRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\AppVersion>

getChangelogAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\GetChangelogRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Changelog>

getConversationAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\GetConversationRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Conversation>

getDeploymentAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\GetDeploymentRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Deployment>

getExampleAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\GetExampleRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Example>

getGuardrailAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\GetGuardrailRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Guardrail>

getToolAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\GetToolRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Tool>

getToolsetAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\GetToolsetRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Toolset>

importAppAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\ImportAppRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

listAgentsAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\ListAgentsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listAppVersionsAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\ListAppVersionsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listAppsAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\ListAppsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listChangelogsAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\ListChangelogsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listConversationsAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\ListConversationsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listDeploymentsAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\ListDeploymentsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listExamplesAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\ListExamplesRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listGuardrailsAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\ListGuardrailsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listToolsAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\ListToolsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listToolsetsAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\ListToolsetsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

restoreAppVersionAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\RestoreAppVersionRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

updateAgentAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\UpdateAgentRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Agent>

updateAppAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\UpdateAppRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\App>

updateDeploymentAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\UpdateDeploymentRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Deployment>

updateExampleAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\UpdateExampleRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Example>

updateGuardrailAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\UpdateGuardrailRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Guardrail>

updateToolAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\UpdateToolRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Tool>

updateToolsetAsync

Parameters
Name Description
request Google\Cloud\Ces\V1\UpdateToolsetRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Ces\V1\Toolset>

getLocationAsync

Parameters
Name Description
request Google\Cloud\Location\GetLocationRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Location\Location>

listLocationsAsync

Parameters
Name Description
request Google\Cloud\Location\ListLocationsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

getOperationsClient

Return an OperationsClient object with the same endpoint as $this.

Returns
Type Description
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.

Parameters
Name Description
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
Type Description
Google\ApiCore\OperationResponse

static::agentName

Formats a string containing the fully-qualified path to represent a agent resource.

Parameters
Name Description
project string
location string
app string
agent string
Returns
Type Description
string The formatted agent resource.

static::appName

Formats a string containing the fully-qualified path to represent a app resource.

Parameters
Name Description
project string
location string
app string
Returns
Type Description
string The formatted app resource.

static::appVersionName

Formats a string containing the fully-qualified path to represent a app_version resource.

Parameters
Name Description
project string
location string
app string
version string
Returns
Type Description
string The formatted app_version resource.

static::changelogName

Formats a string containing the fully-qualified path to represent a changelog resource.

Parameters
Name Description
project string
location string
app string
changelog string
Returns
Type Description
string The formatted changelog resource.

static::conversationName

Formats a string containing the fully-qualified path to represent a conversation resource.

Parameters
Name Description
project string
location string
app string
conversation string
Returns
Type Description
string The formatted conversation resource.

static::deidentifyTemplateName

Formats a string containing the fully-qualified path to represent a deidentify_template resource.

Parameters
Name Description
organization string
location string
deidentifyTemplate string
Returns
Type Description
string The formatted deidentify_template resource.

static::deploymentName

Formats a string containing the fully-qualified path to represent a deployment resource.

Parameters
Name Description
project string
location string
app string
deployment string
Returns
Type Description
string The formatted deployment resource.

static::dialogflowAgentName

Formats a string containing the fully-qualified path to represent a dialogflow_agent resource.

Parameters
Name Description
project string
location string
agent string
Returns
Type Description
string The formatted dialogflow_agent resource.

static::engineName

Formats a string containing the fully-qualified path to represent a engine resource.

Parameters
Name Description
project string
location string
collection string
engine string
Returns
Type Description
string The formatted engine resource.

static::exampleName

Formats a string containing the fully-qualified path to represent a example resource.

Parameters
Name Description
project string
location string
app string
example string
Returns
Type Description
string The formatted example resource.

static::guardrailName

Formats a string containing the fully-qualified path to represent a guardrail resource.

Parameters
Name Description
project string
location string
app string
guardrail string
Returns
Type Description
string The formatted guardrail resource.

static::inspectTemplateName

Formats a string containing the fully-qualified path to represent a inspect_template resource.

Parameters
Name Description
organization string
location string
inspectTemplate string
Returns
Type Description
string The formatted inspect_template resource.

static::locationName

Formats a string containing the fully-qualified path to represent a location resource.

Parameters
Name Description
project string
location string
Returns
Type Description
string The formatted location resource.

static::organizationLocationDeidentifyTemplateName

Formats a string containing the fully-qualified path to represent a organization_location_deidentify_template resource.

Parameters
Name Description
organization string
location string
deidentifyTemplate string
Returns
Type Description
string The formatted organization_location_deidentify_template resource.

static::organizationLocationInspectTemplateName

Formats a string containing the fully-qualified path to represent a organization_location_inspect_template resource.

Parameters
Name Description
organization string
location string
inspectTemplate string
Returns
Type Description
string The formatted organization_location_inspect_template resource.

static::projectLocationDeidentifyTemplateName

Formats a string containing the fully-qualified path to represent a project_location_deidentify_template resource.

Parameters
Name Description
project string
location string
deidentifyTemplate string
Returns
Type Description
string The formatted project_location_deidentify_template resource.

static::projectLocationInspectTemplateName

Formats a string containing the fully-qualified path to represent a project_location_inspect_template resource.

Parameters
Name Description
project string
location string
inspectTemplate string
Returns
Type Description
string The formatted project_location_inspect_template resource.

static::secretVersionName

Formats a string containing the fully-qualified path to represent a secret_version resource.

Parameters
Name Description
project string
secret string
secretVersion string
Returns
Type Description
string The formatted secret_version resource.

static::serviceName

Formats a string containing the fully-qualified path to represent a service resource.

Parameters
Name Description
project string
location string
namespace string
service string
Returns
Type Description
string The formatted service resource.

static::toolName

Formats a string containing the fully-qualified path to represent a tool resource.

Parameters
Name Description
project string
location string
app string
tool string
Returns
Type Description
string The formatted tool resource.

static::toolsetName

Formats a string containing the fully-qualified path to represent a toolset resource.

Parameters
Name Description
project string
location string
app string
toolset string
Returns
Type Description
string The formatted toolset resource.

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.

Parameters
Name Description
formattedName string

The formatted name string

template ?string

Optional name of template to match

Returns
Type Description
array An associative array from name component IDs to component values.